Skip to content

Commit

Permalink
added navigation from home to contact screen
Browse files Browse the repository at this point in the history
  • Loading branch information
richtwin567 committed Aug 5, 2020
1 parent a585d27 commit 67a2396
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 7 deletions.
File renamed without changes
1 change: 1 addition & 0 deletions lib/screens/contact_screen/contact_view_mobile_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class ContactViewMobileLandscapeState extends ContactViewState {
var mq = MediaQuery.of(context);

return Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
body: SafeArea(
child: AnimatedBuilder(
animation: ac,
Expand Down
1 change: 1 addition & 0 deletions lib/screens/contact_screen/contact_view_tablet_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ContactViewTabletLandscapeState extends ContactViewState {
var sidepanelWidth = screenWidth * 0.25 + kMinInteractiveDimension;

return Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
body: SafeArea(
child: AnimatedBuilder(
animation: ac,
Expand Down
4 changes: 3 additions & 1 deletion lib/utils/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ class AppTheme {
return ThemeData(
// Define the default brightness and colors.
primaryColor: Color.fromRGBO(0,62,138, 1),
accentColor: Color.fromRGBO(18, 29, 72, 1),
accentColor: Colors.blue[800],

// Define the default font family.
fontFamily: 'Montserrat',

backgroundColor: Colors.white,

appBarTheme: AppBarTheme(
iconTheme: IconThemeData(color: Colors.white, opacity: 1.0),
textTheme: TextTheme(
Expand Down
2 changes: 2 additions & 0 deletions lib/widgets/app_drawer/app_drawer.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:fst_app_flutter/routing/routes.dart';
import 'package:fst_app_flutter/widgets/app_drawer/app_drawer_mobile.dart';
import 'package:fst_app_flutter/widgets/app_drawer/app_drawer_tablet.dart';
import 'package:fst_app_flutter/widgets/drawer_option/drawer_option.dart';
Expand All @@ -16,6 +17,7 @@ class AppDrawer extends StatelessWidget {
DrawerOption(
title: 'Contacts',
iconData: Icons.contacts,
route: contactRoute,
),
DrawerOption(
title: 'FST Guild',
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/drawer_option/drawer_option.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DrawerOption extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Provider.value(
value: DrawerItemData(title: title, iconData: iconData),
value: DrawerItemData(title: title, iconData: iconData, route: route),
child: ScreenTypeLayout(
mobile: OrientationLayout(
landscape: (context) => DrawerOptionMobileLandscape(),
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/drawer_option/drawer_option_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DrawerOptionMobilePortrait extends BaseModelWidget<DrawerItemData> {
color: Color.fromRGBO(18, 29, 72, 1),
child: InkWell(
splashColor: Colors.blue[900],
onTap: () {},
onTap: () => Navigator.pushNamed(context, data.route),
child: Row(
children: <Widget>[
SizedBox(
Expand Down Expand Up @@ -53,6 +53,7 @@ class DrawerOptionMobileLandscape extends BaseModelWidget<DrawerItemData> {
onPressed: () {
updateState(() {
isPressed = !isPressed;
Navigator.pushNamed(context, data.route);
});
},
icon: Icon(
Expand Down
3 changes: 1 addition & 2 deletions lib/widgets/drawer_option/drawer_option_tablet.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:fst_app_flutter/models/drawer_item_data.dart';
import 'package:fst_app_flutter/widgets/app_drawer/app_drawer.dart';
import 'package:fst_app_flutter/widgets/base_data_model_widget.dart';

class DrawerOptionTabletPortrait extends BaseModelWidget<DrawerItemData> {
Expand All @@ -10,7 +9,7 @@ class DrawerOptionTabletPortrait extends BaseModelWidget<DrawerItemData> {
width: 152,
alignment: Alignment.center,
child: InkWell(
onTap: () {},
onTap: () => Navigator.pushNamed(context, data.route),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/responsive_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ResponsiveBuilder extends StatelessWidget {
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, boxConstraints) {
var mediaQuery = MediaQuery.of(context);
print("The device type is ${getDeviceType(mediaQuery)}");
//print("The device type is ${getDeviceType(mediaQuery)}");
var sizingInformation = SizingInformation(
orientation: mediaQuery.orientation,
deviceScreenType: getDeviceType(mediaQuery),
Expand Down
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ flutter:
# - images/a_dot_ham.jpeg

assets:
- images/contact/WhatsApp_flat.png
- assets/WhatsApp_flat.png
- assets/FST_logo.png
- assets/home_art.png

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
Expand Down

0 comments on commit 67a2396

Please sign in to comment.