1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-15 03:22:59 +00:00

Fixing unchangeable Shrine categories. (#9)

This commit is contained in:
Andrew Brogdon
2018-08-08 08:41:18 -07:00
committed by GitHub
parent 2681473884
commit 370a72caa5
5 changed files with 48 additions and 68 deletions

View File

@@ -19,7 +19,6 @@ import 'category_menu_page.dart';
import 'colors.dart';
import 'home.dart';
import 'login.dart';
import 'model/product.dart';
import 'supplemental/cut_corners_border.dart';
class ShrineApp extends StatefulWidget {
@@ -28,19 +27,13 @@ class ShrineApp extends StatefulWidget {
}
class _ShrineAppState extends State<ShrineApp> {
Category _currentCategory = Category.all;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Shrine',
home: Backdrop(
currentCategory: _currentCategory,
frontLayer: HomePage(category: _currentCategory),
backLayer: CategoryMenuPage(
currentCategory: _currentCategory,
onCategoryTap: _onCategoryTap,
),
frontLayer: HomePage(),
backLayer: CategoryMenuPage(),
frontTitle: Text('SHRINE'),
backTitle: Text('MENU'),
),
@@ -49,13 +42,6 @@ class _ShrineAppState extends State<ShrineApp> {
theme: _kShrineTheme,
);
}
/// Function to call when a [Category] is tapped.
void _onCategoryTap(Category category) {
setState(() {
_currentCategory = category;
});
}
}
Route<dynamic> _getRoute(RouteSettings settings) {