Esempio n. 1
0
 public override Widget build(BuildContext context)
 {
     return(new Container(
                margin: EdgeInsets.symmetric(horizontal: 8.0f),
                child: new Row(
                    children: new List <Widget>
     {
         /// text input
         new Flexible(
             child: new TextField(
                 controller: _textController,
                 decoration: InputDecoration.collapsed(hintText: "Send a message"),
                 onSubmitted: this.OnSend,
                 focusNode: _textFocus
                 )
             ),
         /// the Send button
         new Container(
             margin: EdgeInsets.symmetric(horizontal: 4.0f),
             child: new IconButton(
                 icon: new Icon(Icons.send),
                 onPressed: () => this.OnSend(_textController.text))
             )
     }
                    )
                ));
 }
Esempio n. 2
0
 public override Widget build(BuildContext context)
 {
     return(new DefaultTabController(
                length: 2,
                child: new Scaffold(
                    extendBody: true,
                    drawer: new Drawer(
                        child: new FlatButton(
                            child: new Text("About"),
                            onPressed: () => Navigator.popAndPushNamed(context, Routes.AboutPageRouteText))),
                    appBar: new AppBar(
                        bottom: new TabBar(
                            tabs: new List <Widget>
     {
         new Container(height: 30, child: new Text("Home", style: new TextStyle(
                                                       shadows: new List <BoxShadow> {
             new BoxShadow(
                 color: Colors.red,
                 offset: new Offset(0, 0),
                 blurRadius: 5,
                 spreadRadius: 5
                 )
         }
                                                       ))),
         new Container(height: 30, child: new Text("Settings", style: new TextStyle(
                                                       shadows: new List <BoxShadow> {
             new BoxShadow(
                 color: Colors.red,
                 offset: new Offset(0, 0),
                 blurRadius: 5,
                 spreadRadius: 5
                 )
         }
                                                       )))
         //,
         //new Container (height: 30, child: new Text ("About")),
     },
                            labelStyle: new TextStyle(fontSize: 24f),
                            indicatorSize: TabBarIndicatorSize.tab
                            ),
                        title: new Container(
                            child: new Row(
                                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                mainAxisSize: MainAxisSize.max,
                                children: new List <Widget>
     {
         new Text("MikuMikuManager"),
         new Container(
             padding: EdgeInsets.all(8),
             width: Screen.width / 2,
             decoration: new BoxDecoration(
                 Colors.white24,
                 border: Border.all(Colors.white24),
                 borderRadius: BorderRadius.circular(18)),
             child:
             new TextField(
                 decoration: InputDecoration.collapsed(
                     "Search..."
                     ),
                 autofocus: false,
                 style: new TextStyle(fontSize: 17),
                 onSubmitted: x => widget.SearchPattern.Value = x
                 )),
         new PopupMenuButton <SortType>(
             child: new Icon(Icons.sort),
             itemBuilder: _ => new List <PopupMenuEntry <SortType> >
         {
             new PopupMenuItem <SortType>(
                 value: SortType.ByDefault,
                 child: new Text("By Default")
                 ),
             new PopupMenuItem <SortType>(
                 value: SortType.ByFavorite,
                 child: new Text("By Favorite")
                 ),
             new PopupMenuItem <SortType>(
                 value: SortType.ByFolder,
                 child: new Text("By Folder")
                 )
         },
             initialValue: widget.SortTypeProperty.Value,
             onSelected: x => { widget.SortTypeProperty.Value = x; }
             )
     }
                                )
                            )
                        ),
                    body: new Padding(
                        padding: EdgeInsets.all(8),
                        child: new TabBarView(
                            children: new List <Widget>
     {
         new GalleryPage(),
         new SettingPage()
     }
                            )
                        ),
                    floatingActionButton: new Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        mainAxisSize: MainAxisSize.min,
                        crossAxisAlignment: CrossAxisAlignment.end,
                        children: new List <Widget>
     {
         FloatingActionButton.extended(
             icon: new Icon(Icons.track_changes),
             label: new Text("Generate All"),
             onPressed: () =>
         {
             var builder = GameObject.Find("MMDRenderer")
                           .GetComponent <PreviewBuilder.PreviewBuilder>();
             builder.StartRender();
         }),
         new SizedBox(height: 10, width: 10),
         FloatingActionButton.extended(
             icon: new Icon(Icons.refresh),
             label: new Text("Refresh"),
             onPressed: () => MMMServices.RefreshObservedMmdObjects())
     }
                        ),
                    bottomNavigationBar: new Container(
                        height: 30,
                        decoration: new BoxDecoration(
                            Colors.white,
                            boxShadow: new List <BoxShadow>
     {
         new BoxShadow(Colors.black.withOpacity(0.3f), new Offset(0, -5), 5)
     }
                            ),
                        child: new Stack(
                            children: new List <Widget>
     {
         SizedBox.expand(
             child: new LinearProgressIndicator(
                 backgroundColor: Colors.transparent,
                 value: _progress,
                 valueColor: new AlwaysStoppedAnimation <Color>(
                     Colors.pink))),
         //Status text
         new Container(
             margin: EdgeInsets.only(5),
             alignment: Alignment.centerLeft,
             child: new Row(
                 children: new List <Widget>
         {
             PaddingText(_renderStatus),
             VerticalDivider,
             PaddingText(_savingStatus)
         }
                 )
             )
     }
                            )
                        )
                    )
                ));
 }