utility.dart 295 B

123456789101112
  1. import 'package:flutter/widgets.dart';
  2. import 'package:shuqi/utility/screen.dart';
  3. afterLayout(VoidCallback callback) {
  4. WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
  5. callback();
  6. });
  7. }
  8. fixedFontSize(double fontSize) {
  9. return fontSize / Screen.textScaleFactor;
  10. }