From 7e833f80b7ab03ed9e21ad34b961a822184ce291 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Tue, 13 Apr 2021 16:05:35 +0800 Subject: [PATCH] update bottom navigation bar style --- lib/constants/app_theme.dart | 7 + .../event_activity/voting_detail_page.dart | 2 + .../goods_deto_page/goods_deto_page.dart | 4 + .../industry_committee_page.dart | 2 + .../widget/add_fixed_submit_page.dart | 2 + lib/ui/manager/advice/advice_detail_page.dart | 2 + lib/ui/manager/advice/advice_page.dart | 2 + lib/ui/manager/advice/new_advice_page.dart | 2 + .../questionnaire_detail_page.dart | 2 + .../visitor/visitor_passport_page.dart | 230 +++++++++--------- lib/ui/profile/house/pick_my_house_page.dart | 2 + 11 files changed, 144 insertions(+), 113 deletions(-) diff --git a/lib/constants/app_theme.dart b/lib/constants/app_theme.dart index 83396c53..6fa0c405 100644 --- a/lib/constants/app_theme.dart +++ b/lib/constants/app_theme.dart @@ -120,4 +120,11 @@ class SystemStyle { statusBarIconBrightness: Brightness.light, systemNavigationBarColor: Color(0xFFFFD000), ); + + static genStyle({@required Color bottom}) { + return SystemUiOverlayStyle( + statusBarIconBrightness: Brightness.light, + systemNavigationBarColor: bottom, + ); + } } diff --git a/lib/pages/event_activity/voting_detail_page.dart b/lib/pages/event_activity/voting_detail_page.dart index ce04c5b1..af3203aa 100644 --- a/lib/pages/event_activity/voting_detail_page.dart +++ b/lib/pages/event_activity/voting_detail_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -203,6 +204,7 @@ class _VotingDetailPageState extends State { @override Widget build(BuildContext context) { return BeeScaffold( + systemStyle: SystemStyle.yellowBottomBar, title: '活动详情', bodyColor: Colors.white, body: EasyRefresh( diff --git a/lib/pages/goods_deto_page/goods_deto_page.dart b/lib/pages/goods_deto_page/goods_deto_page.dart index 12555020..099eb402 100644 --- a/lib/pages/goods_deto_page/goods_deto_page.dart +++ b/lib/pages/goods_deto_page/goods_deto_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -64,6 +65,9 @@ class _GoodsDetoPageState extends State { Widget build(BuildContext context) { UserProvider userProvider = Provider.of(context); return BeeScaffold( + systemStyle: _isEdit + ? SystemStyle.genStyle(bottom: Color(0xFFFFD000).withOpacity(0.2)) + : SystemStyle.yellowBottomBar, title: '物品出户', actions: [ IconButton( diff --git a/lib/pages/industry_committee/industry_committee_page.dart b/lib/pages/industry_committee/industry_committee_page.dart index 55cbd9a9..0a714323 100644 --- a/lib/pages/industry_committee/industry_committee_page.dart +++ b/lib/pages/industry_committee/industry_committee_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -133,6 +134,7 @@ class _IndustryCommitteePageState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '业委会', + systemStyle: SystemStyle.genStyle(bottom: Color(0xFF2A2A2A)), body: BeeListView( path: API.manager.commiteeStaff, convert: (model) { diff --git a/lib/pages/things_page/widget/add_fixed_submit_page.dart b/lib/pages/things_page/widget/add_fixed_submit_page.dart index 25949180..35a9b276 100644 --- a/lib/pages/things_page/widget/add_fixed_submit_page.dart +++ b/lib/pages/things_page/widget/add_fixed_submit_page.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -175,6 +176,7 @@ class _AddFixedSubmitPageState extends State { AppProvider appProvider = Provider.of(context); return WillPopScope( child: BeeScaffold( + systemStyle: SystemStyle.yellowBottomBar, title: '报事报修', body: ListView( children: [ diff --git a/lib/ui/manager/advice/advice_detail_page.dart b/lib/ui/manager/advice/advice_detail_page.dart index 0dbcfc42..f98d8a8d 100644 --- a/lib/ui/manager/advice/advice_detail_page.dart +++ b/lib/ui/manager/advice/advice_detail_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/material.dart'; import 'package:dio/dio.dart'; @@ -161,6 +162,7 @@ class _AdviceDetailPageState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '查看详情', + systemStyle: SystemStyle.yellowBottomBar, actions: [ TextButton( onPressed: () => diff --git a/lib/ui/manager/advice/advice_page.dart b/lib/ui/manager/advice/advice_page.dart index b04fdf2e..5eb4a711 100644 --- a/lib/ui/manager/advice/advice_page.dart +++ b/lib/ui/manager/advice/advice_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -90,6 +91,7 @@ class _AdvicePageState extends State with TickerProviderStateMixin { Widget build(BuildContext context) { return BeeScaffold( title: title, + systemStyle: SystemStyle.yellowBottomBar, actions: [ TextButton( onPressed: () => setState(() => _selectedMode = !_selectedMode), diff --git a/lib/ui/manager/advice/new_advice_page.dart b/lib/ui/manager/advice/new_advice_page.dart index 43d19e0c..458adcab 100644 --- a/lib/ui/manager/advice/new_advice_page.dart +++ b/lib/ui/manager/advice/new_advice_page.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -131,6 +132,7 @@ class _NewAdvicePageState extends State { Widget build(BuildContext context) { final appProvider = Provider.of(context); return BeeScaffold.white( + systemStyle: SystemStyle.yellowBottomBar, title: title, body: ListView( padding: EdgeInsets.all(32.w), diff --git a/lib/ui/manager/questionnaire/questionnaire_detail_page.dart b/lib/ui/manager/questionnaire/questionnaire_detail_page.dart index b6e895c7..4df63701 100644 --- a/lib/ui/manager/questionnaire/questionnaire_detail_page.dart +++ b/lib/ui/manager/questionnaire/questionnaire_detail_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -195,6 +196,7 @@ class _QuestionnaireDetailPageState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '问卷调查', + systemStyle: SystemStyle.yellowBottomBar, body: EasyRefresh( firstRefresh: true, header: MaterialHeader(), diff --git a/lib/ui/manager/visitor/visitor_passport_page.dart b/lib/ui/manager/visitor/visitor_passport_page.dart index 44899b39..d00dc442 100644 --- a/lib/ui/manager/visitor/visitor_passport_page.dart +++ b/lib/ui/manager/visitor/visitor_passport_page.dart @@ -1,6 +1,7 @@ import 'dart:typed_data'; import 'dart:ui' as ui; +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; @@ -30,123 +31,126 @@ class _VisitorPassportPageState extends State { GlobalKey _repaintKey = GlobalKey(); @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Color(0xFF333333), - appBar: AppBar( - brightness: Brightness.dark, - leading: BeeBackButton(color: Colors.white), + return AnnotatedRegion( + child: Scaffold( backgroundColor: Color(0xFF333333), - elevation: 0, - centerTitle: true, - title: '访客通行证'.text.white.make(), - ), - body: RepaintBoundary( - key: _repaintKey, - child: ListView( - children: [ - 64.hb, - '宁波华茂悦峰'.text.size(40.sp).white.bold.make().centered(), - '1幢-1单元-702室'.text.size(30.sp).white.make().centered(), - 32.hb, - Container( - width: 600.w, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(16.w), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 32.hb, - [ - 32.wb, - [ - Image.asset( - R.ASSETS_ICONS_USER_ICON_WDFK_PNG, - color: ktextSubColor, - height: 40.w, - width: 40.w, - ), - 16.wb, - widget.model.name.text - .size(36.sp) - .bold - .overflow(TextOverflow.ellipsis) - .make() - .expand(), - ].row().expand(), + appBar: AppBar( + brightness: Brightness.dark, + leading: BeeBackButton(color: Colors.white), + backgroundColor: Color(0xFF333333), + elevation: 0, + centerTitle: true, + title: '访客通行证'.text.white.make(), + ), + body: RepaintBoundary( + key: _repaintKey, + child: ListView( + children: [ + 64.hb, + '宁波华茂悦峰'.text.size(40.sp).white.bold.make().centered(), + '1幢-1单元-702室'.text.size(30.sp).white.make().centered(), + 32.hb, + Container( + width: 600.w, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 32.hb, [ - Image.asset( - R.ASSETS_ICONS_USER_ICON_WDC_PNG, - color: ktextSubColor, - height: 40.w, - width: 40.w, + 32.wb, + [ + Image.asset( + R.ASSETS_ICONS_USER_ICON_WDFK_PNG, + color: ktextSubColor, + height: 40.w, + width: 40.w, + ), + 16.wb, + widget.model.name.text + .size(36.sp) + .bold + .overflow(TextOverflow.ellipsis) + .make() + .expand(), + ].row().expand(), + [ + Image.asset( + R.ASSETS_ICONS_USER_ICON_WDC_PNG, + color: ktextSubColor, + height: 40.w, + width: 40.w, + ), + 16.wb, + (widget.model.drive ? '无车辆信息' : widget.model.carNum) + .text + .size(36.sp) + .bold + .overflow(TextOverflow.ellipsis) + .make() + .expand(), + ].row().expand(), + 32.wb, + ].row(), + 16.hb, + '有效时间:${DateUtil.formatDate( + widget.model.date, + format: 'yyyy-MM-dd', + )}' + .text + .color(Color(0xFF999999)) + .size(24.sp) + .make() + .pSymmetric(h: 32.w), + 20.hb, + Divider(height: 1.w), + 32.hb, + SizedBox( + height: 260.w, + width: 260.w, + child: QrImage( + data: widget.model.accessCode.toString(), ), - 16.wb, - (widget.model.drive ? '无车辆信息' : widget.model.carNum) - .text - .size(36.sp) - .bold - .overflow(TextOverflow.ellipsis) - .make() - .expand(), - ].row().expand(), - 32.wb, - ].row(), - 16.hb, - '有效时间:${DateUtil.formatDate( - widget.model.date, - format: 'yyyy-MM-dd', - )}' - .text - .color(Color(0xFF999999)) - .size(24.sp) - .make() - .pSymmetric(h: 32.w), - 20.hb, - Divider(height: 1.w), - 32.hb, - SizedBox( - height: 260.w, - width: 260.w, - child: QrImage( - data: widget.model.accessCode.toString(), - ), - ).centered(), - 32.hb, - Divider(height: 1.w), - '进入小区时,请出示此通行证给门岗' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make() - .centered() - .box - .height(64.w) - .make(), - ], - ), - ).centered(), - ], - ).box.color(Color(0xFF333333)).make(), - ), - bottomNavigationBar: BottomButton( - onPressed: () async { - VoidCallback cancel = BotToast.showLoading(); - RenderRepaintBoundary boundary = - _repaintKey.currentContext.findRenderObject(); - ui.Image image = await boundary.toImage(pixelRatio: 3); - ByteData byteData = - await image.toByteData(format: ui.ImageByteFormat.png); - Uint8List png = byteData.buffer.asUint8List(); - cancel(); - shareToWeChat(WeChatShareImageModel( - WeChatImage.binary(png, suffix: '.png'), - scene: WeChatScene.SESSION, - )); - }, - child: '发送给访客'.text.bold.make(), + ).centered(), + 32.hb, + Divider(height: 1.w), + '进入小区时,请出示此通行证给门岗' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make() + .centered() + .box + .height(64.w) + .make(), + ], + ), + ).centered(), + ], + ).box.color(Color(0xFF333333)).make(), + ), + bottomNavigationBar: BottomButton( + onPressed: () async { + VoidCallback cancel = BotToast.showLoading(); + RenderRepaintBoundary boundary = + _repaintKey.currentContext.findRenderObject(); + ui.Image image = await boundary.toImage(pixelRatio: 3); + ByteData byteData = + await image.toByteData(format: ui.ImageByteFormat.png); + Uint8List png = byteData.buffer.asUint8List(); + cancel(); + shareToWeChat(WeChatShareImageModel( + WeChatImage.binary(png, suffix: '.png'), + scene: WeChatScene.SESSION, + )); + }, + child: '发送给访客'.text.bold.make(), + ), ), + value: SystemStyle.yellowBottomBar, ); } } diff --git a/lib/ui/profile/house/pick_my_house_page.dart b/lib/ui/profile/house/pick_my_house_page.dart index 815665dc..44c62b11 100644 --- a/lib/ui/profile/house/pick_my_house_page.dart +++ b/lib/ui/profile/house/pick_my_house_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -70,6 +71,7 @@ class _PickMyHousePageState extends State { final appProvider = Provider.of(context); return BeeScaffold( title: '我的房屋', + systemStyle: SystemStyle.yellowBottomBar, body: EasyRefresh( header: MaterialHeader(), controller: _refreshController,