Files
flutter_wisetronic/lib/widgets/mobile/mobile_navigation_drawer.dart
2020-12-28 00:19:04 -05:00

247 lines
8.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/generated/l10n.dart';
import 'package:flutter_wisetronic/widgets/general/text_link.dart';
import 'package:flutter_wisetronic/widgets/mobile/mobile_navigation_drawer_header.dart';
import '../../constants.dart';
class MobileNavigationDrawer extends StatefulWidget {
const MobileNavigationDrawer({Key key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return MobileNavigationDrawerState();
}
}
class MobileNavigationDrawerState extends State<MobileNavigationDrawer> {
@override
Widget build(BuildContext context) {
String currentRoute = ModalRoute.of(context).settings.name;
return Container(
width: 200.0,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(color: Colors.black12, blurRadius: 16.0),
],
),
child: SingleChildScrollView(
child: Column(
children: [
MobileNavigationDrawerHeader(),
TextLink(
S.of(context).home,
'/',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/',
closeDrawer: true,
clearStack: true,
),
TextLink(
S.of(context).download,
'/download',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/download',
closeDrawer: true,
),
TextLink(
S.of(context).tutorials,
'/tutorials',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/tutorials',
closeDrawer: true,
),
TextLink(
S.of(context).support,
'/support',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/support',
closeDrawer: true,
),
TextLink(
S.of(context).shop,
'/shop',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/shop',
closeDrawer: true,
),
TextLink(
S.of(context).blog,
'/blog',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/blog',
closeDrawer: true,
),
TextLink(
S.of(context).login,
'/login',
paddingVertical: 10.0,
paddingHorizontal: 15.0,
selected: currentRoute == '/login',
closeDrawer: true,
),
Container(
margin: EdgeInsets.only(top: 20.0),
height: 0.5,
color: Colors.green,
),
Container(
margin: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text(
S.of(context).information,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black54,
fontSize: 16.0,
),
),
),
TextLink(
S.of(context).service_policy,
'/service_policy',
paddingVertical: 5.0,
paddingHorizontal: 10.0,
closeDrawer: true,
),
TextLink(
S.of(context).return_policy,
'/return_policy',
paddingVertical: 5.0,
paddingHorizontal: 10.0,
closeDrawer: true,
),
TextLink(
S.of(context).privacy_policy,
'/privacy_policy',
paddingVertical: 5.0,
paddingHorizontal: 10.0,
closeDrawer: true,
),
TextLink(
S.of(context).license_agreement,
'/license_agreement',
paddingVertical: 5.0,
paddingHorizontal: 10.0,
closeDrawer: true,
),
Container(
margin: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text(
S.of(context).support,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black54,
fontSize: 16.0,
),
),
),
TextLink(S.of(context).wiki, '/wiki', paddingVertical: 5.0, paddingHorizontal: 10.0, closeDrawer: true,),
TextLink(S.of(context).support_ticket, '/support_ticket', paddingVertical: 5.0, paddingHorizontal: 10.0, closeDrawer: true,),
TextLink(S.of(context).contact_us, '/contact_us', paddingVertical: 5.0, paddingHorizontal: 10.0, closeDrawer: true,),
TextLink(S.of(context).about_us, '/about_us', paddingVertical: 5.0, paddingHorizontal: 10.0, closeDrawer: true,),
TextLink(S.of(context).renew_license, '/renew_license', paddingVertical: 5.0, paddingHorizontal: 10.0, closeDrawer: true,),
Container(
margin: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: Text(
S.of(context).developer_of,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black54,
fontSize: 16.0,
),
),
),
Wrap(
children: [
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
Constants.FONT_GOOGLE,
fontFamily: 'wisetronic',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
Constants.FONT_ALEXA,
fontFamily: 'wisetronic',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
Constants.FONT_APPLE,
fontFamily: 'wisetronic',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
Constants.FONT_EBAY,
fontFamily: 'wisetronic',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
Constants.FONT_QUICKBOOKS,
fontFamily: 'wisetronic',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
Container(
padding: EdgeInsets.all(10.0),
child: Icon(
IconData(
Constants.FONT_SHOPIFY,
fontFamily: 'wisetronic',
fontPackage: null
),
color: Colors.black26,
size: 48.0,
),
),
],
),
],
),
),
);
}
}