예제 #1
0
 protected override Widget createWidget()
 {
     return(new StoreProvider <AppState>(store,
                                         child: new MaterialApp(
                                             title: "TODO APP",
                                             theme: ThemeData.light(),
                                             home: new StoreConnector <AppState, _ViewModel>(
                                                 converter: (state, dispatcher) => new _ViewModel(store),
                                                 builder: (context, viewmodel) =>
     {
         return new Scaffold(
             appBar: new AppBar(
                 title: new Text("ToDo App")),
             body: new Container(
                 child: new Column(
                     children: new List <Widget>()
         {
             new AddItemWidget(viewmodel),
             new Expanded(child: new ItemListWidget(viewmodel)),
             new RemoveItemButton(viewmodel)
         })
                 ));
     })
                                             )));
 }
예제 #2
0
        static ThemeData _buildShrineTheme()
        {
            ThemeData _base = ThemeData.light();

            return(_base.copyWith(
                       colorScheme: kShrineColorScheme,
                       accentColor: shrineColorsUtils.kShrineBrown900,
                       primaryColor: shrineColorsUtils.kShrinePink100,
                       buttonColor: shrineColorsUtils.kShrinePink100,
                       scaffoldBackgroundColor: shrineColorsUtils.kShrineBackgroundWhite,
                       cardColor: shrineColorsUtils.kShrineBackgroundWhite,
                       textSelectionColor: shrineColorsUtils.kShrinePink100,
                       errorColor: shrineColorsUtils.kShrineErrorRed,
                       buttonTheme: new ButtonThemeData(
                           colorScheme: kShrineColorScheme,
                           textTheme: ButtonTextTheme.normal
                           ),
                       primaryIconTheme: _customIconTheme(_base.iconTheme),
                       inputDecorationTheme: new InputDecorationTheme(border: new CutCornersBorder()),
                       textTheme: _buildShrineTextTheme(_base.textTheme),
                       primaryTextTheme: _buildShrineTextTheme(_base.primaryTextTheme),
                       accentTextTheme: _buildShrineTextTheme(_base.accentTextTheme),
                       iconTheme: _customIconTheme(_base.iconTheme)
                       ));
        }
예제 #3
0
        static ThemeData _buildLightTheme()
        {
            Color       primaryColor   = new Color(0xFF0175c2);
            Color       secondaryColor = new Color(0xFF13B9FD);
            ColorScheme colorScheme    = ColorScheme.light().copyWith(
                primary: primaryColor,
                secondary: secondaryColor
                );
            ThemeData baseTheme = ThemeData.light();

            return(baseTheme.copyWith(
                       colorScheme: colorScheme,
                       primaryColor: primaryColor,
                       buttonColor: primaryColor,
                       indicatorColor: Colors.white,
                       splashColor: Colors.white24,
                       splashFactory: InkRipple.splashFactory,
                       accentColor: secondaryColor,
                       canvasColor: Colors.white,
                       scaffoldBackgroundColor: Colors.white,
                       backgroundColor: Colors.white,
                       errorColor: new Color(0xFFB00020),
                       buttonTheme: new ButtonThemeData(
                           colorScheme: colorScheme,
                           textTheme: ButtonTextTheme.primary
                           ),
                       textTheme: _buildTextTheme(baseTheme.textTheme),
                       primaryTextTheme: _buildTextTheme(baseTheme.primaryTextTheme),
                       accentTextTheme: _buildTextTheme(baseTheme.accentTextTheme)
                       ));
        }
