This commit is contained in:
zhutao
2025-08-22 14:15:02 +08:00
parent 5853bdf004
commit 99a1ce601e
120 changed files with 5297 additions and 101 deletions

View File

@@ -0,0 +1,22 @@
import 'package:flutter/material.dart';
class AppContext {
static late BuildContext _context;
AppContext._();
///私有构造函数,防止外部实例化
static void setContent(BuildContext context) {
_context = context;
}
///获取全局上下文
static BuildContext get context => _context;
///获取主题
static TextTheme get textTheme => Theme.of(_context).textTheme;
static ColorScheme get colorScheme => Theme.of(_context).colorScheme;
///页面内间距
static double get pagePadding => 15;
}