diff --git a/android/.gitignore b/android/.gitignore index bc2100d..418812e 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -5,3 +5,6 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +/android/app/src/debug/gen +/android/app/src/main/gen +/android/app/src/profile/gen \ No newline at end of file diff --git a/lib/common/theme.dart b/lib/common/theme.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/home_widget.dart b/lib/home_widget.dart deleted file mode 100644 index a80d49e..0000000 --- a/lib/home_widget.dart +++ /dev/null @@ -1,64 +0,0 @@ -import 'package:flutter/material.dart'; -import 'placeholder_widget.dart'; - -class Home extends StatelessWidget { - final List _curSport = ['FootBall', Colors.green]; - - final List colorList = [ - const Item("FootBall", Colors.red), - const Item("Soccer", Colors.pinkAccent), - const Item('Baseball', Colors.yellow), - ]; - - final List _children = [ - PlaceholderWidget(Colors.white), - PlaceholderWidget(Colors.orange), - PlaceholderWidget(Colors.blue), - PlaceholderWidget(Colors.red), - PlaceholderWidget(Colors.black38), - ]; - - @override - Widget build(BuildContext context) { - Item selectedSport; - - return StatefulBuilder( - builder: (context, StateSetter setState) => Scaffold( - appBar: AppBar( - centerTitle: true, - title: DropdownButton( - value: selectedSport, - icon: Icon(Icons.arrow_drop_down), - iconSize: 24, - style: TextStyle(color: Colors.black), - iconEnabledColor: Colors.white, - onChanged: (Item value) { - setState(() { - selectedSport = value; - _curSport[0] = selectedSport.name; - _curSport[1] = selectedSport.color; - }); - }, - items: colorList.map>((Item item) { - return DropdownMenuItem( - value: item, - child: SizedBox( - width: 100, - child: Text(item.name), - ), - ); - }).toList(), - ), - backgroundColor: _curSport[1], - ), - body: _children[2], - )); - } -} - -class Item { - const Item(this.name, this.color); - - final String name; - final Color color; -} diff --git a/lib/main.dart b/lib/main.dart index aad7acc..3ea11af 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,16 +1,19 @@ import 'package:flutter/material.dart'; -import 'home_widget.dart'; +import 'screens/home_widget.dart'; +import 'screens/sport.dart'; void main() => runApp(App()); -class App extends StatelessWidget{ +class App extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, - home: Home(), + initialRoute: '/', + routes: { + '/': (context) => Home(), + '/Sport': (context) => Sport(), + }, ); } } - - diff --git a/lib/screens/home_widget.dart b/lib/screens/home_widget.dart new file mode 100644 index 0000000..efedd67 --- /dev/null +++ b/lib/screens/home_widget.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import '../placeholder_widget.dart'; + +class Home extends StatelessWidget { + final List _children = [ + PlaceholderWidget(Colors.white), + PlaceholderWidget(Colors.orange), + PlaceholderWidget(Colors.blue), + PlaceholderWidget(Colors.red), + PlaceholderWidget(Colors.black38), + ]; + + @override + Widget build(BuildContext context) { + return StatefulBuilder( + builder: (context, StateSetter setState) => Scaffold( + appBar: AppBar( + centerTitle: false, + title: Text("49ers"), + ), + body: _children[4], + floatingActionButton: FloatingActionButton( + backgroundColor: Colors.green, + child: Icon(Icons.arrow_forward_ios), + onPressed: () => Navigator.pushNamed(context, '/Sport'), + ), + drawer: Drawer( + child: ListView( + children: [ + DrawerHeader( + child: Text( + 'Drawer Header', + style: TextStyle( + color: Colors.white, + fontSize: 24, + ), + ), + decoration: BoxDecoration( + color: Colors.green, + ), + ), + ListTile( + leading: Icon(Icons.message), + title: Text('Messages'), + ), + ], + ), + ), + )); + } +} diff --git a/lib/screens/sport.dart b/lib/screens/sport.dart new file mode 100644 index 0000000..a56e759 --- /dev/null +++ b/lib/screens/sport.dart @@ -0,0 +1,57 @@ +import 'package:flutter/material.dart'; + +class Sport extends StatelessWidget { + final List _curSport = ['FootBall', Colors.green]; + + final List colorList = [ + const Item("FootBall", Colors.red), + const Item("Soccer", Colors.pinkAccent), + const Item('Baseball', Colors.yellow), + ]; + + @override + Widget build(BuildContext context) { + Item selectedSport; + + return StatefulBuilder( + builder: (context, StateSetter setState) => Scaffold( + appBar: AppBar( + title: DropdownButton( + value: selectedSport, + icon: Icon(Icons.arrow_drop_down), + iconSize: 24, + style: TextStyle(color: Colors.black), + iconEnabledColor: Colors.white, + onChanged: (Item value) { + setState(() { + selectedSport = value; + _curSport[0] = selectedSport.name; + _curSport[1] = selectedSport.color; + }); + }, + items: colorList.map>((Item item) { + return DropdownMenuItem( + value: item, + child: SizedBox( + width: 100, + child: Text(item.name), + ), + ); + }).toList(), + ), + backgroundColor: _curSport[1], + ), + body: Center( + child: Text("Sports Page Body"), + ), + ), + ); + } +} + +class Item { + const Item(this.name, this.color); + + final String name; + final Color color; +}