Skip to content

104 complete #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2c59123
[101] Complete code.
willlarche Apr 25, 2018
ff09b39
[102] Minor copy correction.
willlarche Apr 26, 2018
5e5765c
[101] Update for Dart 2
willlarche May 7, 2018
b73c9ea
[102] Rebase.
willlarche Jun 11, 2018
a382d05
[102] Complete code.
willlarche Apr 25, 2018
7ddad74
[102] Correcting home being stateful.
willlarche Apr 27, 2018
e8d82a7
[103] Correcting order of fields. (#10)
willlarche Apr 28, 2018
ea1dd51
[102] Removing unneeded value.
willlarche Apr 30, 2018
1aa5983
[102] Dart 2.
willlarche May 7, 2018
b940f2e
[102] Data correction.
willlarche May 8, 2018
44c90f1
[103] README specificity.
willlarche Jun 11, 2018
350c27d
[103] Completed code.
willlarche Apr 26, 2018
18d0c29
[103] Removing unneeded directory.
willlarche Apr 30, 2018
93ea4bb
[103] Unused icons code.
willlarche Apr 30, 2018
5762268
[103] Moving supplemental files.
willlarche May 1, 2018
fc8f1ea
[103] Using recent changes.
willlarche May 7, 2018
5e72b47
[103] Removing unused import.
willlarche May 7, 2018
26748f2
[103] Data correction.
willlarche May 8, 2018
e489e76
[103] Adding body2 styling.
willlarche May 8, 2018
2f1ab95
[103] Dart 2
willlarche May 8, 2018
5f5e589
[103] Color const correction.
willlarche May 11, 2018
5e72bf5
[104] README specificity.
willlarche Jun 11, 2018
2ef4514
[103] Completed code.
willlarche Apr 26, 2018
368889b
[102] Complete code.
willlarche Apr 25, 2018
4679981
[103] Correcting order of fields. (#10)
willlarche Apr 28, 2018
e6149f3
[103] Completed code.
willlarche Apr 26, 2018
9c5858c
[103] Using recent changes.
willlarche May 7, 2018
2c52183
add backdrop and working menu with filtering
maryx May 7, 2018
8ba6378
[104] Minor visual changes.
willlarche May 7, 2018
5595882
[104] Visual detail.
willlarche May 7, 2018
b696947
[104] Newline at EOF.
willlarche May 7, 2018
74bbb42
[104] License stanzas.
willlarche May 7, 2018
f3de807
[104] Removing files from merge.
willlarche May 7, 2018
bdeddc8
[104] Sync.
willlarche May 7, 2018
6bf3313
[104] Correcting license
willlarche May 8, 2018
87f9c1a
[104] Adding license stanza
willlarche May 8, 2018
73c235d
[104] Decrease backdrop radius size to match mocks. (#21)
clocksmith May 16, 2018
172538d
[104] PR feedback.
willlarche May 16, 2018
c87ff4d
[104] Removing an unnecessary widget.
willlarche May 16, 2018
2f6a3fd
[104] Formatting.
willlarche May 16, 2018
9722f44
[104] Replaces regular hamburger menu behavior with a branded version…
clocksmith May 18, 2018
6990246
[104] Changing "Panel" to "Layer" (#24)
willlarche May 21, 2018
68357b5
[104] Merge sync. (#27)
willlarche May 22, 2018
75f79b6
[104] Removing log statement.
willlarche May 25, 2018
da363a2
[104] Correcting import order.
willlarche May 25, 2018
70b33cc
[104] Adding a little whitespace
willlarche May 25, 2018
34a57cb
[104] Backdrop code review feedback (#29)
willlarche May 25, 2018
e08efe3
[104] Add branded icon menu nav animation (#28)
clocksmith May 30, 2018
13b4541
[104] PR feedback.
willlarche Jun 11, 2018
3ce50d4
[104] Padding correction.
willlarche Jun 11, 2018
6f6d9e2
[TextFields] PR feedback.
willlarche Jun 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Codelabs MDC-101 through MDC-104 will guide you through building and integrating
The starter and completed code is in the various branches of this repo.

## Getting Started
Visit the [Google codelabs site](https://codelabs.developers.google.com/), or [codelabs.developers.google.com/codelabs/mdc-101-flutter](https://codelabs.developers.google.com/codelabs/mdc-101-flutter), to follow along the guided steps.
Visit the [Google codelabs site](https://codelabs.developers.google.com/), or [codelabs.developers.google.com/codelabs/mdc-104-flutter](https://codelabs.developers.google.com/codelabs/mdc-104-flutter), to follow along the guided steps.

## Support

Expand Down
Binary file added mdc_100_series/assets/2.0x/slanted_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mdc_100_series/assets/3.0x/slanted_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mdc_100_series/assets/slanted_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 88 additions & 6 deletions mdc_100_series/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,111 @@

import 'package:flutter/material.dart';

import 'backdrop.dart';
import 'colors.dart';
import 'home.dart';
import 'login.dart';
import 'category_menu_page.dart';
import 'model/product.dart';
import 'supplemental/cut_corners_border.dart';

class ShrineApp extends StatelessWidget {
class ShrineApp extends StatefulWidget {
@override
_ShrineAppState createState() => _ShrineAppState();
}

class _ShrineAppState extends State<ShrineApp> {
Category _currentCategory = Category.all;

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Shrine',
home: HomePage(),
home: Backdrop(
currentCategory: _currentCategory,
frontLayer: HomePage(category: _currentCategory),
backLayer: CategoryMenuPage(
currentCategory: _currentCategory,
onCategoryTap: _onCategoryTap,
),
frontTitle: Text('SHRINE'),
backTitle: Text('MENU'),
),
initialRoute: '/login',
onGenerateRoute: _getRoute,
theme: _kShrineTheme,
);
}

Route<dynamic> _getRoute(RouteSettings settings) {
if (settings.name != '/login') {
return null;
}
/// Function to call when a [Category] is tapped.
void _onCategoryTap(Category category) {
setState(() {
_currentCategory = category;
});
}
}

Route<dynamic> _getRoute(RouteSettings settings) {
if (settings.name == '/login') {
return MaterialPageRoute<void>(
settings: settings,
builder: (BuildContext context) => LoginPage(),
fullscreenDialog: true,
);
}

return null;
}

final ThemeData _kShrineTheme = _buildShrineTheme();

IconThemeData _customIconTheme(IconThemeData original) {
return original.copyWith(color: kShrineBrown900);
}

ThemeData _buildShrineTheme() {
final ThemeData base = ThemeData.light();
return base.copyWith(
accentColor: kShrineBrown900,
primaryColor: kShrinePink100,
buttonColor: kShrinePink100,
scaffoldBackgroundColor: kShrineBackgroundWhite,
cardColor: kShrineBackgroundWhite,
textSelectionColor: kShrinePink100,
errorColor: kShrineErrorRed,
buttonTheme: ButtonThemeData(
textTheme: ButtonTextTheme.accent,
),
primaryIconTheme: base.iconTheme.copyWith(color: kShrineBrown900),
inputDecorationTheme: InputDecorationTheme(
border: CutCornersBorder(),
),
textTheme: _buildShrineTextTheme(base.textTheme),
primaryTextTheme: _buildShrineTextTheme(base.primaryTextTheme),
accentTextTheme: _buildShrineTextTheme(base.accentTextTheme),
iconTheme: _customIconTheme(base.iconTheme),
);
}

TextTheme _buildShrineTextTheme(TextTheme base) {
return base.copyWith(
headline: base.headline.copyWith(
fontWeight: FontWeight.w500,
),
title: base.title.copyWith(
fontSize: 18.0
),
caption: base.caption.copyWith(
fontWeight: FontWeight.w400,
fontSize: 14.0,
),
body2: base.body2.copyWith(
fontWeight: FontWeight.w500,
fontSize: 16.0,
),
).apply(
fontFamily: 'Rubik',
displayColor: kShrineBrown900,
bodyColor: kShrineBrown900,
);
}
Loading