set bottomNavigationColor

hmxc
小赖 4 years ago
parent cd84ba5ee3
commit 64c7e3a6a7

@ -111,8 +111,13 @@ class AppTheme {
}
class SystemStyle {
static const lightStatusBar = SystemUiOverlayStyle(
static const initial = SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.light,
systemNavigationBarColor: Colors.white,
);
static const yellowBottomBar = SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.light,
systemNavigationBarColor: Color(0xFFFFD000),
);
}

@ -1,3 +1,4 @@
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -76,7 +77,7 @@ class _TabNavigatorState extends State<TabNavigator>
_buildBottomBar('我的', R.ASSETS_ICONS_TABBAR_USER_NO_PNG,
R.ASSETS_ICONS_TABBAR_USER_PNG),
];
return Scaffold(
return BeeScaffold(
body: WillPopScope(
onWillPop: () async {
if (_lastPressed == null ||
@ -94,7 +95,7 @@ class _TabNavigatorState extends State<TabNavigator>
physics: NeverScrollableScrollPhysics(),
),
),
bottomNavigationBar: StatefulBuilder(builder: (context, setFunc) {
bottomNavi: StatefulBuilder(builder: (context, setFunc) {
return BottomNavigationBar(
items: _bottomNav,
backgroundColor: Colors.white,

@ -1,3 +1,4 @@
import 'package:akuCommunity/constants/app_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -214,6 +215,7 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
systemStyle: SystemStyle.yellowBottomBar,
title: '报事报修',
actions: [
IconButton(

@ -1,5 +1,7 @@
import 'dart:io';
import 'package:akuCommunity/constants/app_theme.dart';
import 'package:akuCommunity/widget/picker/bee_house_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -10,14 +12,11 @@ import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/extensions/widget_list_ext.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/pages/things_page/widget/finish_fixed_submit_page.dart';
import 'package:akuCommunity/provider/app_provider.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/ui/profile/house/pick_my_house_page.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
@ -51,50 +50,15 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
super.dispose();
}
Widget _buildHouseCard(
String title,
String detail,
) {
return Padding(
padding: EdgeInsets.all(32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'报修房屋'.text.black.size(28.sp).make(),
32.w.heightBox,
GestureDetector(
onTap: () {
Get.to(() => PickMyHousePage());
},
child: Row(
children: [
Image.asset(
R.ASSETS_ICONS_HOUSE_PNG,
width: 60.w,
height: 60.w,
),
40.w.widthBox,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
title.text.black.size(32.sp).bold.make(),
10.w.heightBox,
detail.text.black.size(32.sp).bold.make()
],
),
),
Icon(
CupertinoIcons.chevron_forward,
size: 40.w,
),
],
).material(color: Colors.transparent),
),
24.w.heightBox,
BeeDivider.horizontal(),
],
),
Widget _buildHouseCard() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'报修房屋'.text.black.size(28.sp).make().pSymmetric(h: 32.w),
8.w.heightBox,
BeeHousePicker(),
BeeDivider.horizontal(indent: 32.w, endIndent: 32.w),
],
);
}
@ -209,17 +173,13 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
@override
Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context);
AppProvider appProvider = Provider.of<AppProvider>(context);
return WillPopScope(
child: BeeScaffold(
title: '报事报修',
body: ListView(
children: [
_buildHouseCard(
S.of(context).tempPlotName,
appProvider.selectedHouse.roomName,
),
_buildHouseCard(),
_getType(),
_buildReportCard(),
_addImages(),

@ -35,7 +35,7 @@ class _TopicDetailPageState extends State<TopicDetailPage> {
@override
Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemStyle.lightStatusBar,
value: SystemStyle.initial,
child: Scaffold(
floatingActionButton: FloatingActionButton(
heroTag: 'event_add',

@ -1,10 +1,12 @@
import 'package:akuCommunity/constants/app_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/widget/bee_back_button.dart';
class BeeScaffold extends StatefulWidget {
class BeeScaffold extends StatelessWidget {
final String title;
final Widget body;
@ -19,6 +21,8 @@ class BeeScaffold extends StatefulWidget {
final Widget bottomNavi;
final PreferredSizeWidget appBarBottom;
final FloatingActionButton fab;
final SystemUiOverlayStyle systemStyle;
BeeScaffold({
Key key,
@required this.title,
@ -30,6 +34,7 @@ class BeeScaffold extends StatefulWidget {
this.bottomNavi,
this.appBarBottom,
this.fab,
this.systemStyle = SystemStyle.initial,
}) : super(key: key);
BeeScaffold.white({
@ -42,28 +47,29 @@ class BeeScaffold extends StatefulWidget {
this.bottomNavi,
this.appBarBottom,
this.fab,
this.systemStyle = SystemStyle.initial,
}) : this.bodyColor = Colors.white,
super(key: key);
@override
_BeeScaffoldState createState() => _BeeScaffoldState();
}
class _BeeScaffoldState extends State<BeeScaffold> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: widget.bodyColor,
appBar: AppBar(
backgroundColor: widget.bgColor,
title: widget.title.text.make(),
leading: widget.leading ?? BeeBackButton(),
actions: widget.actions,
bottom: widget.appBarBottom,
return AnnotatedRegion<SystemUiOverlayStyle>(
value: systemStyle,
child: Scaffold(
backgroundColor: bodyColor,
appBar: title == null
? null
: AppBar(
backgroundColor: bgColor,
title: title.text.make(),
leading: leading ?? BeeBackButton(),
actions: actions,
bottom: appBarBottom,
),
body: body,
bottomNavigationBar: bottomNavi,
floatingActionButton: fab,
),
body: widget.body,
bottomNavigationBar: widget.bottomNavi,
floatingActionButton: widget.fab,
);
}
}

@ -0,0 +1,47 @@
import 'package:akuCommunity/provider/app_provider.dart';
import 'package:akuCommunity/ui/profile/house/pick_my_house_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/utils/headers.dart';
class BeeHousePicker extends StatelessWidget {
const BeeHousePicker({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return MaterialButton(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
onPressed: () {
Get.to(() => PickMyHousePage());
},
child: Row(
children: [
Image.asset(
R.ASSETS_ICONS_HOUSE_PNG,
width: 60.w,
height: 60.w,
),
40.w.widthBox,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
S.of(context).tempPlotName.text.black.size(32.sp).bold.make(),
10.w.heightBox,
appProvider.selectedHouse.roomName.text.black
.size(32.sp)
.bold
.make()
],
),
),
Icon(CupertinoIcons.chevron_forward, size: 40.w),
],
),
);
}
}
Loading…
Cancel
Save