Support Flutter 3.22.2
Support Flutter 3.22.2
This commit is contained in:
@@ -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),
|
||||
)
|
||||
],
|
||||
),
|
||||
))));
|
||||
}
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user