Пример #1
0
 public HomePage(
     ExpandingBottomSheet expandingBottomSheet = null,
     Backdrop backdrop = null,
     Key key           = null
     ) : base(key: key)
 {
     this.expandingBottomSheet = expandingBottomSheet;
     this.backdrop             = backdrop;
 }
Пример #2
0
        public override Widget build(BuildContext context)
        {
            ThemeData localTheme = Theme.of(context);

            return(new Scaffold(
                       backgroundColor: shrineColorsUtils.kShrinePink50,
                       body: new SafeArea(
                           child: new Container(
                               child: new ScopedModelDescendant <AppStateModel>(
                                   builder: (BuildContext context2, Widget child, AppStateModel model) => {
                return new Stack(
                    children: new List <Widget> {
                    new ListView(
                        children: new List <Widget> {
                        new Row(
                            children: new List <Widget> {
                            new SizedBox(
                                width: shopping_cartUtils._leftColumnWidth,
                                child: new IconButton(
                                    icon: new Icon(Icons.keyboard_arrow_down),
                                    onPressed: () => ExpandingBottomSheet.of(context).close()
                                    )
                                ),
                            new Text(
                                "CART",
                                style: localTheme.textTheme.subtitle1.copyWith(fontWeight: FontWeight.w600)
                                ),
                            new SizedBox(width: 16.0f),
                            new Text($"{model.totalCartQuantity} ITEMS")
                        }
                            ),
                        new SizedBox(height: 16.0f),
                        new Column(
                            children: _createShoppingCartRows(model)
                            ),
                        new ShoppingCartSummary(model: model),
                        new SizedBox(height: 100.0f)
                    }
                        ),
                    new Positioned(
                        bottom: 16.0f,
                        left: 16.0f,
                        right: 16.0f,
                        child: new RaisedButton(
                            shape: new BeveledRectangleBorder(
                                borderRadius: BorderRadius.all(Radius.circular(7.0f))
                                ),
                            color: shrineColorsUtils.kShrinePink100,
                            splashColor: shrineColorsUtils.kShrineBrown600,
                            child: new Padding(
                                padding: EdgeInsets.symmetric(vertical: 12.0f),
                                child: new Text("CLEAR CART")
                                ),
                            onPressed: () => {
                        model.clearCart();
                        ExpandingBottomSheet.of(context).close();
                    }
                            )
                        )
                }
                    );
            }
                                   )
                               )
                           )
                       ));
        }