예제 #4
0
        public override Widget build(BuildContext context)
        {
            return(new Theme(
                       data: lightTheme?ThemeData.light() : ThemeData.dark(),
                           child: new DefaultTabController(
                               length: 3,
                               child: new Scaffold(
                                   appBar: new AppBar(
                                       title: new GestureDetector(
                                           child: new Text("Color Picker Example"),
                                           onDoubleTap: (DoubleTapDetails details) => setState(() => lightTheme = !lightTheme)
                                           ),//GestureDetector
                                       bottom: new TabBar(
                                           tabs: new List <Widget>
            {
                new Tab(text: "HSV"),
                new Tab(text: "Material"),
                new Tab(text: "Block")
            }
                                           ) //TabBar
                                       ),    //AppBar
                                   body: new TabBarView(
                                       physics: new NeverScrollableScrollPhysics(),
                                       children: new List <Widget>
            {
                new Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: new List <Widget> {
                    new RaisedButton(
                        elevation: 3f,
                        onPressed: () =>
                    {
                        DialogUtils.showDialog(
                            context: context,
                            builder: (BuildContext _) => {
                            return new AlertDialog(
                                titlePadding: EdgeInsets.all(0f),
                                contentPadding: EdgeInsets.all(0f),
                                content: new SingleChildScrollView(
                                    child: new ColorPicker(
                                        pickerColor: currentColor,
                                        onColorChanged: changeColor,
                                        colorPickerWidth: 300f,
                                        pickerAreaHeightPercent: 0.7f,
                                        enableAlpha: true,
                                        displayThumbColor: true,
                                        showLabel: true,
                                        paletteType: PaletteType.hsv,
                                        pickerAreaBorderRadius: BorderRadius.only(
                                            topLeft: Radius.circular(2f),
                                            topRight: Radius.circular(2f)
                                            )             //BorderRadius

                                        )                 //ColorPicker
                                    )                     //SingleChildScrollView
                                );                        //AlertDialog
                        }
                            );
                    },
                        child: new Text("Change me"),
                        color: currentColor,
                        textColor: Utils.useWhiteForeground(currentColor)
                                            ? new Color(0xffffffff)
                                            : new Color(0xff000000)
                        ),                //RaisedButton
                    new RaisedButton(
                        elevation: 3f,
                        onPressed: () => {
                        DialogUtils.showDialog(
                            context: context,
                            builder: (BuildContext _) => {
                            return new AlertDialog(
                                titlePadding: EdgeInsets.all(0),
                                contentPadding: EdgeInsets.all(0f),
                                shape: new RoundedRectangleBorder(
                                    borderRadius: BorderRadius.circular(25)
                                    ),                        //RoundedRectangleBorder
                                content: new SingleChildScrollView(
                                    child: new SlidePicker(
                                        pickerColor: currentColor,
                                        onColorChanged: changeColor,
                                        paletteType: PaletteType.rgb,
                                        enableAlpha: false,
                                        displayThumbColor: true,
                                        showLabel: false,
                                        showIndicator: true,
                                        indicatorBorderRadius: BorderRadius.vertical(top: Radius.circular(25))
                                        )                 //SlidePicker
                                    )                     //SingleChildScrollView
                                );                        //AlertDialog
                        }
                            );
                    },
                        child: new Text("Change me again"),
                        color: currentColor,
                        textColor: Utils.useWhiteForeground(currentColor)
                                            ? new Color(0xffffffff)
                                            : new Color(0xff000000)
                        )
                }
                    ),            //Column
                new Center(
                    child: new RaisedButton(
                        elevation: 3f,
                        onPressed: () => {
                    DialogUtils.showDialog(
                        context: context,
                        builder: (BuildContext _) => {
                        return new AlertDialog(
                            titlePadding: EdgeInsets.all(0f),
                            contentPadding: EdgeInsets.all(0f),
                            content: new SingleChildScrollView(
                                child: new MaterialPicker(
                                    pickerColor: currentColor,
                                    onColorChanged: changeColor,
                                    enableLabel: true
                                    )     //MaterialPicker
                                )         //SingleChildScrollView
                            );            //AlertDialog
                    }
                        );                //showDialog
                },                        //onPresed
                        child: new Text("Change me"),
                        color: currentColor,
                        textColor: Utils.useWhiteForeground(currentColor)
                                        ? new Color(0xffffffff)
                                        : new Color(0xff000000)
                        )         //RaisedButton
                    ),            //Center
                new Center(
                    child: new Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: new List <Widget> {
                    new RaisedButton(
                        elevation: 3f,
                        onPressed: () => {
                        DialogUtils.showDialog(
                            context: context,
                            builder: (BuildContext _) => {
                            return new AlertDialog(
                                title: new Text("Select color"),
                                content: new SingleChildScrollView(
                                    child: new BlockPicker(
                                        pickerColor: currentColor,
                                        onColorChanged: changeColor
                                        )         //BlockPicker
                                    )             //SingleChildScrollView
                                );                //AlertDialog
                        }
                            );                    //showDialog
                    },                            //onPressed
                        child: new Text("Change me again"),
                        color: currentColor,
                        textColor: Utils.useWhiteForeground(currentColor)
                                                ? new Color(0xffffffff)
                                                : new Color(0xff000000)
                        )                //RaisedButton
                }
                        )                //Column
                    )                    //center
            }
                                       ) //TabBarView
                                   )     //Scaffold
                               )         //DefaultTabController
                       ));               //Theme
        }//function build