Files
MWClash/lib/common/context.dart

22 lines
491 B
Dart
Raw Normal View History

2024-04-30 23:38:49 +08:00
import 'package:fl_clash/widgets/scaffold.dart';
import 'package:flutter/material.dart';
extension BuildContextExtension on BuildContext {
CommonScaffoldState? get commonScaffoldState {
return findAncestorStateOfType<CommonScaffoldState>();
}
Size get appSize{
return MediaQuery.of(this).size;
}
double get viewWidth {
return appSize.width;
2024-04-30 23:38:49 +08:00
}
ColorScheme get colorScheme => Theme.of(this).colorScheme;
TextTheme get textTheme => Theme.of(this).textTheme;
}