Beispiel #1
0
 public override Widget build(BuildContext context)
 {
     return(new Scaffold(
                appBar: new AppBar(
                    title: new Text("Modal bottom sheet"),
                    actions: new List <Widget> {
         new MaterialDemoDocumentationButton(routeName)
     }
                    ),
                body: new Center(
                    child: new RaisedButton(
                        child: new Text("SHOW BOTTOM SHEET"),
                        onPressed: () => {
         BottomSheetUtils.showModalBottomSheet <object>(context: context,
                                                        builder: (BuildContext _context) => {
             return new Container(
                 child: new Padding(
                     padding: EdgeInsets.all(32.0f),
                     child: new Text("This is the modal bottom sheet. Tap anywhere to dismiss.",
                                     textAlign: TextAlign.center,
                                     style: new TextStyle(
                                         color: Theme.of(_context).accentColor,
                                         fontSize: 24.0f
                                         )
                                     )
                     )
                 );
         });
     }
                        )
                    )
                ));
 }
Beispiel #2
0
 private IPromise <object> showModelBottomSheet(BuildContext cont)
 {
     return(BottomSheetUtils.showBottomSheet(
                context: cont,
                builder: (context) =>
     {
         PageController pc = new PageController(Model.typeNames.Count);
         return new Container(
             color: CColors.White,
             height: 270,
             child: new Stack(
                 children: new List <Widget>
         {
             new Align(
                 alignment: Alignment.topRight,
                 child: new IconButton(
                     onPressed: () =>
             {
                 Navigator.of(context).pop(null);
             },
                     icon: new Icon(
                         color: CColors.Black,
                         icon: MyIcons.close
                         )
                     )
                 ),
             new Column(
                 children: new List <Widget>
             {
                 new Row(children: _labels()),
             })
         })
             );
     })._completer);
 }
Beispiel #3
0
 private IPromise <object> showBottomSheet()
 {
     return(BottomSheetUtils.showBottomSheet(
                context: context,
                builder: (context) =>
     {
         return new BottomAppBar(
             color: CColors.White,
             child: new Container(width: 1000, height: 80, child: new Text("455"))
             );
     })._completer);
 }
        public override Widget build(BuildContext context)
        {
            List <Widget> rowContents = new List <Widget> {
                new IconButton(
                    icon: new Icon(Icons.menu),
                    onPressed: () => {
                    BottomSheetUtils.showModalBottomSheet <object>(
                        context: context,
                        builder: (BuildContext _context) => new _DemoDrawer()
                        );
                }
                    )
            };

            if (kCenterLocations.Contains(this.fabLocation))
            {
                rowContents.Add(
                    new Expanded(child: new SizedBox())
                    );
            }

            rowContents.AddRange(new List <Widget> {
                new IconButton(
                    icon: new Icon(Icons.search),
                    onPressed: () => {
                    Scaffold.of(context).showSnackBar(
                        new SnackBar(content: new Text("This is a dummy search action."))
                        );
                }
                    ),
                new IconButton(
                    icon: new Icon(
                        Theme.of(context).platform == RuntimePlatform.Android
                            ? Icons.more_vert
                            : Icons.more_horiz
                        ),
                    onPressed: () => {
                    Scaffold.of(context).showSnackBar(
                        new SnackBar(content: new Text("This is a dummy menu action."))
                        );
                }
                    )
            });

            return(new BottomAppBar(
                       color: this.color,
                       child: new Row(children: rowContents),
                       shape: this.shape
                       ));
        }
Beispiel #5
0
        void _showShoppingCart()
        {
            BottomSheetUtils.showModalBottomSheet <object>(context: this.context, builder: (BuildContext context) => {
                if (this.widget.shoppingCart.isEmpty())
                {
                    return(new Padding(
                               padding: EdgeInsets.all(24.0f),
                               child: new Text("The shopping cart is empty")
                               ));
                }

                return(new ListView(
                           padding: Constants.kMaterialListPadding,
                           children: this.widget.shoppingCart.Values.Select <Order, Widget>((Order order) => {
                    return new ListTile(
                        title: new Text(order.product.name),
                        leading: new Text($"{order.quantity}"),
                        subtitle: new Text(order.product.vendor.name)
                        );
                }).ToList()
                           ));
            });
        }
Beispiel #6
0
 public override Widget build(BuildContext context)
 {
     return(new Scaffold
            (
                backgroundColor: Colors.white,
                appBar: new AppBar
                (
                    title: new Text("Node Editor (UIWidgets Based)"),
                    centerTitle: false,
                    actions: new List <Widget>
     {
         new IconButton
         (
             icon: new Icon(Icons.brightness_4, color: Colors.white),
             onPressed: () =>
         {
         }
         ),
         new IconButton
         (
             icon: new Icon(Icons.settings, color: Colors.white),
             onPressed: () =>
         {
             BottomSheetUtils.showModalBottomSheet <object>
             (
                 context,
                 buildContext => new NodeEditorSettingsWidget()
             );
         }
         )
     }
                ),
                body: new Stack
                (
                    children: new List <Widget>
     {
         new NodeEditorWidget(nodeEditorWidgetKey),
         new Visibility
         (
             maintainInteractivity: false,
             maintainAnimation: false,
             child: PerformanceOverlay.allEnabled(),
             visible: NodeEditorSettingsManager.Instance.frameCounterEnabled.Value
         )
     }
                ),
                floatingActionButton: new FloatingActionButton
                (
                    onPressed: () =>
     {
         BottomSheetUtils.showModalBottomSheet <object>
         (
             context,
             buildContext => new NodeDataClassesListWidget().WithNodeEditorKey(nodeEditorWidgetKey)
         );
     },
                    tooltip: "Add",
                    child: new Icon(Icons.add)),
                floatingActionButtonLocation: FloatingActionButtonLocation.endFloat
            ));
 }