update app brightness

hmxc
小赖 5 years ago
parent 4529e84229
commit ac2679f4fd

@ -18,6 +18,7 @@ class _ApplicationPageState extends State<ApplicationPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
appBar: AppBar( appBar: AppBar(
brightness: Brightness.light,
elevation: 0, elevation: 0,
backgroundColor: Colors.white, backgroundColor: Colors.white,
leading: SizedBox( leading: SizedBox(
@ -52,6 +53,9 @@ class _ApplicationPageState extends State<ApplicationPage> {
), ),
), ),
), ),
body: Column(
children: [],
),
); );
} }
} }

@ -9,6 +9,7 @@ import 'package:aku_community_manager/ui/tool_pages/scan_page.dart';
import 'package:aku_ui/aku_ui.dart'; import 'package:aku_ui/aku_ui.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -20,390 +21,402 @@ class HomePage extends StatefulWidget {
_HomePageState createState() => _HomePageState(); _HomePageState createState() => _HomePageState();
} }
//bar class _HomePageState extends State<HomePage> {
Widget _menuButton(IconData iconData, String text, Widget page) { //bar
return Expanded( Widget _menuButton(IconData iconData, String text, Widget page) {
child: AkuButton( return Expanded(
radius: 8.w, child: AkuButton(
height: 75.w + 8.w + 33.w, radius: 8.w,
onPressed: () { height: 75.w + 8.w + 33.w,
Get.to(page); onPressed: () {
}, Get.to(page);
child: Column( },
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
iconData,
size: 75.w,
),
SizedBox(height: 8.w),
Text(
text,
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
)
],
),
),
);
}
//
Widget _card(String number, String text, Color color) {
return AkuButton(
radius: 8.w,
onPressed: () {},
color: Color(0xFFFFFFFF),
child: Container(
width: 342.5.w,
height: 166.w,
alignment: Alignment.center,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox( Icon(
height: 32.w, iconData,
size: 75.w,
), ),
SizedBox(height: 8.w),
Text( Text(
number, text,
style: TextStyle( style: TextStyle(
color: color, color: Color(0xFF4A4B51),
fontSize: 40.sp, fontSize: 24.sp,
fontFamily: 'Bebas', fontWeight: FontWeight.bold,
), ),
), )
SizedBox(
height: 16.w,
),
Text(text,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold)),
Spacer(),
], ],
)), ),
); ),
} );
}
//
Widget _card(String number, String text, Color color) {
return AkuButton(
radius: 8.w,
onPressed: () {},
color: Color(0xFFFFFFFF),
child: Container(
width: 342.5.w,
height: 166.w,
alignment: Alignment.center,
child: Column(
children: [
SizedBox(
height: 32.w,
),
Text(
number,
style: TextStyle(
color: color,
fontSize: 40.sp,
fontFamily: 'Bebas',
),
),
SizedBox(
height: 16.w,
),
Text(text,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold)),
Spacer(),
],
)),
);
}
@override
void initState() {
super.initState();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
));
}
class _HomePageState extends State<HomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
ScreenUtil.init(context, ScreenUtil.init(context,
designSize: Size(750, 1334), allowFontScaling: true); designSize: Size(750, 1334), allowFontScaling: true);
return Scaffold( return AnnotatedRegion<SystemUiOverlayStyle>(
drawer: PersonalDraw(), child: Scaffold(
backgroundColor: Color(0xFFF9F9F9), drawer: PersonalDraw(),
//bar backgroundColor: Color(0xFFF9F9F9),
appBar: PreferredSize( //bar
preferredSize: Size(375.w, 430.w - 40.w + statusBarHeight), appBar: PreferredSize(
child: Container( preferredSize: Size(375.w, 430.w - 40.w + statusBarHeight),
height: 430.w - 40.w + ScreenUtil().statusBarHeight, child: Container(
width: double.infinity, height: 430.w - 40.w + ScreenUtil().statusBarHeight,
decoration: BoxDecoration( width: double.infinity,
gradient: LinearGradient( decoration: BoxDecoration(
begin: Alignment.topCenter, gradient: LinearGradient(
end: Alignment.bottomCenter, begin: Alignment.topCenter,
colors: [ end: Alignment.bottomCenter,
Color(0xFFFFDC6F), colors: [
Color(0xFFFFC40C), Color(0xFFFFDC6F),
], Color(0xFFFFC40C),
],
),
borderRadius:
BorderRadius.only(bottomRight: Radius.circular(32.w)),
), ),
borderRadius: BorderRadius.only(bottomRight: Radius.circular(32.w)), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, SizedBox(height: ScreenUtil().statusBarHeight),
children: [ Container(
SizedBox(height: ScreenUtil().statusBarHeight), height: 88.w,
Container( child: Row(children: [
height: 88.w, SizedBox(
child: Row(children: [ width: 16.w,
SizedBox(
width: 16.w,
),
Container(
margin: EdgeInsets.only(top: 8.w, bottom: 8.w),
width: 72.w,
height: 72.w,
//
child: Builder(
builder: (BuildContext context) {
return GestureDetector(
onTap: () {
Scaffold.of(context).openDrawer();
},
child: CircleAvatar(
radius: 36.w,
backgroundColor: Colors.grey,
child: userProvider.isSigned ? null : null,
),
);
},
), ),
), Container(
SizedBox(width: 16.w),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 8.w, bottom: 8.w), margin: EdgeInsets.only(top: 8.w, bottom: 8.w),
alignment: Alignment.center, width: 72.w,
height: 72.w, height: 72.w,
child: AkuButton( //
// child: Builder(
color: Color(0xFFFFFFFF), builder: (BuildContext context) {
onPressed: () {}, return GestureDetector(
radius: 8.w, onTap: () {
child: Row(children: [ Scaffold.of(context).openDrawer();
Container( },
child: Column( child: CircleAvatar(
children: [ radius: 36.w,
SizedBox(height: 18.w), backgroundColor: Colors.grey,
Icon( child: userProvider.isSigned ? null : null,
Icons.zoom_in_sharp,
size: 38.w,
),
],
), ),
);
},
),
),
SizedBox(width: 16.w),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 8.w, bottom: 8.w),
alignment: Alignment.center,
height: 72.w,
child: AkuButton(
//
color: Color(0xFFFFFFFF),
onPressed: () {},
radius: 8.w,
child: Row(children: [
Container(
child: Column(
children: [
SizedBox(height: 18.w),
Icon(
Icons.zoom_in_sharp,
size: 38.w,
),
],
),
),
SizedBox(width: 19.w),
Text(
'搜索工单订单号、手机',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.sp,
),
),
]),
),
),
),
SizedBox(width: 15.w),
Container(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
child: MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
//
height: double.infinity,
minWidth: 78.w,
padding: EdgeInsets.zero,
onPressed: () {
Get.to(ScanPage());
},
child: Column(children: [
Image.asset(
R.ASSETS_HOME_IC_SCAN_PNG,
height: 48.w,
width: 48.w,
), ),
SizedBox(width: 19.w),
Text( Text(
'搜索工单订单号、手机', '扫一扫',
style: TextStyle( style: TextStyle(
color: AppStyle.minorTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 20.sp,
fontWeight: FontWeight.normal,
), ),
), ),
]), ]),
), ),
), ),
), Container(
SizedBox(width: 15.w), margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
Container( child: AkuMaterialButton(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w), minWidth: 78.w,
child: MaterialButton( //
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, height: double.infinity,
// onPressed: () {},
height: double.infinity, child: Column(children: [
minWidth: 78.w, Image.asset(
padding: EdgeInsets.zero, R.ASSETS_HOME_IC_NEWS_PNG,
onPressed: () { height: 48.w,
Get.to(ScanPage()); width: 48.w,
},
child: Column(children: [
Image.asset(
R.ASSETS_HOME_IC_SCAN_PNG,
height: 48.w,
width: 48.w,
),
Text(
'扫一扫',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 20.sp,
fontWeight: FontWeight.normal,
), ),
), Text(
]), '消息',
), style: TextStyle(
), color: AppStyle.primaryTextColor,
Container( fontSize: 20.sp,
margin: EdgeInsets.only(top: 5.w, bottom: 5.w), ),
child: AkuMaterialButton(
minWidth: 78.w,
//
height: double.infinity,
onPressed: () {},
child: Column(children: [
Image.asset(
R.ASSETS_HOME_IC_NEWS_PNG,
height: 48.w,
width: 48.w,
),
Text(
'消息',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 20.sp,
), ),
), ]),
]), ),
), ),
), SizedBox(width: 17.w),
SizedBox(width: 17.w), ]),
]),
),
SizedBox(height: 24.w),
Container(
margin: EdgeInsets.only(
left: 32.w,
),
height: 67.w,
child: Text(
'HI李大海',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 48.sp),
), ),
), SizedBox(height: 24.w),
SizedBox(height: 16.w), Container(
Container( margin: EdgeInsets.only(
margin: EdgeInsets.only(left: 32.w, right: 32.w), left: 32.w,
width: double.infinity, ),
height: 163.w, height: 67.w,
decoration: BoxDecoration( child: Text(
color: Color(0xFFFFFFFF), 'HI李大海',
borderRadius: BorderRadius.circular(8.w), style: TextStyle(
), color: AppStyle.primaryTextColor,
child: Row( fontWeight: FontWeight.bold,
mainAxisAlignment: MainAxisAlignment.spaceAround, fontSize: 48.sp),
children: [
_menuButton(Icons.wysiwyg, '一键报警', HomePage()),
_menuButton(Icons.work, '访客管理', HomePage()),
_menuButton(Icons.accessibility, '报事报修', HomePage()),
_menuButton(
Icons.account_balance, '全部应用', ApplicationPage()),
],
),
),
],
),
),
),
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
Container(
//
width: double.infinity,
height: 45.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'今日公告',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
), ),
), ),
Spacer(), SizedBox(height: 16.w),
AkuButton( Container(
// margin: EdgeInsets.only(left: 32.w, right: 32.w),
onPressed: () {}, width: double.infinity,
height: 163.w,
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(8.w),
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Text( _menuButton(Icons.wysiwyg, '一键报警', HomePage()),
'全部公告', _menuButton(Icons.work, '访客管理', HomePage()),
style: TextStyle( _menuButton(Icons.accessibility, '报事报修', HomePage()),
color: AppStyle.minorTextColor, _menuButton(
fontSize: 24.sp, Icons.account_balance, '全部应用', ApplicationPage()),
fontWeight: FontWeight.bold,
),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
)
], ],
), ),
), ),
], ],
), ),
), ),
SizedBox(height: 16.w), ),
// body: ListView(
Container( padding: EdgeInsets.all(32.w),
color: Color(0xFFFFFFFF), children: [
// Container(
width: double.infinity, //
height: 172.w, width: double.infinity,
//TODO listview height: 45.w,
), child: Row(
SizedBox(height: 32.w), mainAxisAlignment: MainAxisAlignment.center,
// children: [
Container( Text(
width: double.infinity, '今日公告',
height: 45.w, style: TextStyle(
child: Row( color: Color(0xFF4A4B51),
children: [ fontSize: 32.sp,
Text( fontWeight: FontWeight.bold,
'待办事项', ),
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
), ),
), Spacer(),
Spacer(), AkuButton(
AkuButton( //
onPressed: () {}, onPressed: () {},
child: Row( child: Row(
children: [ children: [
Text( Text(
'全部事项', '全部公告',
style: TextStyle( style: TextStyle(
color: AppStyle.minorTextColor, color: AppStyle.minorTextColor,
fontSize: 24.sp, fontSize: 24.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold,
), ),
Icon( ),
Icons.arrow_forward_ios, Icon(
size: 22.w, Icons.arrow_forward_ios,
color: AppStyle.minorTextColor, size: 22.w,
), color: AppStyle.minorTextColor,
], )
],
),
), ),
), ],
], ),
), ),
), SizedBox(height: 16.w),
SizedBox(height: 16.w), //
// Container(
Container( color: Color(0xFFFFFFFF),
width: double.infinity, //
height: 449.w, width: double.infinity,
//TODO listview height: 172.w,
), //TODO listview
SizedBox(height: 24.w),
//
Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
), ),
child: Column( SizedBox(height: 32.w),
children: [ //
Row( Container(
children: [ width: double.infinity,
_card('25', '未处理事项', Color(0xFFFF4E0D)), height: 45.w,
AkuDiveder().verticalDivider(166.5.w), child: Row(
_card('22', '处理中事项', Color(0xFFFFC40C)), children: [
], Text(
), '待办事项',
Row(children: [ style: TextStyle(
AkuDiveder().horizontalDivider(343.w), color: Color(0xFF4A4B51),
AkuDiveder(isReverse: true).horizontalDivider(343.w) fontSize: 32.sp,
]), fontWeight: FontWeight.bold,
Row(
children: [
_card('25', '已处理事项', Color(0xFF3F8FFE)),
AkuDiveder(isReverse: true).verticalDivider(
166.5.w,
), ),
_card('72', '全部事项', Color(0xFF333333)), ),
], Spacer(),
), AkuButton(
], onPressed: () {},
child: Row(
children: [
Text(
'全部事项',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
),
],
),
),
],
),
), ),
), SizedBox(height: 16.w),
], //
Container(
width: double.infinity,
height: 449.w,
//TODO listview
),
SizedBox(height: 24.w),
//
Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
),
child: Column(
children: [
Row(
children: [
_card('25', '未处理事项', Color(0xFFFF4E0D)),
AkuDiveder().verticalDivider(166.5.w),
_card('22', '处理中事项', Color(0xFFFFC40C)),
],
),
Row(children: [
AkuDiveder().horizontalDivider(343.w),
AkuDiveder(isReverse: true).horizontalDivider(343.w)
]),
Row(
children: [
_card('25', '已处理事项', Color(0xFF3F8FFE)),
AkuDiveder(isReverse: true).verticalDivider(
166.5.w,
),
_card('72', '全部事项', Color(0xFF333333)),
],
),
],
),
),
],
),
), ),
value: SystemUiOverlayStyle.dark,
); );
} }
} }

Loading…
Cancel
Save