From 19693b5ae08bf4ef1da5ac644bb82387ce00cba5 Mon Sep 17 00:00:00 2001 From: lakshan Date: Sun, 20 Oct 2019 22:46:02 +0530 Subject: [PATCH 1/3] Events page completed --- ios/Flutter/flutter_export_environment.sh | 10 +-- lib/constants/test_data.dart | 20 +++++ lib/ui/pages/event.dart | 98 +++++++++++++++++------ lib/ui/pages/home.dart | 2 +- 4 files changed, 101 insertions(+), 29 deletions(-) diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh index 760bfba..b997bdc 100755 --- a/ios/Flutter/flutter_export_environment.sh +++ b/ios/Flutter/flutter_export_environment.sh @@ -1,10 +1,10 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/suvink/Documents/Installed Software/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/suvink/Documents/Workspace/EF/everything-flutter" -export "FLUTTER_TARGET=/Users/suvink/Documents/Workspace/EF/everything-flutter/lib/main.dart" +export "FLUTTER_ROOT=C:\src\flutter\flutter" +export "FLUTTER_APPLICATION_PATH=C:\Users\ASUS\Documents\flutter\everything-flutter" +export "FLUTTER_TARGET=lib\main.dart" export "FLUTTER_BUILD_DIR=build" -export "SYMROOT=${SOURCE_ROOT}/../build/ios" -export "FLUTTER_FRAMEWORK_DIR=/Users/suvink/Documents/Installed Software/flutter/bin/cache/artifacts/engine/ios" +export "SYMROOT=${SOURCE_ROOT}/../build\ios" +export "FLUTTER_FRAMEWORK_DIR=C:\src\flutter\flutter\bin\cache\artifacts\engine\ios" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" diff --git a/lib/constants/test_data.dart b/lib/constants/test_data.dart index 2d35c70..82bc445 100644 --- a/lib/constants/test_data.dart +++ b/lib/constants/test_data.dart @@ -25,3 +25,23 @@ News newsItemThree = News( image: "https://cdn.iconicto.com/EverythingFlutter/media/News/ef3.jpg", source: Source(name: "Techcrunch"), ); + +//past news +News pastnewsItemone = News( + title: "Flutter Meetup", + time: DateTime.parse("2019-05-30T22:49:51.764000+05:30"), + link: + "www.example.com", + image: "https://maps.googleapis.com/maps/api/staticmap?markers=size:tiny|-15.78,-47.91|50.06,19.96|60.17,24.94|1.300,103.8|30.22,-97.75|52.26,21.02|39.69,-104.9|55.58,9.760|38.83,-77.34|53.43,14.53|33.45,-112.1|42.35,-83.06|51.11,17.03|41.89,-87.64|43.65,-79.38|42.69,23.31|48.16,17.13|-37.81,145.0|-27.46,153.0|18.53,73.84|4.630,-74.09|37.56,127.0|3.160,101.7|23.61,58.54|48.14,11.58|49.00,8.400|45.80,15.97|-6.860,109.1|38.96,-77.23|51.24,6.790|52.40,16.90|33.37,6.860|43.17,-77.60|44.44,26.10|58.97,5.710|43.74,-79.36|40.11,-82.91|46.86,-114.0|12.97,77.56|39.75,-105.0|26.47,80.33|-8.080,-34.92|49.84,24.03|51.44,5.470|51.52,-0.1000|-30.04,-51.22|48.36,10.89|26.92,75.80|-22.91,-47.08|42.36,-71.07|43.58,39.74|35.23,-80.84|53.15,8.210|40.04,-105.3|40.75,-73.99|31.22,29.95|-33.93,18.46|36.19,44.02|54.81,56.07|31.33,75.57|34.15,-118.5|14.08,-87.22|59.91,10.75|33.65,-117.8|-27.60,-48.54|50.12,8.680|48.86,2.340|43.62,1.450|-16.50,-68.15|40.78,43.83|-8.580,116.1|54.32,10.12|50.08,14.43|48.22,16.37|49.87,8.640|49.80,9.940|-34.93,138.6|55.71,13.20|38.72,-9.140|48.11,-1.680|53.23,6.570|27.96,-82.46|-34.61,-58.37|-19.92,-43.94|51.77,19.46|39.70,-105.1|36.72,-4.420|35.67,139.8|41.32,-81.55|33.88,35.50|24.65,46.77|6.250,-75.59|44.83,20.50|50.00,8.260|54.36,18.64|22.57,88.36|37.98,23.73|50.88,4.700|-33.87,151.2|49.28,-123.0|6.520,3.300|13.09,80.27|23.03,72.58|51.72,39.26|36.19,5.410|67.29,14.37|53.55,10.00|33.52,-111.9|-31.40,-64.19|41.40,2.170|-1.940,30.06|9.600,6.550|52.37,4.890|51.50,7.630|48.79,9.190|49.45,11.05|-36.85,174.8|59.33,18.07|40.05,-105.2|-31.96,115.8|-7.230,-35.88|53.33,-6.250|14.62,121.0|42.47,-83.40|33.72,73.06|47.51,19.08|47.38,8.540|52.21,0.1300|-12.07,-77.05|50.64,3.070|45.65,-73.50|45.45,-75.69|18.46,-66.11|-6.910,107.6|-23.53,-46.63|32.07,34.77|46.52,6.620|29.72,-95.22|19.43,-99.14|-33.46,-70.64|52.52,13.38|37.35,-122.0&size=600x300&style=feature:administrative%7Cvisibility:off&style=feature:landscape%7Ccolor:0xffffff&style=feature:landscape%7Celement:labels%7Cvisibility:off&style=feature:landscape.man_made%7Celement:geometry%7Ccolor:0xffffff&style=feature:poi%7Cvisibility:off&style=feature:road%7Cvisibility:off&style=feature:transit%7Cvisibility:off&style=feature:water%7Ccolor:0xabd7df&scale=2&zoom=1&key=AIzaSyDmnawK5g8z5vh2itc7Qou7STaVkxocOtU", + source: Source(name: "READ MORE"), +); + + +News pastnewsItemtwo = News( + title: "Introduction To Flutter", + time: DateTime.parse("2019-04-20T22:49:51.764000+05:30"), + link: + "www.example.com", + image: "https://i.ytimg.com/vi/zmBvPcEjetA/maxresdefault.jpg", + source: Source(name: "READ MORE"), +); diff --git a/lib/ui/pages/event.dart b/lib/ui/pages/event.dart index d8508ff..e615642 100644 --- a/lib/ui/pages/event.dart +++ b/lib/ui/pages/event.dart @@ -2,11 +2,15 @@ import 'package:everything_flutter/constants/strings.dart'; import 'package:everything_flutter/constants/text_styles.dart'; import 'package:everything_flutter/constants/theme_data.dart'; import 'package:everything_flutter/helpers/screen_util.dart'; +import 'package:everything_flutter/model/news.dart'; import 'package:everything_flutter/ui/widgets/menu_card.dart'; +import 'package:everything_flutter/ui/widgets/news_item.dart'; import 'package:flutter/material.dart'; import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:intl/intl.dart'; import 'package:snaplist/snaplist.dart'; +import 'package:everything_flutter/constants/test_data.dart'; + class EventPage extends StatelessWidget { @override @@ -18,6 +22,8 @@ class EventPage extends StatelessWidget { } } + + @widget Widget _buildBody() => SafeArea( child: SingleChildScrollView( @@ -25,11 +31,49 @@ Widget _buildBody() => SafeArea( children: [ _eventsTitle, _buildMenuCards(), + _buildPastEventBar(), + _buildEvents(events) ], ), ), ); +@widget + Widget _buildPastEventBar() => Padding( + padding: ScreenUtil.getPaddingLTRB(4, 2, 4, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Past Events", + style: TextStyles.miniTitle, + ), + // GestureDetector( + // onTap : () { + // _scaffoldKey.currentState.openDrawer(); // CHANGE THIS LINE + // }, + // child: Icon( + // Icons.more_vert, + // size: ScreenUtil.getFullScreen(12), + // ), + // ), + ], + ), + ); + +List events = [pastnewsItemone, pastnewsItemtwo]; + + +@widget +Widget _buildEvents(List newsList) { + List _columnItems = []; + for (var news in newsList) { + _columnItems.add(NewsItem(news)); +// _columnItems.add(Divider()); + } + return Column(children: _columnItems); +} + @widget Container _buildMenuCards() => Container( height: ScreenUtil.getHeight(35), @@ -74,31 +118,39 @@ Container _buildMenuCards() => Container( ), ), SizedBox(height: ScreenUtil.getHeight(0.5)), - Align( - alignment: Alignment.bottomRight, - child: GestureDetector( - onTap: () => - Navigator.pushNamed(context, menuCardTitles[index]), - child: Container( - padding: ScreenUtil.getPaddingAll(8), - decoration: BoxDecoration( - borderRadius: - ScreenUtil.getBorderRadiusCircular(12), - color: AppColors.buttonColors[index], - boxShadow: [ - new BoxShadow( - color: AppColors.buttonColors[index], - blurRadius: 8.0, - ), - ], - ), - child: Icon( - Icons.arrow_forward_ios, - size: ScreenUtil.getTextSize(12), - color: Colors.white, + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + GestureDetector( + onTap: () => Navigator.pushNamed( + context, menuCardTitles[index]), + child: Container( + padding: ScreenUtil.getPaddingAll(8), + decoration: BoxDecoration( + borderRadius: + ScreenUtil.getBorderRadiusCircular(12), + color: AppColors.buttonColors[index], + boxShadow: [ + new BoxShadow( + color: AppColors.buttonColors[index], + blurRadius: 8.0, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Text("View",style: TextStyle(fontSize: ScreenUtil.getTextSize(11)),), + Icon( + Icons.arrow_forward_ios, + size: ScreenUtil.getTextSize(13), + color: Colors.white, + ), + ], + ), ), ), - ), + ], ), ], ), diff --git a/lib/ui/pages/home.dart b/lib/ui/pages/home.dart index 97bc760..167d8b8 100644 --- a/lib/ui/pages/home.dart +++ b/lib/ui/pages/home.dart @@ -78,7 +78,7 @@ class _HomePageState extends State { ); } -List news = [newsItem, newsItemTwo]; +List news = [newsItem, newsItemTwo,newsItemThree]; final _timelineTitle = Text( From 804cbc46b7df181c6a8d2957118aad3df4587a07 Mon Sep 17 00:00:00 2001 From: lakshan Date: Mon, 21 Oct 2019 16:58:19 +0530 Subject: [PATCH 2/3] Events page added --- lib/constants/test_data.dart | 17 ++++++++++++++--- lib/model/event.dart | 7 ++++++- lib/ui/pages/event.dart | 6 +++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/constants/test_data.dart b/lib/constants/test_data.dart index 82bc445..9d925c5 100644 --- a/lib/constants/test_data.dart +++ b/lib/constants/test_data.dart @@ -26,8 +26,8 @@ News newsItemThree = News( source: Source(name: "Techcrunch"), ); -//past news -News pastnewsItemone = News( +//past events +News pasteventsItemone = News( title: "Flutter Meetup", time: DateTime.parse("2019-05-30T22:49:51.764000+05:30"), link: @@ -37,7 +37,7 @@ News pastnewsItemone = News( ); -News pastnewsItemtwo = News( +News pasteventItemtwo = News( title: "Introduction To Flutter", time: DateTime.parse("2019-04-20T22:49:51.764000+05:30"), link: @@ -45,3 +45,14 @@ News pastnewsItemtwo = News( image: "https://i.ytimg.com/vi/zmBvPcEjetA/maxresdefault.jpg", source: Source(name: "READ MORE"), ); + + +//widgets +News widget1 = News( + title: "Flutter Meetup", + time: DateTime.parse("2019-05-30T22:49:51.764000+05:30"), + link: + "www.example.com", + image: "https://maps.googleapis.com/maps/api/staticmap?markers=size:tiny|-15.78,-47.91|50.06,19.96|60.17,24.94|1.300,103.8|30.22,-97.75|52.26,21.02|39.69,-104.9|55.58,9.760|38.83,-77.34|53.43,14.53|33.45,-112.1|42.35,-83.06|51.11,17.03|41.89,-87.64|43.65,-79.38|42.69,23.31|48.16,17.13|-37.81,145.0|-27.46,153.0|18.53,73.84|4.630,-74.09|37.56,127.0|3.160,101.7|23.61,58.54|48.14,11.58|49.00,8.400|45.80,15.97|-6.860,109.1|38.96,-77.23|51.24,6.790|52.40,16.90|33.37,6.860|43.17,-77.60|44.44,26.10|58.97,5.710|43.74,-79.36|40.11,-82.91|46.86,-114.0|12.97,77.56|39.75,-105.0|26.47,80.33|-8.080,-34.92|49.84,24.03|51.44,5.470|51.52,-0.1000|-30.04,-51.22|48.36,10.89|26.92,75.80|-22.91,-47.08|42.36,-71.07|43.58,39.74|35.23,-80.84|53.15,8.210|40.04,-105.3|40.75,-73.99|31.22,29.95|-33.93,18.46|36.19,44.02|54.81,56.07|31.33,75.57|34.15,-118.5|14.08,-87.22|59.91,10.75|33.65,-117.8|-27.60,-48.54|50.12,8.680|48.86,2.340|43.62,1.450|-16.50,-68.15|40.78,43.83|-8.580,116.1|54.32,10.12|50.08,14.43|48.22,16.37|49.87,8.640|49.80,9.940|-34.93,138.6|55.71,13.20|38.72,-9.140|48.11,-1.680|53.23,6.570|27.96,-82.46|-34.61,-58.37|-19.92,-43.94|51.77,19.46|39.70,-105.1|36.72,-4.420|35.67,139.8|41.32,-81.55|33.88,35.50|24.65,46.77|6.250,-75.59|44.83,20.50|50.00,8.260|54.36,18.64|22.57,88.36|37.98,23.73|50.88,4.700|-33.87,151.2|49.28,-123.0|6.520,3.300|13.09,80.27|23.03,72.58|51.72,39.26|36.19,5.410|67.29,14.37|53.55,10.00|33.52,-111.9|-31.40,-64.19|41.40,2.170|-1.940,30.06|9.600,6.550|52.37,4.890|51.50,7.630|48.79,9.190|49.45,11.05|-36.85,174.8|59.33,18.07|40.05,-105.2|-31.96,115.8|-7.230,-35.88|53.33,-6.250|14.62,121.0|42.47,-83.40|33.72,73.06|47.51,19.08|47.38,8.540|52.21,0.1300|-12.07,-77.05|50.64,3.070|45.65,-73.50|45.45,-75.69|18.46,-66.11|-6.910,107.6|-23.53,-46.63|32.07,34.77|46.52,6.620|29.72,-95.22|19.43,-99.14|-33.46,-70.64|52.52,13.38|37.35,-122.0&size=600x300&style=feature:administrative%7Cvisibility:off&style=feature:landscape%7Ccolor:0xffffff&style=feature:landscape%7Celement:labels%7Cvisibility:off&style=feature:landscape.man_made%7Celement:geometry%7Ccolor:0xffffff&style=feature:poi%7Cvisibility:off&style=feature:road%7Cvisibility:off&style=feature:transit%7Cvisibility:off&style=feature:water%7Ccolor:0xabd7df&scale=2&zoom=1&key=AIzaSyDmnawK5g8z5vh2itc7Qou7STaVkxocOtU", + source: Source(name: "READ MORE"), +); diff --git a/lib/model/event.dart b/lib/model/event.dart index 61a42e7..b504968 100644 --- a/lib/model/event.dart +++ b/lib/model/event.dart @@ -1 +1,6 @@ -class Event {} +import 'dart:convert'; + + + +class Event { +} diff --git a/lib/ui/pages/event.dart b/lib/ui/pages/event.dart index e615642..d734a25 100644 --- a/lib/ui/pages/event.dart +++ b/lib/ui/pages/event.dart @@ -61,14 +61,14 @@ Widget _buildBody() => SafeArea( ), ); -List events = [pastnewsItemone, pastnewsItemtwo]; +List events = [pasteventItemtwo, pasteventItemtwo]; @widget Widget _buildEvents(List newsList) { List _columnItems = []; - for (var news in newsList) { - _columnItems.add(NewsItem(news)); + for (var event in newsList) { + _columnItems.add(NewsItem(event)); // _columnItems.add(Divider()); } return Column(children: _columnItems); From 3501576d5082bd3ff96d484c3cd9522ea20f3527 Mon Sep 17 00:00:00 2001 From: lakshan Date: Mon, 21 Oct 2019 21:24:13 +0530 Subject: [PATCH 3/3] Widgets page added --- lib/constants/strings.dart | 12 +++ lib/constants/test_data.dart | 15 ++- lib/ui/pages/widget.dart | 201 ++++++++++++++++++++++++++++++++++- 3 files changed, 223 insertions(+), 5 deletions(-) diff --git a/lib/constants/strings.dart b/lib/constants/strings.dart index 248bca7..eb8832b 100644 --- a/lib/constants/strings.dart +++ b/lib/constants/strings.dart @@ -25,4 +25,16 @@ List eventCardSubtitles = [ "First Flutter Meetup", "First Flutter Hackathon", "First Flutter Hackathon", +]; + +List widgetDays=[ + "WednesDay", + "TuesDay", + "Monday", +]; + +List widgetNames=[ + "Animated Builder", + "ClipRRect", + "Silver List", ]; \ No newline at end of file diff --git a/lib/constants/test_data.dart b/lib/constants/test_data.dart index 9d925c5..f9e4ae0 100644 --- a/lib/constants/test_data.dart +++ b/lib/constants/test_data.dart @@ -49,10 +49,19 @@ News pasteventItemtwo = News( //widgets News widget1 = News( - title: "Flutter Meetup", + title: "Scaffold", time: DateTime.parse("2019-05-30T22:49:51.764000+05:30"), link: - "www.example.com", - image: "https://maps.googleapis.com/maps/api/staticmap?markers=size:tiny|-15.78,-47.91|50.06,19.96|60.17,24.94|1.300,103.8|30.22,-97.75|52.26,21.02|39.69,-104.9|55.58,9.760|38.83,-77.34|53.43,14.53|33.45,-112.1|42.35,-83.06|51.11,17.03|41.89,-87.64|43.65,-79.38|42.69,23.31|48.16,17.13|-37.81,145.0|-27.46,153.0|18.53,73.84|4.630,-74.09|37.56,127.0|3.160,101.7|23.61,58.54|48.14,11.58|49.00,8.400|45.80,15.97|-6.860,109.1|38.96,-77.23|51.24,6.790|52.40,16.90|33.37,6.860|43.17,-77.60|44.44,26.10|58.97,5.710|43.74,-79.36|40.11,-82.91|46.86,-114.0|12.97,77.56|39.75,-105.0|26.47,80.33|-8.080,-34.92|49.84,24.03|51.44,5.470|51.52,-0.1000|-30.04,-51.22|48.36,10.89|26.92,75.80|-22.91,-47.08|42.36,-71.07|43.58,39.74|35.23,-80.84|53.15,8.210|40.04,-105.3|40.75,-73.99|31.22,29.95|-33.93,18.46|36.19,44.02|54.81,56.07|31.33,75.57|34.15,-118.5|14.08,-87.22|59.91,10.75|33.65,-117.8|-27.60,-48.54|50.12,8.680|48.86,2.340|43.62,1.450|-16.50,-68.15|40.78,43.83|-8.580,116.1|54.32,10.12|50.08,14.43|48.22,16.37|49.87,8.640|49.80,9.940|-34.93,138.6|55.71,13.20|38.72,-9.140|48.11,-1.680|53.23,6.570|27.96,-82.46|-34.61,-58.37|-19.92,-43.94|51.77,19.46|39.70,-105.1|36.72,-4.420|35.67,139.8|41.32,-81.55|33.88,35.50|24.65,46.77|6.250,-75.59|44.83,20.50|50.00,8.260|54.36,18.64|22.57,88.36|37.98,23.73|50.88,4.700|-33.87,151.2|49.28,-123.0|6.520,3.300|13.09,80.27|23.03,72.58|51.72,39.26|36.19,5.410|67.29,14.37|53.55,10.00|33.52,-111.9|-31.40,-64.19|41.40,2.170|-1.940,30.06|9.600,6.550|52.37,4.890|51.50,7.630|48.79,9.190|49.45,11.05|-36.85,174.8|59.33,18.07|40.05,-105.2|-31.96,115.8|-7.230,-35.88|53.33,-6.250|14.62,121.0|42.47,-83.40|33.72,73.06|47.51,19.08|47.38,8.540|52.21,0.1300|-12.07,-77.05|50.64,3.070|45.65,-73.50|45.45,-75.69|18.46,-66.11|-6.910,107.6|-23.53,-46.63|32.07,34.77|46.52,6.620|29.72,-95.22|19.43,-99.14|-33.46,-70.64|52.52,13.38|37.35,-122.0&size=600x300&style=feature:administrative%7Cvisibility:off&style=feature:landscape%7Ccolor:0xffffff&style=feature:landscape%7Celement:labels%7Cvisibility:off&style=feature:landscape.man_made%7Celement:geometry%7Ccolor:0xffffff&style=feature:poi%7Cvisibility:off&style=feature:road%7Cvisibility:off&style=feature:transit%7Cvisibility:off&style=feature:water%7Ccolor:0xabd7df&scale=2&zoom=1&key=AIzaSyDmnawK5g8z5vh2itc7Qou7STaVkxocOtU", + "https://api.flutter.dev/flutter/material/Scaffold-class.html", + image: "https://i.ytimg.com/vi/vb8YDD7KO00/maxresdefault.jpg", + source: Source(name: "READ MORE"), +); + +News widget2 = News( + title: "Transform", + time: DateTime.parse("2019-05-30T22:49:51.764000+05:30"), + link: + "https://api.flutter.dev/flutter/widgets/Transform-class.html", + image: "https://i.ytimg.com/vi/9z_YNlRlWfA/maxresdefault.jpg", source: Source(name: "READ MORE"), ); diff --git a/lib/ui/pages/widget.dart b/lib/ui/pages/widget.dart index 452a65f..667c744 100644 --- a/lib/ui/pages/widget.dart +++ b/lib/ui/pages/widget.dart @@ -1,20 +1,217 @@ +import 'package:everything_flutter/constants/strings.dart'; +import 'package:everything_flutter/constants/test_data.dart'; import 'package:everything_flutter/constants/theme_data.dart'; +import 'package:everything_flutter/helpers/screen_util.dart'; +import 'package:everything_flutter/model/news.dart'; +import 'package:everything_flutter/ui/widgets/menu_card.dart'; +import 'package:everything_flutter/ui/widgets/news_item.dart'; import 'package:flutter/material.dart'; import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:intl/intl.dart'; +import 'package:snaplist/snaplist_view.dart'; class WidgetPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: myAppBar(context), - body: SingleChildScrollView( + body: _buildBody(), + ); + } + + +@widget +Widget _buildBody() => SafeArea( + child: SingleChildScrollView( child: Column( - children: [], + children: [ + _widgetsTitle, + _buildMenuCards(), + _buildWidgetBar(), + _buildWidgets(widgets) + ], ), ), ); + + +final _widgetsTitle = Text( + "Widgets Of The Week", + style: TextStyles.title, +); + + + +@widget + Widget _buildWidgetBar() => Padding( + padding: ScreenUtil.getPaddingLTRB(4, 2, 4, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Previous Widgets", + style: TextStyles.miniTitle, + ), + // GestureDetector( + // onTap : () { + // _scaffoldKey.currentState.openDrawer(); // CHANGE THIS LINE + // }, + // child: Icon( + // Icons.more_vert, + // size: ScreenUtil.getFullScreen(12), + // ), + // ), + ], + ), + ); + +List widgets = [widget1, widget2]; + + +@widget +Widget _buildWidgets(List newsList) { + List _columnItems = []; + for (var widget in newsList) { + _columnItems.add(NewsItem(widget)); +// _columnItems.add(Divider()); } + return Column(children: _columnItems); +} + +@widget +Container _buildMenuCards() => Container( + height: ScreenUtil.getHeight(35), + width: double.infinity, + child: SnapList( + builder: (context, index, data) => MenuCard( + height: ScreenUtil.getHeight(40), + width: ScreenUtil.getWidth(65), + margin: ScreenUtil.getPaddingLTRB(2, 1, 0, 0), + borderRadius: ScreenUtil.getBorderRadiusCircular(12), + imageAsset: imageAssets[index], + color: AppColors.pastelColors[index], + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: Alignment.topCenter, + child: Padding( + padding: ScreenUtil.getPaddingAll(11), + child: Container( + padding: ScreenUtil.getPaddingAll(10), + decoration: BoxDecoration( + borderRadius: ScreenUtil.getBorderRadiusCircular(12), + color: Colors.white70, + ), + child: Container( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Text( + "#WidgetOfTheDay", + style: TextStyle( + fontSize: ScreenUtil.getTextSize(12), + fontWeight: FontWeight.w800, + color: AppColors.titleColors[index], + ), + ), + ), + Center( + child: Text( + widgetDays[index], + style: TextStyle( + fontSize: ScreenUtil.getTextSize(13), + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ), + ), + + ], + ), + ), + ), + ), + ), + // SizedBox(height: ScreenUtil.getHeight(4)), + Padding( + padding: ScreenUtil.getPaddingAll(11), + child: Container( + padding: ScreenUtil.getPaddingAll(10), + decoration: BoxDecoration( + borderRadius: ScreenUtil.getBorderRadiusCircular(12), + color: Colors.white70, + ), + child: Container( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widgetNames[index], + style: TextStyle( + fontSize: ScreenUtil.getTextSize(13), + fontWeight: FontWeight.w800, + color: AppColors.titleColors[index], + ), + ), + + SizedBox(height: ScreenUtil.getHeight(0.5)), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + GestureDetector( + onTap: () => Navigator.pushNamed( + context, menuCardTitles[index]), + child: Container( + padding: ScreenUtil.getPaddingAll(8), + decoration: BoxDecoration( + borderRadius: + ScreenUtil.getBorderRadiusCircular(8), + color: AppColors.buttonColors[index], + boxShadow: [ + new BoxShadow( + color: AppColors.buttonColors[index], + blurRadius: 8.0, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Text("View",style: TextStyle(fontSize: ScreenUtil.getTextSize(11)),), + Icon( + Icons.arrow_forward_ios, + size: ScreenUtil.getTextSize(13), + color: Colors.white, + ), + ], + ), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ], + ), + ), + count: 3, + sizeProvider: (index, data) => + Size(ScreenUtil.getWidth(65), ScreenUtil.getHeight(35)), + separatorProvider: (index, data) => + Size(ScreenUtil.getWidth(1), ScreenUtil.getHeight(5)), + ), + ); +/////////////////////////////////////// + @widget AppBar myAppBar(BuildContext context) => AppBar(