Support Flutter 3.22.2

Support Flutter 3.22.2
This commit is contained in:
Binance3980
2024-07-01 15:26:49 +08:00
parent c91ea3ab5c
commit 64cf920b59
101 changed files with 260 additions and 1951 deletions
+5 -5
View File
@@ -78,7 +78,7 @@ For more information, please read our Privacy Policy
color: Color.fromARGB(255, 34, 128, 15).withOpacity(0.7)),
child: Text(
'Accept and continue',
style: Theme.of(context).primaryTextTheme.headline6!.copyWith(
style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith(
color: AppColors.whiteColor,
),
),
@@ -87,7 +87,7 @@ For more information, please read our Privacy Policy
Text(
' ',
textAlign: TextAlign.center,
style: Theme.of(context).primaryTextTheme.caption,
style: Theme.of(context).primaryTextTheme.labelMedium,
),
],
),
@@ -114,7 +114,7 @@ For more information, please read our Privacy Policy
lt,
style: Theme.of(context)
.primaryTextTheme
.headline6!
.labelMedium!
.copyWith(color: Colors.white),
),
if (isDiscount)
@@ -137,14 +137,14 @@ For more information, please read our Privacy Policy
text: rt_1,
style: Theme.of(context)
.primaryTextTheme
.headline6!
.labelMedium!
.copyWith(color: Colors.white),
children: [
TextSpan(
text: ' $rt_2',
style: Theme.of(context)
.primaryTextTheme
.bodyText1!
.labelMedium!
.copyWith(color: Colors.white),
)
])),
+12 -8
View File
@@ -82,12 +82,12 @@ class AccountState extends State<AccountPage> {
onTap: onTap ?? null,
minLeadingWidth: 35,
dense: true,
title:
Text(title, style: Theme.of(context).primaryTextTheme.subtitle1),
title: Text(title,
style: Theme.of(context).primaryTextTheme.labelMedium),
subtitle: subtitle != null
? Text(
subtitle,
style: Theme.of(context).primaryTextTheme.caption,
style: Theme.of(context).primaryTextTheme.labelMedium,
)
: null,
// leading: sysicon ??
@@ -115,7 +115,7 @@ class AccountState extends State<AccountPage> {
'Upgrade',
style: Theme.of(context)
.primaryTextTheme
.bodyText1!
.labelMedium!
.copyWith(color: Colors.white),
),
));
@@ -136,9 +136,13 @@ class AccountState extends State<AccountPage> {
Widget build(BuildContext context) {
bool isDarkTheme = Provider.of<ThemeCollection>(context).isDarkActive;
return Scaffold(
backgroundColor: isDarkTheme ? Color(0xff0B0415) : Colors.white,
appBar: AppBar(
shadowColor: Colors.transparent,
title: const Text('Settings'),
foregroundColor: isDarkTheme ? Colors.white : Color(0xff0B0415),
backgroundColor: Colors.transparent,
title: Text(
'Settings',
),
),
body: build2(context),
);
@@ -200,7 +204,7 @@ class AccountState extends State<AccountPage> {
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Text(
'Looks like Youre not signed in yet.',
style: Theme.of(context).primaryTextTheme.bodyText1,
style: Theme.of(context).primaryTextTheme.labelMedium,
),
),
@@ -251,7 +255,7 @@ class AccountState extends State<AccountPage> {
builder: (builder) => const SettingsRoute()))),
divider,
Text("App Version: 1.0.6",
style: Theme.of(context).primaryTextTheme.subtitle1),
style: Theme.of(context).primaryTextTheme.labelMedium),
/*userModel.isLogin
? GestureDetector(
onTap: () => {
+7 -195
View File
@@ -124,16 +124,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
print('state = $state');
if (state == AppLifecycleState.resumed) {
_planModel.fetchPlanList();
// _appModel.getStatus();
// print("_appModel.isOn: ${_appModel.isOn}");
}
if (state == AppLifecycleState.inactive) {
//激活状态
_appModel.getStatus();
print("_appModel.isOn: ${_appModel.isOn}");
}
}
@@ -179,30 +173,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
ScreenUtil.init(context,
designSize: const Size(AppDimens.maxWidth, AppDimens.maxHeight));
//是否第一次打开app
// Future.delayed(Duration(seconds: 3), () {
// _showCupertinoAlertDialog(
// context: context,
// title: "提示",
// content: "您没有提交的权限,\n当前仅供查阅",
// sureText: "确定"
// );
// });
// Provider.of<ThemeCollection>(context)
// .getActiveTheme
// .primaryTextTheme
// .bodyLarge
bool isDarkTheme = Provider.of<ThemeCollection>(context).isDarkActive;
final ButtonStyle style = TextButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.onPrimary,
);
return Scaffold(
backgroundColor: isDarkTheme ? Color(0xff0B0415) : Colors.white,
appBar: AppBar(
shadowColor: Colors.transparent,
backgroundColor: Colors.transparent,
title: SvgPicture.asset(
'assets/text2.svg',
height: 28,
@@ -210,6 +187,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
),
actions: <Widget>[
IconButton(
color: isDarkTheme ? Colors.white : Colors.black,
icon: const Icon(Icons.support_agent),
tooltip: 'support_agent',
onPressed: () {
@@ -218,6 +196,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
),
IconButton(
icon: const Icon(Icons.public),
color: isDarkTheme ? Colors.white : Colors.black,
tooltip: 'public',
onPressed: () {
if (_serverModel.serverEntityList.isEmpty) {
@@ -228,6 +207,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
},
),
IconButton(
color: isDarkTheme ? Colors.white : Colors.black,
icon: const Icon(Icons.menu),
tooltip: 'menu',
onPressed: () {
@@ -240,173 +220,5 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
],
),
body: HomeWidget());
return Scaffold(
appBar: AppBar(
shadowColor: Colors.transparent,
title: currentPage == 2
? const Text('My Account')
: SvgPicture.asset(
'assets/text2.svg',
height: 28,
color: isDarkTheme ? Colors.white : Colors.black,
),
actions: currentPage == 0 ? null : null),
/*[
Padding(
padding: const EdgeInsets.all(8.0),
child: GestureDetector(
onTap: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (builder) => const ProRoute())),
child: SvgPicture.asset(
'assets/Features.svg',
height: 20,
color: AppColors.greenColor,
),
),
),
]
Here Bottom Navigation Bar with some padding, margin,
little bit color & border decoration*/
bottomNavigationBar: Container(
// margin: const EdgeInsets.only(left: 32, right: 32, bottom: 0),
padding: const EdgeInsets.only(top: 0.0),
decoration: BoxDecoration(
color:
const Color(0xff353351).withOpacity(isDarkTheme ? 0.3 : 0.05),
borderRadius: BorderRadius.circular(0)),
child: BottomNavigationBar(
enableFeedback: true,
backgroundColor: Colors.transparent,
elevation: 0,
showSelectedLabels: true,
showUnselectedLabels: true,
selectedLabelStyle:
TextStyle(color: isDarkTheme ? Colors.white : Colors.black),
selectedItemColor: Theme.of(context).primaryColor,
unselectedItemColor: isDarkTheme ? Colors.white : Colors.black,
currentIndex: currentPage,
onTap: (value) => setState(() {
currentPage = value;
}),
items: List.generate(
_itemsList.length,
(index) => BottomNavigationBarItem(
icon: Icon(_itemsList[index]['icon'] as IconData,
size: 30,
color: index != currentPage
? const Color(0xffB5AEBE)
: Theme.of(context).primaryColor),
/*SvgPicture.asset(
_itemsList[index]['iconPath'] as String,
height: index != currentPage ? 20 : 24,
color: index != currentPage
? const Color(0xffB5AEBE)
: Theme.of(context).primaryColor),
*/
label: _itemsList[index]['name'] as String,
))),
),
body: _itemsList[currentPage]['route'] as Widget);
}
}
/*
Widget buildold(BuildContext context) {
bool isDarkTheme = Provider.of<ThemeCollection>(context).isDarkActive;
ScreenUtil.init(context,
designSize: const Size(AppDimens.maxWidth, AppDimens.maxHeight));
// if (!_isfinishedLoad) {
// return const ProgressView();
// }
return Scaffold(
// appBar: SailAppBar(
// appTitle: _appModel.appTitle,
// ),
extendBody: true,
backgroundColor:
_appModel.isOn ? AppColors.greenColor : AppColors.grayColor,
body: SafeArea(
bottom: false,
child: HomeWidget(),
),
);
return AnnotatedRegion<SystemUiOverlayStyle>(
value: _appModel.isOn
? SystemUiOverlayStyle.dark
: SystemUiOverlayStyle.light,
child: Scaffold(
appBar: SailAppBar(
appTitle: _appModel.appTitle,
),
extendBody: true,
backgroundColor:
_appModel.isOn ? AppColors.greenColor : AppColors.grayColor,
body: SafeArea(
bottom: false,
child: PageView(
physics: const NeverScrollableScrollPhysics(),
controller: _appModel.pageController,
children: const [
HomeWidget(),
PlanPage(),
ServerListPage(),
MyProfile()
],
)),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerDocked,
// floatingActionButton: const PowerButton(),
bottomNavigationBar: ClipRRect(
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(ScreenUtil().setWidth(50)),
// topRight: Radius.circular(ScreenUtil().setWidth(50))),
child: BottomAppBar(
// notchMargin: 8,
// shape: const CircularNotchedRectangle(),
color:
_appModel.isOn ? AppColors.grayColor : AppColors.themeColor,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
IconButton(
icon: const Icon(
Icons.home_rounded,
color: Colors.white,
),
onPressed: () => _appModel.jumpToPage(0),
),
IconButton(
icon: const Icon(
Icons.wallet,
color: Colors.white,
),
onPressed: () => _appModel.jumpToPage(1),
),
// SizedBox(
// width: ScreenUtil().setWidth(50),
// ),
IconButton(
icon: const Icon(
Icons.cloud_rounded,
color: Colors.white,
),
onPressed: () => _appModel.jumpToPage(2),
),
IconButton(
icon: const Icon(
Icons.person,
color: Colors.white,
),
onPressed: () => _appModel.jumpToPage(3),
)
],
),
))));
}
}*/
+3 -5
View File
@@ -25,9 +25,7 @@ class HomePagesss extends StatelessWidget {
Builder(builder: (context) {
return RichText(
text: TextSpan(
style: TextStyle(
fontSize: 16,
color: isDarkTheme ? Colors.white : Colors.black),
style: Theme.of(context).primaryTextTheme.labelMedium,
text:
Provider.of<UserPreference>(context).isCountDownStart
? Random().nextInt(500).toString() + ' '
@@ -82,10 +80,10 @@ class HomePagesss extends StatelessWidget {
Flags.list[currentLocIndex]['name'] as String,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: Theme.of(context).primaryTextTheme.headline6,
style: Theme.of(context).primaryTextTheme.labelMedium,
),
subtitle: Text('IP: 79.110.53.95',
style: Theme.of(context).primaryTextTheme.caption),
style: Theme.of(context).primaryTextTheme.labelMedium),
);
}),
),
+5 -5
View File
@@ -77,7 +77,7 @@ class ProPage extends StatelessWidget {
])),
const SizedBox(height: 32),
/**childAspectRatio: 16 / 10,
/*childAspectRatio: 16 / 10,
crossAxisCount: 2,
mainAxisSpacing: 8,
crossAxisSpacing: 14), */
@@ -159,7 +159,7 @@ class ProPage extends StatelessWidget {
Text(
'Please rest assured to use.',
textAlign: TextAlign.center,
style: Theme.of(context).primaryTextTheme.caption,
style: Theme.of(context).primaryTextTheme.labelMedium,
),
],
),
@@ -186,7 +186,7 @@ class ProPage extends StatelessWidget {
lt,
style: Theme.of(context)
.primaryTextTheme
.headline6!
.labelMedium!
.copyWith(color: Colors.white),
),
if (isDiscount)
@@ -209,14 +209,14 @@ class ProPage extends StatelessWidget {
text: rt_1,
style: Theme.of(context)
.primaryTextTheme
.headline6!
.labelMedium!
.copyWith(color: Colors.white),
children: [
TextSpan(
text: ' $rt_2',
style: Theme.of(context)
.primaryTextTheme
.bodyText1!
.labelMedium!
.copyWith(color: Colors.white),
)
])),