From 9de9ed897cebad80f5cb96318f8355a5d9849f00 Mon Sep 17 00:00:00 2001 From: kwainright Date: Sat, 15 Feb 2020 21:02:28 -0500 Subject: [PATCH 01/15] Added structure for scrolling media cards to be added. Currently using Container objects as placeholders. --- lib/home_widget.dart | 181 ++++++++++++++++++++++++++++++++++++++++++- lib/main.dart | 1 + 2 files changed, 180 insertions(+), 2 deletions(-) diff --git a/lib/home_widget.dart b/lib/home_widget.dart index 22dabbb..0435a86 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -9,7 +9,182 @@ class Home extends StatefulWidget { class _HomeState extends State{ int _currentIndex = 0; final List _children = [ - PlaceholderWidget(Colors.white), + ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + height: 175, + margin: EdgeInsets.symmetric(vertical: 10), + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + Container( + width: 325, + margin: EdgeInsets.symmetric(horizontal: 10), + color: Colors.orange, + ), + Container( + width: 325, + color: Colors.orange, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.orange, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.orange, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.orange, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + ], + ), + ), + Container( + height: 175, + margin: EdgeInsets.symmetric(vertical: 10), + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + Container( + width: 325, + margin: EdgeInsets.symmetric(horizontal: 10), + color: Colors.green, + ), + Container( + width: 325, + color: Colors.green, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.green, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.green, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.green, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + ], + ), + ), + Container( + height: 175, + margin: EdgeInsets.symmetric(vertical: 10), + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + Container( + width: 325, + margin: EdgeInsets.symmetric(horizontal: 10), + color: Colors.purple, + ), + Container( + width: 325, + color: Colors.purple, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.purple, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.purple, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.purple, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + ], + ), + ), + Container( + height: 175, + margin: EdgeInsets.symmetric(vertical: 10), + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + Container( + width: 325, + margin: EdgeInsets.symmetric(horizontal: 10), + color: Colors.blue, + ), + Container( + width: 325, + color: Colors.blue, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.blue, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.blue, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.blue, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + ], + ), + ), + Container( + height: 175, + margin: EdgeInsets.symmetric(vertical: 10), + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + Container( + width: 325, + margin: EdgeInsets.symmetric(horizontal: 10), + color: Colors.red, + ), + Container( + width: 325, + color: Colors.red, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.red, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.red, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + Container( + width: 325, + color: Colors.red, + margin: EdgeInsets.symmetric(horizontal: 10), + ), + ], + ), + ), + + ], + ), PlaceholderWidget(Colors.orange), PlaceholderWidget(Colors.blue), PlaceholderWidget(Colors.red), @@ -22,7 +197,9 @@ class _HomeState extends State{ appBar: AppBar( title: Text('UNCC Athletics App'), ), - body: _children[_currentIndex], + body: Container( + child: _children[_currentIndex] + ), bottomNavigationBar: BottomNavigationBar( type: BottomNavigationBarType.fixed, onTap: onTabTapped, diff --git a/lib/main.dart b/lib/main.dart index 47d6b1c..4bde493 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,6 +9,7 @@ class App extends StatelessWidget{ return MaterialApp( debugShowCheckedModeBanner: false, title: 'UNCC Athletics', + home: Home(), ); } From c5e02cf7f136c17cf9dc9799017e2a70eb33bc3f Mon Sep 17 00:00:00 2001 From: Kaleb Wainright Date: Sat, 15 Feb 2020 21:51:29 -0500 Subject: [PATCH 02/15] Additional card formatting. Added column for thumbnail to be added and text. --- lib/home_widget.dart | 324 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 299 insertions(+), 25 deletions(-) diff --git a/lib/home_widget.dart b/lib/home_widget.dart index 0435a86..82aff14 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -21,27 +21,82 @@ class _HomeState extends State{ Container( width: 325, margin: EdgeInsets.symmetric(horizontal: 10), - color: Colors.orange, + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.orange, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.orange, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.orange, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.orange, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.orange, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.orange, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.orange, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.orange, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.orange, + ), + ), + Text('Testing'), + ], + ), + ), ), ], ), @@ -55,27 +110,82 @@ class _HomeState extends State{ Container( width: 325, margin: EdgeInsets.symmetric(horizontal: 10), - color: Colors.green, + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.green, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.green, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.green, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.green, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.green, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.green, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.green, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.green, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.green, + ), + ), + Text('Testing'), + ], + ), + ), ), ], ), @@ -89,27 +199,82 @@ class _HomeState extends State{ Container( width: 325, margin: EdgeInsets.symmetric(horizontal: 10), - color: Colors.purple, + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.purple, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.purple, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.purple, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.purple, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.purple, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.purple, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.purple, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.purple, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.purple, + ), + ), + Text('Testing'), + ], + ), + ), ), ], ), @@ -123,27 +288,81 @@ class _HomeState extends State{ Container( width: 325, margin: EdgeInsets.symmetric(horizontal: 10), - color: Colors.blue, + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.blue, ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.blue, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.blue, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.blue, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.blue, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.blue, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.blue, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.blue, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.blue, + ), + ), + Text('Testing'), + ], + ), + ), ), ], ), @@ -157,27 +376,82 @@ class _HomeState extends State{ Container( width: 325, margin: EdgeInsets.symmetric(horizontal: 10), - color: Colors.red, + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.red, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.red, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.red, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.red, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.red, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.red, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.red, + ), + ), + Text('Testing'), + ], + ), + ), ), Container( width: 325, - color: Colors.red, margin: EdgeInsets.symmetric(horizontal: 10), + child: Card( + child: Column( + children: [ + Expanded( + child: Container( + color: Colors.red, + ), + ), + Text('Testing'), + ], + ), + ), ), ], ), From 9033e7fab1fc219d7ac12bb8d654a2a2e5083296 Mon Sep 17 00:00:00 2001 From: kwainright Date: Sat, 15 Feb 2020 22:02:55 -0500 Subject: [PATCH 03/15] Added fancy Title --- lib/home_widget.dart | 52 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/lib/home_widget.dart b/lib/home_widget.dart index 82aff14..5cdb0fb 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -24,12 +24,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.orange, ), ), - Text('Testing'), ], ), ), @@ -40,12 +43,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.orange, ), ), - Text('Testing'), ], ), ), @@ -56,12 +62,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.orange, ), ), - Text('Testing'), ], ), ), @@ -72,12 +81,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.orange, ), ), - Text('Testing'), ], ), ), @@ -88,12 +100,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.orange, ), ), - Text('Testing'), ], ), ), @@ -113,12 +128,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.green, ), ), - Text('Testing'), ], ), ), @@ -129,12 +147,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.green, ), ), - Text('Testing'), ], ), ), @@ -145,12 +166,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.green, ), ), - Text('Testing'), ], ), ), @@ -161,12 +185,15 @@ class _HomeState extends State{ child: Card( child: Column( children: [ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.green, ), ), - Text('Testing'), ], ), ), @@ -176,13 +203,16 @@ class _HomeState extends State{ margin: EdgeInsets.symmetric(horizontal: 10), child: Card( child: Column( - children: [ + children:[ + ListTile( + leading: FlutterLogo(), + title: Text('Testing Fancy Shit'), + ), Expanded( child: Container( color: Colors.green, ), ), - Text('Testing'), ], ), ), From 8ee6749b4748d66c3d5fd713ef627910e02d91bb Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Feb 2020 15:36:45 -0500 Subject: [PATCH 04/15] add HorizontalNewsFeed widget --- lib/home_widget.dart | 1129 ++++++++++++++++++++++-------------------- 1 file changed, 603 insertions(+), 526 deletions(-) diff --git a/lib/home_widget.dart b/lib/home_widget.dart index 5cdb0fb..f00030e 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -3,540 +3,617 @@ import 'placeholder_widget.dart'; class Home extends StatefulWidget { @override - _HomeState createState() => _HomeState(); + State createState() => TestState(); } -class _HomeState extends State{ - int _currentIndex = 0; - final List _children = [ - ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - height: 175, - margin: EdgeInsets.symmetric(vertical: 10), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.orange, - ), - ), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.orange, - ), - ), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.orange, - ), - ), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.orange, - ), - ), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.orange, - ), - ), - ], - ), - ), - ), - ], - ), - ), - Container( - height: 175, - margin: EdgeInsets.symmetric(vertical: 10), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.green, - ), - ), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.green, - ), - ), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.green, - ), - ), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.green, - ), - ), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children:[ - ListTile( - leading: FlutterLogo(), - title: Text('Testing Fancy Shit'), - ), - Expanded( - child: Container( - color: Colors.green, - ), - ), - ], - ), - ), - ), - ], - ), - ), - Container( - height: 175, - margin: EdgeInsets.symmetric(vertical: 10), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.purple, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.purple, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.purple, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.purple, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.purple, - ), - ), - Text('Testing'), - ], - ), - ), - ), - ], - ), - ), - Container( - height: 175, - margin: EdgeInsets.symmetric(vertical: 10), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.blue, ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.blue, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.blue, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.blue, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.blue, - ), - ), - Text('Testing'), - ], - ), - ), - ), - ], - ), - ), - Container( - height: 175, - margin: EdgeInsets.symmetric(vertical: 10), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.red, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.red, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.red, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.red, - ), - ), - Text('Testing'), - ], - ), - ), - ), - Container( - width: 325, - margin: EdgeInsets.symmetric(horizontal: 10), - child: Card( - child: Column( - children: [ - Expanded( - child: Container( - color: Colors.red, - ), - ), - Text('Testing'), - ], - ), - ), - ), - ], - ), - ), - - ], - ), - PlaceholderWidget(Colors.orange), - PlaceholderWidget(Colors.blue), - PlaceholderWidget(Colors.red), - PlaceholderWidget(Colors.black38), - ]; - +class TestState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text('UNCC Athletics App'), - ), - body: Container( - child: _children[_currentIndex] - ), - bottomNavigationBar: BottomNavigationBar( - type: BottomNavigationBarType.fixed, - onTap: onTabTapped, - currentIndex: _currentIndex, - items: [ - BottomNavigationBarItem( - icon: new Icon(Icons.home), - title: new Text("Home"), - ), - BottomNavigationBarItem( - icon: new Icon(Icons.calendar_today), - title: new Text("Schedule") - ), - BottomNavigationBarItem( - icon: new Icon(Icons.table_chart), - title: new Text("Scores") - ), - BottomNavigationBarItem( - icon: new Icon(Icons.assessment), - title: new Text("Standings") - ), - BottomNavigationBarItem( - icon: new Icon(Icons.more_horiz), - title: new Text("More") - ) + body: ListView( + children: [ + HorizontalNewsFeed(title: Text("Basketball")), + HorizontalNewsFeed(title: Text("Soccer")), + HorizontalNewsFeed(title: Text("Football")), ], ), + appBar: AppBar( + title: Text("u mum gay"), + ), ); } +} - void onTabTapped(int index) { - setState(() { - _currentIndex = index; - }); +class HorizontalNewsFeed extends StatelessWidget { + const HorizontalNewsFeed({ + Key key, + @required this.title, + }) : super(key: key); + + final Widget title; + + @override + Widget build(BuildContext context) { + var width = MediaQuery.of(context).size.width / 2.25; + var height = width * .6; + + return Column( + children: [ + Divider(), + ListTile( + title: title, + trailing: IconButton( + icon: Icon(Icons.navigate_next), + onPressed: () { + showDialog( + context: context, + child: Center( + child: Card( + elevation: 10, + child: Image.network( + "https://discordemoji.com/assets/emoji/ThinkNoose.png", + width: 100, + height: 100, + ), + ), + ), + ); + }, + ), + ), + Container( + height: height, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: 6, + itemBuilder: (ictx, iidx) { + return NewsCard(height: height, width: width); + }, + ), + ), + ], + ); } -} \ No newline at end of file +} + +class NewsCard extends StatelessWidget { + const NewsCard({ + Key key, + @required this.height, + @required this.width, + }) : super(key: key); + + final double height; + final double width; + + @override + Widget build(BuildContext context) { + return Container( + height: height, + width: width, + child: Card( + child: ListTile( + title: Text("no u"), + ), + ), + ); + } +} + +//class _HomeState extends State{ +// int _currentIndex = 0; +// final List _children = [ +// ListView( +// scrollDirection: Axis.vertical, +// children: [ +// Container( +// height: 175, +// margin: EdgeInsets.symmetric(vertical: 10), +// child: ListView( +// scrollDirection: Axis.horizontal, +// children: [ +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.orange, +// ), +// ), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.orange, +// ), +// ), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.orange, +// ), +// ), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.orange, +// ), +// ), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.orange, +// ), +// ), +// ], +// ), +// ), +// ), +// ], +// ), +// ), +// Container( +// height: 175, +// margin: EdgeInsets.symmetric(vertical: 10), +// child: ListView( +// scrollDirection: Axis.horizontal, +// children: [ +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.green, +// ), +// ), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.green, +// ), +// ), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.green, +// ), +// ), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.green, +// ), +// ), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children:[ +// ListTile( +// leading: FlutterLogo(), +// title: Text('Testing Fancy Shit'), +// ), +// Expanded( +// child: Container( +// color: Colors.green, +// ), +// ), +// ], +// ), +// ), +// ), +// ], +// ), +// ), +// Container( +// height: 175, +// margin: EdgeInsets.symmetric(vertical: 10), +// child: ListView( +// scrollDirection: Axis.horizontal, +// children: [ +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.purple, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.purple, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.purple, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.purple, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.purple, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// ], +// ), +// ), +// Container( +// height: 175, +// margin: EdgeInsets.symmetric(vertical: 10), +// child: ListView( +// scrollDirection: Axis.horizontal, +// children: [ +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.blue, ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.blue, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.blue, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.blue, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.blue, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// ], +// ), +// ), +// Container( +// height: 175, +// margin: EdgeInsets.symmetric(vertical: 10), +// child: ListView( +// scrollDirection: Axis.horizontal, +// children: [ +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.red, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.red, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.red, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.red, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// Container( +// width: 325, +// margin: EdgeInsets.symmetric(horizontal: 10), +// child: Card( +// child: Column( +// children: [ +// Expanded( +// child: Container( +// color: Colors.red, +// ), +// ), +// Text('Testing'), +// ], +// ), +// ), +// ), +// ], +// ), +// ), +// +// ], +// ), +// PlaceholderWidget(Colors.orange), +// PlaceholderWidget(Colors.blue), +// PlaceholderWidget(Colors.red), +// PlaceholderWidget(Colors.black38), +// ]; +// +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// appBar: AppBar( +// title: Text('UNCC Athletics App'), +// ), +// body: Container(child: _children[_currentIndex]), +// bottomNavigationBar: BottomNavigationBar( +// type: BottomNavigationBarType.fixed, +// items: [ +// BottomNavigationBarItem( +// icon: new Icon(Icons.home), +// title: new Text("Home"), +// ), +// BottomNavigationBarItem( +// icon: new Icon(Icons.calendar_today), +// title: new Text("Schedule")), +// BottomNavigationBarItem( +// icon: new Icon(Icons.table_chart), title: new Text("Scores")), +// BottomNavigationBarItem( +// icon: new Icon(Icons.assessment), title: new Text("Standings")), +// BottomNavigationBarItem( +// icon: new Icon(Icons.more_horiz), title: new Text("More")) +// ], +// ), +// ); +// } +//} From 63b244ff8680796847a2074f91d18295bcd385d2 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Feb 2020 15:38:50 -0500 Subject: [PATCH 05/15] TestState to HomeState --- lib/home_widget.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/home_widget.dart b/lib/home_widget.dart index f00030e..c2571fd 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -3,10 +3,10 @@ import 'placeholder_widget.dart'; class Home extends StatefulWidget { @override - State createState() => TestState(); + State createState() => HomeState(); } -class TestState extends State { +class HomeState extends State { @override Widget build(BuildContext context) { return Scaffold( From e9d8c3b0c1b4cf2176cf6de4e1e2027bf76f27fa Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Feb 2020 15:46:15 -0500 Subject: [PATCH 06/15] put old header and navbar back --- lib/home_widget.dart | 540 ++----------------------------------------- 1 file changed, 20 insertions(+), 520 deletions(-) diff --git a/lib/home_widget.dart b/lib/home_widget.dart index c2571fd..836765a 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -10,6 +10,9 @@ class HomeState extends State { @override Widget build(BuildContext context) { return Scaffold( + appBar: AppBar( + title: Text('UNCC Athletics App'), + ), body: ListView( children: [ HorizontalNewsFeed(title: Text("Basketball")), @@ -17,8 +20,23 @@ class HomeState extends State { HorizontalNewsFeed(title: Text("Football")), ], ), - appBar: AppBar( - title: Text("u mum gay"), + bottomNavigationBar: BottomNavigationBar( + type: BottomNavigationBarType.fixed, + items: [ + BottomNavigationBarItem( + icon: new Icon(Icons.home), + title: new Text("Home"), + ), + BottomNavigationBarItem( + icon: new Icon(Icons.calendar_today), + title: new Text("Schedule")), + BottomNavigationBarItem( + icon: new Icon(Icons.table_chart), title: new Text("Scores")), + BottomNavigationBarItem( + icon: new Icon(Icons.assessment), title: new Text("Standings")), + BottomNavigationBarItem( + icon: new Icon(Icons.more_horiz), title: new Text("More")) + ], ), ); } @@ -99,521 +117,3 @@ class NewsCard extends StatelessWidget { ); } } - -//class _HomeState extends State{ -// int _currentIndex = 0; -// final List _children = [ -// ListView( -// scrollDirection: Axis.vertical, -// children: [ -// Container( -// height: 175, -// margin: EdgeInsets.symmetric(vertical: 10), -// child: ListView( -// scrollDirection: Axis.horizontal, -// children: [ -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.orange, -// ), -// ), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.orange, -// ), -// ), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.orange, -// ), -// ), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.orange, -// ), -// ), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.orange, -// ), -// ), -// ], -// ), -// ), -// ), -// ], -// ), -// ), -// Container( -// height: 175, -// margin: EdgeInsets.symmetric(vertical: 10), -// child: ListView( -// scrollDirection: Axis.horizontal, -// children: [ -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.green, -// ), -// ), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.green, -// ), -// ), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.green, -// ), -// ), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.green, -// ), -// ), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children:[ -// ListTile( -// leading: FlutterLogo(), -// title: Text('Testing Fancy Shit'), -// ), -// Expanded( -// child: Container( -// color: Colors.green, -// ), -// ), -// ], -// ), -// ), -// ), -// ], -// ), -// ), -// Container( -// height: 175, -// margin: EdgeInsets.symmetric(vertical: 10), -// child: ListView( -// scrollDirection: Axis.horizontal, -// children: [ -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.purple, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.purple, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.purple, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.purple, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.purple, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// ], -// ), -// ), -// Container( -// height: 175, -// margin: EdgeInsets.symmetric(vertical: 10), -// child: ListView( -// scrollDirection: Axis.horizontal, -// children: [ -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.blue, ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.blue, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.blue, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.blue, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.blue, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// ], -// ), -// ), -// Container( -// height: 175, -// margin: EdgeInsets.symmetric(vertical: 10), -// child: ListView( -// scrollDirection: Axis.horizontal, -// children: [ -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.red, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.red, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.red, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.red, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// Container( -// width: 325, -// margin: EdgeInsets.symmetric(horizontal: 10), -// child: Card( -// child: Column( -// children: [ -// Expanded( -// child: Container( -// color: Colors.red, -// ), -// ), -// Text('Testing'), -// ], -// ), -// ), -// ), -// ], -// ), -// ), -// -// ], -// ), -// PlaceholderWidget(Colors.orange), -// PlaceholderWidget(Colors.blue), -// PlaceholderWidget(Colors.red), -// PlaceholderWidget(Colors.black38), -// ]; -// -// @override -// Widget build(BuildContext context) { -// return Scaffold( -// appBar: AppBar( -// title: Text('UNCC Athletics App'), -// ), -// body: Container(child: _children[_currentIndex]), -// bottomNavigationBar: BottomNavigationBar( -// type: BottomNavigationBarType.fixed, -// items: [ -// BottomNavigationBarItem( -// icon: new Icon(Icons.home), -// title: new Text("Home"), -// ), -// BottomNavigationBarItem( -// icon: new Icon(Icons.calendar_today), -// title: new Text("Schedule")), -// BottomNavigationBarItem( -// icon: new Icon(Icons.table_chart), title: new Text("Scores")), -// BottomNavigationBarItem( -// icon: new Icon(Icons.assessment), title: new Text("Standings")), -// BottomNavigationBarItem( -// icon: new Icon(Icons.more_horiz), title: new Text("More")) -// ], -// ), -// ); -// } -//} From 2104f0666bf2eb1ffc7aed545b92a5fc5a0d3614 Mon Sep 17 00:00:00 2001 From: Bnice2max <42919889+Bnice2max@users.noreply.github.com> Date: Fri, 21 Feb 2020 15:53:24 -0500 Subject: [PATCH 07/15] renamed home_widget --- lib/{home_widget2.dart => home_widget.dart} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{home_widget2.dart => home_widget.dart} (100%) diff --git a/lib/home_widget2.dart b/lib/home_widget.dart similarity index 100% rename from lib/home_widget2.dart rename to lib/home_widget.dart From df1db9f523f9c19d7ce14c176ba6ab02004e2c6e Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Feb 2020 16:23:17 -0500 Subject: [PATCH 08/15] more info on feed cards --- lib/home_widget.dart | 79 ++------------------------------------------ lib/news_feed.dart | 74 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 77 deletions(-) create mode 100644 lib/news_feed.dart diff --git a/lib/home_widget.dart b/lib/home_widget.dart index 836765a..6dc6eaf 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'placeholder_widget.dart'; +import 'news_feed.dart'; class Home extends StatefulWidget { @override @@ -18,6 +18,7 @@ class HomeState extends State { HorizontalNewsFeed(title: Text("Basketball")), HorizontalNewsFeed(title: Text("Soccer")), HorizontalNewsFeed(title: Text("Football")), + HorizontalNewsFeed(title: Text("Volleyball")), ], ), bottomNavigationBar: BottomNavigationBar( @@ -41,79 +42,3 @@ class HomeState extends State { ); } } - -class HorizontalNewsFeed extends StatelessWidget { - const HorizontalNewsFeed({ - Key key, - @required this.title, - }) : super(key: key); - - final Widget title; - - @override - Widget build(BuildContext context) { - var width = MediaQuery.of(context).size.width / 2.25; - var height = width * .6; - - return Column( - children: [ - Divider(), - ListTile( - title: title, - trailing: IconButton( - icon: Icon(Icons.navigate_next), - onPressed: () { - showDialog( - context: context, - child: Center( - child: Card( - elevation: 10, - child: Image.network( - "https://discordemoji.com/assets/emoji/ThinkNoose.png", - width: 100, - height: 100, - ), - ), - ), - ); - }, - ), - ), - Container( - height: height, - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: 6, - itemBuilder: (ictx, iidx) { - return NewsCard(height: height, width: width); - }, - ), - ), - ], - ); - } -} - -class NewsCard extends StatelessWidget { - const NewsCard({ - Key key, - @required this.height, - @required this.width, - }) : super(key: key); - - final double height; - final double width; - - @override - Widget build(BuildContext context) { - return Container( - height: height, - width: width, - child: Card( - child: ListTile( - title: Text("no u"), - ), - ), - ); - } -} diff --git a/lib/news_feed.dart b/lib/news_feed.dart new file mode 100644 index 0000000..41ab6eb --- /dev/null +++ b/lib/news_feed.dart @@ -0,0 +1,74 @@ +import 'package:flutter/material.dart'; + +class HorizontalNewsFeed extends StatelessWidget { + const HorizontalNewsFeed({ + Key key, + @required this.title, + }) : super(key: key); + + final Widget title; + + @override + Widget build(BuildContext context) { + var width = MediaQuery.of(context).size.width / 1.25; + var height = width * .6; + + return Column( + children: [ + Divider(), + ListTile( + title: title, + trailing: IconButton( + icon: Icon(Icons.navigate_next), + onPressed: () {}, + ), + ), + Container( + height: height, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: 6, + itemBuilder: (ictx, iidx) { + return NewsCard(height: height, width: width); + }, + ), + ), + ], + ); + } +} + +class NewsCard extends StatelessWidget { + const NewsCard({ + Key key, + @required this.height, + @required this.width, + }) : super(key: key); + + final double height; + final double width; + + @override + Widget build(BuildContext context) { + return SizedBox( + height: height, + width: width, + child: Card( + clipBehavior: Clip.antiAlias, + child: Wrap( + verticalDirection: VerticalDirection.up, + children: [ + ListTile( + title: Text("no u"), + trailing: Icon(Icons.more_horiz), + ), + Image.network( + "https://pbs.twimg.com/media/ERFFfZpU4AAJmIy.jpg:small", + fit: BoxFit.fitWidth, + ), + ], + ), + ), + ); + } +} From 58fa2b68380fe703a30f9ab82bc614bf2cab2259 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Feb 2020 17:14:02 -0500 Subject: [PATCH 09/15] basic api call for news feed --- lib/news_feed.dart | 81 ++++++++++++++++++++++++++++++++++++++++++---- pubspec.lock | 14 ++++++++ pubspec.yaml | 2 ++ 3 files changed, 90 insertions(+), 7 deletions(-) diff --git a/lib/news_feed.dart b/lib/news_feed.dart index 41ab6eb..0d867c3 100644 --- a/lib/news_feed.dart +++ b/lib/news_feed.dart @@ -1,4 +1,53 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; + +class Article { + final int id; + final String type; + final String sport; + final String title; + final String mediumHeadline; + final String url; + final String summary; + final String thumbUrl; + + Article( + this.id, { + this.type, + this.sport, + this.title, + this.mediumHeadline, + this.url, + this.summary, + this.thumbUrl, + }); + + factory Article.fromJson(Map json, + {String root = 'https://www.ncaa.com'}) { + return Article( + json['id'], + type: json['type'], + sport: json['sport'], + title: json['title'], + mediumHeadline: json['medium_headline'], + url: json['url'], + summary: json['summary'], + thumbUrl: json['thumb']['url'], + ); + } +} + +class Feed { + Future> getPage(int page, {int size = 10}) async { + var url = + 'https://www.ncaa.com/ncaa/cobra/school-content/charlotte,$page,$size'; + http.Response response = await http.get(url); + Iterable articles = json.decode(response.body); + return articles.map((e) => Article.fromJson(e)).toList(); + } +} class HorizontalNewsFeed extends StatelessWidget { const HorizontalNewsFeed({ @@ -13,6 +62,8 @@ class HorizontalNewsFeed extends StatelessWidget { var width = MediaQuery.of(context).size.width / 1.25; var height = width * .6; + var feed = Feed(); + return Column( children: [ Divider(), @@ -25,11 +76,25 @@ class HorizontalNewsFeed extends StatelessWidget { ), Container( height: height, - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: 6, - itemBuilder: (ictx, iidx) { - return NewsCard(height: height, width: width); + child: FutureBuilder( + future: feed.getPage(1), + builder: (ctx, snapshot) { + if (!snapshot.hasData) { + return Center(child: CircularProgressIndicator()); + } else { + List
articles = snapshot.data; + return ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: articles.length, + itemBuilder: (ctx, idx) { + return NewsCard( + article: articles[idx], + height: height, + width: width, + ); + }, + ); + } }, ), ), @@ -41,10 +106,12 @@ class HorizontalNewsFeed extends StatelessWidget { class NewsCard extends StatelessWidget { const NewsCard({ Key key, + @required this.article, @required this.height, @required this.width, }) : super(key: key); + final Article article; final double height; final double width; @@ -59,11 +126,11 @@ class NewsCard extends StatelessWidget { verticalDirection: VerticalDirection.up, children: [ ListTile( - title: Text("no u"), + title: Text(article.title), trailing: Icon(Icons.more_horiz), ), Image.network( - "https://pbs.twimg.com/media/ERFFfZpU4AAJmIy.jpg:small", + article.thumbUrl, fit: BoxFit.fitWidth, ), ], diff --git a/pubspec.lock b/pubspec.lock index fcf6763..dd132b2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -74,6 +74,20 @@ packages: description: flutter source: sdk version: "0.0.0" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0+4" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.3" image: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 958dc91..5d4a329 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,6 +20,8 @@ dependencies: flutter: sdk: flutter + http: ^0.12.0+4 + # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 From bc2d0ef6c262e83b65408a92921291dd14d4f427 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 21 Feb 2020 17:25:21 -0500 Subject: [PATCH 10/15] break news features apart into separate files --- lib/home_widget.dart | 12 ++-- lib/news/article.dart | 74 +++++++++++++++++++++++ lib/{news_feed.dart => news/feed.dart} | 83 ++------------------------ lib/placeholder_widget.dart | 9 --- 4 files changed, 87 insertions(+), 91 deletions(-) create mode 100644 lib/news/article.dart rename lib/{news_feed.dart => news/feed.dart} (51%) delete mode 100644 lib/placeholder_widget.dart diff --git a/lib/home_widget.dart b/lib/home_widget.dart index 6dc6eaf..546016c 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'news_feed.dart'; +import 'news/feed.dart'; class Home extends StatefulWidget { @override @@ -9,16 +9,18 @@ class Home extends StatefulWidget { class HomeState extends State { @override Widget build(BuildContext context) { + var feed = Feed(); + return Scaffold( appBar: AppBar( title: Text('UNCC Athletics App'), ), body: ListView( children: [ - HorizontalNewsFeed(title: Text("Basketball")), - HorizontalNewsFeed(title: Text("Soccer")), - HorizontalNewsFeed(title: Text("Football")), - HorizontalNewsFeed(title: Text("Volleyball")), + HorizontalNewsFeed(newsFeed: feed, title: Text("Basketball")), + HorizontalNewsFeed(newsFeed: feed, title: Text("Soccer")), + HorizontalNewsFeed(newsFeed: feed, title: Text("Football")), + HorizontalNewsFeed(newsFeed: feed, title: Text("Volleyball")), ], ), bottomNavigationBar: BottomNavigationBar( diff --git a/lib/news/article.dart b/lib/news/article.dart new file mode 100644 index 0000000..1e920b1 --- /dev/null +++ b/lib/news/article.dart @@ -0,0 +1,74 @@ +import 'package:flutter/material.dart'; + +class Article { + final int id; + final String type; + final String sport; + final String title; + final String mediumHeadline; + final String url; + final String summary; + final String thumbUrl; + + Article( + this.id, { + this.type, + this.sport, + this.title, + this.mediumHeadline, + this.url, + this.summary, + this.thumbUrl, + }); + + factory Article.fromJson(Map json, + {String root = 'https://www.ncaa.com'}) { + return Article( + json['id'], + type: json['type'], + sport: json['sport'], + title: json['title'], + mediumHeadline: json['medium_headline'], + url: json['url'], + summary: json['summary'], + thumbUrl: json['thumb']['url'], + ); + } +} + +class ArticleCard extends StatelessWidget { + const ArticleCard({ + Key key, + @required this.article, + @required this.height, + @required this.width, + }) : super(key: key); + + final Article article; + final double height; + final double width; + + @override + Widget build(BuildContext context) { + return SizedBox( + height: height, + width: width, + child: Card( + clipBehavior: Clip.antiAlias, + child: Wrap( + verticalDirection: VerticalDirection.up, + children: [ + ListTile( + title: Text(article.title), + trailing: Icon(Icons.more_horiz), + ), + Image.network( + article.thumbUrl, + fit: BoxFit.fitWidth, + ), + ], + ), + ), + ); + } +} diff --git a/lib/news_feed.dart b/lib/news/feed.dart similarity index 51% rename from lib/news_feed.dart rename to lib/news/feed.dart index 0d867c3..5c34582 100644 --- a/lib/news_feed.dart +++ b/lib/news/feed.dart @@ -1,43 +1,9 @@ -import 'dart:convert'; - import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; -class Article { - final int id; - final String type; - final String sport; - final String title; - final String mediumHeadline; - final String url; - final String summary; - final String thumbUrl; +import 'dart:convert'; - Article( - this.id, { - this.type, - this.sport, - this.title, - this.mediumHeadline, - this.url, - this.summary, - this.thumbUrl, - }); - - factory Article.fromJson(Map json, - {String root = 'https://www.ncaa.com'}) { - return Article( - json['id'], - type: json['type'], - sport: json['sport'], - title: json['title'], - mediumHeadline: json['medium_headline'], - url: json['url'], - summary: json['summary'], - thumbUrl: json['thumb']['url'], - ); - } -} +import 'article.dart'; class Feed { Future> getPage(int page, {int size = 10}) async { @@ -52,9 +18,11 @@ class Feed { class HorizontalNewsFeed extends StatelessWidget { const HorizontalNewsFeed({ Key key, + @required this.newsFeed, @required this.title, }) : super(key: key); + final Feed newsFeed; final Widget title; @override @@ -62,8 +30,6 @@ class HorizontalNewsFeed extends StatelessWidget { var width = MediaQuery.of(context).size.width / 1.25; var height = width * .6; - var feed = Feed(); - return Column( children: [ Divider(), @@ -77,7 +43,7 @@ class HorizontalNewsFeed extends StatelessWidget { Container( height: height, child: FutureBuilder( - future: feed.getPage(1), + future: newsFeed.getPage(1), builder: (ctx, snapshot) { if (!snapshot.hasData) { return Center(child: CircularProgressIndicator()); @@ -87,7 +53,7 @@ class HorizontalNewsFeed extends StatelessWidget { scrollDirection: Axis.horizontal, itemCount: articles.length, itemBuilder: (ctx, idx) { - return NewsCard( + return ArticleCard( article: articles[idx], height: height, width: width, @@ -102,40 +68,3 @@ class HorizontalNewsFeed extends StatelessWidget { ); } } - -class NewsCard extends StatelessWidget { - const NewsCard({ - Key key, - @required this.article, - @required this.height, - @required this.width, - }) : super(key: key); - - final Article article; - final double height; - final double width; - - @override - Widget build(BuildContext context) { - return SizedBox( - height: height, - width: width, - child: Card( - clipBehavior: Clip.antiAlias, - child: Wrap( - verticalDirection: VerticalDirection.up, - children: [ - ListTile( - title: Text(article.title), - trailing: Icon(Icons.more_horiz), - ), - Image.network( - article.thumbUrl, - fit: BoxFit.fitWidth, - ), - ], - ), - ), - ); - } -} diff --git a/lib/placeholder_widget.dart b/lib/placeholder_widget.dart deleted file mode 100644 index 10b8eb6..0000000 --- a/lib/placeholder_widget.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:flutter/material.dart'; - -class PlaceholderWidget extends StatelessWidget{ - final Color color; - PlaceholderWidget(this.color); - - @override - Widget build(BuildContext context) => Container(color: color,); -} \ No newline at end of file From 548e590b12f2db6ea536eb153165de6edb9d7664 Mon Sep 17 00:00:00 2001 From: David Allemang Date: Thu, 27 Feb 2020 00:05:43 -0500 Subject: [PATCH 11/15] better widgets --- lib/news/article.dart | 77 +++++++++++++++++++++++---------------- lib/news/feed.dart | 84 ++++++++++++++++++++++--------------------- 2 files changed, 91 insertions(+), 70 deletions(-) diff --git a/lib/news/article.dart b/lib/news/article.dart index 1e920b1..4acc3a5 100644 --- a/lib/news/article.dart +++ b/lib/news/article.dart @@ -11,18 +11,17 @@ class Article { final String thumbUrl; Article( - this.id, { - this.type, - this.sport, - this.title, - this.mediumHeadline, - this.url, - this.summary, - this.thumbUrl, - }); + this.id, { + this.type, + this.sport, + this.title, + this.mediumHeadline, + this.url, + this.summary, + this.thumbUrl, + }); - factory Article.fromJson(Map json, - {String root = 'https://www.ncaa.com'}) { + factory Article.fromJson(Map json) { return Article( json['id'], type: json['type'], @@ -40,33 +39,51 @@ class ArticleCard extends StatelessWidget { const ArticleCard({ Key key, @required this.article, - @required this.height, - @required this.width, + this.numCards = 1.25, }) : super(key: key); final Article article; - final double height; - final double width; + final double numCards; + + double widthIn(BuildContext context) { + return MediaQuery.of(context).size.width / numCards; + } @override Widget build(BuildContext context) { + var decoration = BoxDecoration( + image: DecorationImage( + image: NetworkImage( + article.thumbUrl, + ), + fit: BoxFit.cover, + ), + ); + + var body = Column( + verticalDirection: VerticalDirection.up, + children: [ + Container( + color: Colors.white, + child: ListTile( + title: Text( + article.mediumHeadline, + overflow: TextOverflow.ellipsis, + maxLines: 2, + ), + ), + ), + ], + ); + return SizedBox( - height: height, - width: width, + width: widthIn(context), child: Card( - clipBehavior: Clip.antiAlias, - child: Wrap( - verticalDirection: VerticalDirection.up, - children: [ - ListTile( - title: Text(article.title), - trailing: Icon(Icons.more_horiz), - ), - Image.network( - article.thumbUrl, - fit: BoxFit.fitWidth, - ), - ], + semanticContainer: true, + clipBehavior: Clip.antiAliasWithSaveLayer, + child: Container( + decoration: decoration, + child: body, ), ), ); diff --git a/lib/news/feed.dart b/lib/news/feed.dart index 5c34582..f7faa62 100644 --- a/lib/news/feed.dart +++ b/lib/news/feed.dart @@ -6,9 +6,10 @@ import 'dart:convert'; import 'article.dart'; class Feed { + static final cobraBase = "https://www.ncaa.com/ncaa/cobra"; + Future> getPage(int page, {int size = 10}) async { - var url = - 'https://www.ncaa.com/ncaa/cobra/school-content/charlotte,$page,$size'; + var url = '$cobraBase/school-content/charlotte,$page,$size'; http.Response response = await http.get(url); Iterable articles = json.decode(response.body); return articles.map((e) => Article.fromJson(e)).toList(); @@ -16,55 +17,58 @@ class Feed { } class HorizontalNewsFeed extends StatelessWidget { + final Feed newsFeed; + final Widget title; + final double numCards; + const HorizontalNewsFeed({ Key key, @required this.newsFeed, @required this.title, + this.numCards = 3.25, }) : super(key: key); - final Feed newsFeed; - final Widget title; + double heightIn(BuildContext context) { + return MediaQuery.of(context).size.height / numCards; + } @override Widget build(BuildContext context) { - var width = MediaQuery.of(context).size.width / 1.25; - var height = width * .6; - - return Column( - children: [ - Divider(), - ListTile( - title: title, - trailing: IconButton( - icon: Icon(Icons.navigate_next), - onPressed: () {}, + return SizedBox( + height: heightIn(context), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ListTile( + title: title, + trailing: IconButton( + icon: Icon(Icons.navigate_next), + onPressed: () {}, + ), ), - ), - Container( - height: height, - child: FutureBuilder( - future: newsFeed.getPage(1), - builder: (ctx, snapshot) { - if (!snapshot.hasData) { - return Center(child: CircularProgressIndicator()); - } else { - List
articles = snapshot.data; - return ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: articles.length, - itemBuilder: (ctx, idx) { - return ArticleCard( - article: articles[idx], - height: height, - width: width, - ); - }, - ); - } - }, + Expanded( + child: FutureBuilder( + future: newsFeed.getPage(1), + builder: (ctx, snapshot) { + if (!snapshot.hasData) { + return Center(child: CircularProgressIndicator()); + } else { + List
articles = snapshot.data; + return ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: articles.length, + itemBuilder: (ctx, idx) { + return ArticleCard( + article: articles[idx], + ); + }, + ); + } + }, + ), ), - ), - ], + ], + ), ); } } From 687d90b36bf8a9fb17c72ce4346d64c4d7c906f5 Mon Sep 17 00:00:00 2001 From: David Allemang Date: Thu, 27 Feb 2020 00:11:26 -0500 Subject: [PATCH 12/15] fix gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ae1f183..6d517b3 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ lib/generated_plugin_registrant.dart # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + +android/app/src/*/gen From 14e3459894ef4d4a2366fc324073890e0b645cdc Mon Sep 17 00:00:00 2001 From: David Allemang Date: Thu, 27 Feb 2020 00:16:44 -0500 Subject: [PATCH 13/15] add missing parts from merge --- lib/home_widget.dart | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/home_widget.dart b/lib/home_widget.dart index 76b85b7..8310fd0 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -10,13 +10,7 @@ class Home extends StatelessWidget { const Item('Baseball', Colors.yellow), ]; - final List _children = [ - PlaceholderWidget(Colors.white), - PlaceholderWidget(Colors.orange), - PlaceholderWidget(Colors.blue), - PlaceholderWidget(Colors.red), - PlaceholderWidget(Colors.black38), - ]; + var feed = Feed(); @override Widget build(BuildContext context) { From f013d1b8802ba23e877b1390d85ebfeff791a095 Mon Sep 17 00:00:00 2001 From: David Allemang Date: Thu, 27 Feb 2020 00:18:34 -0500 Subject: [PATCH 14/15] reformat --- lib/home_widget.dart | 123 +++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/lib/home_widget.dart b/lib/home_widget.dart index 8310fd0..62dadb4 100644 --- a/lib/home_widget.dart +++ b/lib/home_widget.dart @@ -18,69 +18,68 @@ class Home extends StatelessWidget { 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(), + 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), ), - backgroundColor: _curSport[1], - ), - body: ListView( - children: [ - HorizontalNewsFeed(newsFeed: feed, title: Text("Basketball")), - HorizontalNewsFeed(newsFeed: feed, title: Text("Soccer")), - HorizontalNewsFeed(newsFeed: feed, title: Text("Football")), - HorizontalNewsFeed(newsFeed: feed, title: Text("Volleyball")), - ], - ), - bottomNavigationBar: BottomNavigationBar( - type: BottomNavigationBarType.fixed, - onTap: (int index) { - setState(() { - _currentBodyIndex = index; - }); - }, - currentIndex: _currentBodyIndex, - items: [ - BottomNavigationBarItem( - icon: new Icon(Icons.home), - title: new Text("Home"), - ), - BottomNavigationBarItem( - icon: new Icon(Icons.calendar_today), - title: new Text("Schedule")), - BottomNavigationBarItem( - icon: new Icon(Icons.table_chart), - title: new Text("Scores")), - BottomNavigationBarItem( - icon: new Icon(Icons.assessment), - title: new Text("Standings")), - BottomNavigationBarItem( - icon: new Icon(Icons.more_horiz), title: new Text("More")) - ], - ), - )); + ); + }).toList(), + ), + backgroundColor: _curSport[1], + ), + body: ListView( + children: [ + HorizontalNewsFeed(newsFeed: feed, title: Text("Basketball")), + HorizontalNewsFeed(newsFeed: feed, title: Text("Soccer")), + HorizontalNewsFeed(newsFeed: feed, title: Text("Football")), + HorizontalNewsFeed(newsFeed: feed, title: Text("Volleyball")), + ], + ), + bottomNavigationBar: BottomNavigationBar( + type: BottomNavigationBarType.fixed, + onTap: (int index) { + setState(() { + _currentBodyIndex = index; + }); + }, + currentIndex: _currentBodyIndex, + items: [ + BottomNavigationBarItem( + icon: new Icon(Icons.home), + title: new Text("Home"), + ), + BottomNavigationBarItem( + icon: new Icon(Icons.calendar_today), + title: new Text("Schedule")), + BottomNavigationBarItem( + icon: new Icon(Icons.table_chart), title: new Text("Scores")), + BottomNavigationBarItem( + icon: new Icon(Icons.assessment), title: new Text("Standings")), + BottomNavigationBarItem( + icon: new Icon(Icons.more_horiz), title: new Text("More")) + ], + ), + ), + ); } } From 1080cb84cb36228358fcb842306ef30dada233a9 Mon Sep 17 00:00:00 2001 From: David Allemang Date: Thu, 27 Feb 2020 00:23:32 -0500 Subject: [PATCH 15/15] tweak gitignore per https://github.com/flutter/flutter/issues/13892 --- .gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6d517b3..07e7c4e 100644 --- a/.gitignore +++ b/.gitignore @@ -30,10 +30,12 @@ .pub/ /build/ +gen/ +bin/ +out/ + # Web related lib/generated_plugin_registrant.dart # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages - -android/app/src/*/gen