Files
jiu/client/lib/core/responsive/responsive.dart
T
wangjia 480ce836bb
Deploy / build-linux-web (push) Successful in 53s
Deploy / build-windows (push) Successful in 1m48s
Deploy / build-macos (push) Successful in 1m17s
Deploy / build-android (push) Successful in 4m13s
Deploy / build-ios (push) Successful in 9s
Deploy / release-deploy (push) Successful in 1m37s
chore: release v1.0.18
移动端响应式适配(抽屉导航/列表卡片/弹窗自适应)、Android 正式签名与 APK 发布、
iOS(TestFlight) 工程与 CI、多平台构建流水线、相关文档同步。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 07:55:33 +08:00

16 lines
584 B
Dart

import 'package:flutter/widgets.dart';
/// 移动端断点:宽度 < 600 视为窄屏(手机)。
const double kMobileBreakpoint = 600;
extension ResponsiveX on BuildContext {
/// 是否为窄屏(手机)布局。宽屏(桌面 / Web / 平板)返回 false。
bool get isMobile => MediaQuery.sizeOf(this).width < kMobileBreakpoint;
/// 固定宽度弹窗的安全宽度:不超过屏宽的 92%,避免窄屏溢出。
double dialogWidth(double preferred) {
final max = MediaQuery.sizeOf(this).width * 0.92;
return preferred < max ? preferred : max;
}
}