This commit is contained in:
2026-06-03 14:07:10 +08:00
parent 3bdece45c3
commit 9eb8d1cc37
118 changed files with 5689 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
import 'package:flutter/material.dart';
extension BuildContextX on BuildContext {
ThemeData get theme => Theme.of(this);
ColorScheme get colors => theme.colorScheme;
TextTheme get textTheme => theme.textTheme;
Size get screenSize => MediaQuery.sizeOf(this);
EdgeInsets get safePadding => MediaQuery.paddingOf(this);
bool get isDarkMode => theme.brightness == Brightness.dark;
bool get isKeyboardVisible => MediaQuery.viewInsetsOf(this).bottom > 0;
void hideKeyboard() {
FocusManager.instance.primaryFocus?.unfocus();
}
}