This commit is contained in:
2020-12-28 00:19:04 -05:00
parent 86c845b49b
commit c378a6203c
33 changed files with 833 additions and 200 deletions

View File

@@ -4,8 +4,12 @@ import 'package:flutter_wisetronic/events/eventbus.dart';
import 'package:flutter_wisetronic/events/events.dart';
import 'package:flutter_wisetronic/widgets/general/navigationbar_logo.dart';
import '../../routes.dart';
class MobileNavigationBar extends StatefulWidget {
const MobileNavigationBar({Key key}) : super(key: key);
final String title;
final bool back;
const MobileNavigationBar({Key key, this.title, this.back}) : super(key: key);
@override
State<StatefulWidget> createState() {
@@ -18,57 +22,43 @@ class MobileNavigationBarState extends State<MobileNavigationBar> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 10.0, right: 10.0),
height: 80.0,
color: Colors.blue,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: Icon(Icons.menu),
onPressed: () {
eventBus.fire(OpenDrawer());
},
),
Container(
child: NavigationBarLogo(),
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
),
Container()
],
return AppBar(
leading: widget.back ?
IconButton(
icon: Icon(
Icons.arrow_back_ios,
color: Colors.white,
),
onPressed: () {
Routes.router.pop(context);
},
) :
IconButton(
icon: Icon(
Icons.menu,
color: Colors.white,
),
onPressed: () {
eventBus.fire(OpenDrawer());
},
),
title: Container(
child: widget.title.isNotEmpty ?
Container(
child: Text(
'${widget.title}',
style: TextStyle(
color: Colors.white,
fontSize: 24.0,
fontWeight: FontWeight.bold,
),
),
) :
NavigationBarLogo(),
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
),
centerTitle: true,
);
// return Stack(
// children: [
// Container(
// height: 80.0,
// color: Colors.blue,
// ),
// Container(
// padding: EdgeInsets.only(left: 10.0, right: 10.0),
// height: 80.0,
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// IconButton(
// icon: Icon(Icons.menu),
// onPressed: () {
//
// },
// ),
// Container(
// child: NavigationBarLogo(),
// padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
// ),
// Container()
// ],
// ),
// ),
// ],
// );
}
}