1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00

[Shrine] New Shrine with expanding cart bottom sheet from experimenal (#18)

This commit is contained in:
Will Larche
2018-09-27 11:36:30 -04:00
committed by Andrew Brogdon
parent b5ce05e934
commit 4b4d5fef9c
11 changed files with 857 additions and 88 deletions

View File

@@ -15,21 +15,45 @@
import 'package:flutter/material.dart';
import 'package:scoped_model/scoped_model.dart';
import 'backdrop.dart';
import 'expanding_bottom_sheet.dart';
import 'model/app_state_model.dart';
import 'model/product.dart';
import 'supplemental/asymmetric_view.dart';
class HomePage extends StatelessWidget {
class ProductPage extends StatelessWidget {
final Category category;
const HomePage({this.category: Category.all});
const ProductPage({this.category: Category.all});
@override
Widget build(BuildContext context) {
return ScopedModelDescendant<AppStateModel>(
builder: (context, child, model) => AsymmetricView(
products: model.getProducts(),
),
builder: (BuildContext context, Widget child, AppStateModel model) {
return AsymmetricView(
products: model.getProducts(),
);
});
}
}
class HomePage extends StatelessWidget {
final ExpandingBottomSheet expandingBottomSheet;
final Backdrop backdrop;
const HomePage({
Key key,
this.expandingBottomSheet,
this.backdrop
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
backdrop,
Align(child: expandingBottomSheet, alignment: Alignment.bottomRight)
],
);
}
}