define.dart 634 B

123456789101112131415161718192021222324
  1. import 'package:flutter/material.dart';
  2. /// F组件
  3. abstract class FWidget extends Widget {
  4. static bool _hasInit = false;
  5. static double _maxWebMobileWidth = 600;
  6. /// web移动端最大适配宽度
  7. static double get maxWebMobileFitWidth => _maxWebMobileWidth;
  8. /// 全局初始化
  9. static void init({double? maxWebMobileWidth}) {
  10. if (_hasInit) return;
  11. if (maxWebMobileWidth != null) _maxWebMobileWidth = maxWebMobileFitWidth;
  12. _hasInit = true;
  13. }
  14. //
  15. }
  16. /// F组件建造器
  17. typedef FWidgetBuilder = FWidget Function(BuildContext context);
  18. /// F组件建造器
  19. typedef FWidgetVoidBuilder = FWidget Function();