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:
committed by
Andrew Brogdon
parent
b5ce05e934
commit
4b4d5fef9c
@@ -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)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user