diff --git a/lib/component/item_description.dart b/lib/component/item_description.dart index 8860594..a3c21da 100644 --- a/lib/component/item_description.dart +++ b/lib/component/item_description.dart @@ -10,31 +10,31 @@ class DescriptionText extends StatelessWidget { var theme = Theme.of(context); var textTheme = Theme.of(context).textTheme; - return new Column( + return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - new Text( + Text( 'Summary', style: textTheme.display1.apply(fontSizeDelta: 2.0), ), - new Padding( + Padding( padding: const EdgeInsets.only(top: 8.0), - child: new Text( + child: Text( text, style: textTheme.body1, ), ), // No expand-collapse in this tutorial, we just slap the "more" // button below the text like in the mockup. - new Row( + Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ - new Text( + Text( 'more', style: textTheme.display2.copyWith(color: theme.accentColor), ), - new Icon( + Icon( Icons.keyboard_arrow_down, size: 18.0, color: theme.accentColor, diff --git a/lib/component/item_game_container.dart b/lib/component/item_game_container.dart index 92b5d4d..a820158 100644 --- a/lib/component/item_game_container.dart +++ b/lib/component/item_game_container.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/model/game.dart'; -import "package:stream_games/ui/item_game_box.dart"; import "package:stream_games/page/page_game_details.dart"; +import "package:stream_games/ui/item_game_box.dart"; class GameContainerItem extends StatelessWidget { GameContainerItem(this.buildContext, this.game); @@ -11,28 +10,28 @@ class GameContainerItem extends StatelessWidget { @override Widget build(BuildContext context) { - return new Padding( + return Padding( padding: const EdgeInsets.only(right: 12.0), - child: new InkWell( + child: InkWell( onTap: () => _goGameDetailsPage(context, game), - child: new Column( + child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - new Hero( - tag: game.name, - child: new GameBoxItem(context, game, width: 120.0), + Hero( + tag: game.name, + child: GameBoxItem(context, game, width: 120.0), ), - new Padding(padding: const EdgeInsets.only(top: 6.0)), - new ConstrainedBox( + Padding(padding: const EdgeInsets.only(top: 6.0)), + ConstrainedBox( constraints: const BoxConstraints(maxWidth: 120.0), - child: new Column( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - new Text(game.name, + Text(game.name, style: Theme.of(context).textTheme.display1, maxLines: 1, overflow: TextOverflow.ellipsis), - new Text(game.getPlatforms(), + Text(game.getPlatforms(), style: Theme.of(context).textTheme.caption, maxLines: 1, overflow: TextOverflow.fade), @@ -46,9 +45,9 @@ class GameContainerItem extends StatelessWidget { void _goGameDetailsPage(BuildContext context, Game game) { Navigator.of(context).push( - new MaterialPageRoute( + MaterialPageRoute( builder: (c) { - return new GameDetailsPage(game); + return GameDetailsPage(game); }, ), ); diff --git a/lib/component/item_header_game.dart b/lib/component/item_header_game.dart index 5c81a91..574882f 100644 --- a/lib/component/item_header_game.dart +++ b/lib/component/item_header_game.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/icons.dart'; import 'package:stream_games/model/game.dart'; import 'package:stream_games/ui/item_game_box.dart'; @@ -13,106 +12,101 @@ class GameDetailHeader extends StatelessWidget { @override Widget build(BuildContext context) { - return new Stack( + return Stack( children: [ - new Padding( + Padding( padding: const EdgeInsets.only(bottom: 150.0), child: _buildDiagonalImageBackground(context), ), - new Positioned( + Positioned( top: 26.0, left: 4.0, - child: new BackButton(color: Colors.white), + child: BackButton(color: Colors.white), ), - new Positioned( + Positioned( bottom: 0.0, left: 16.0, right: 16.0, - child: new Row( + child: Row( crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end, children: [ - new Hero( + Hero( tag: game.name, - child: new GameBoxItem( + child: GameBoxItem( context, game, width: 150.0, - ) - ), - new Expanded( - child: new Padding( + )), + Expanded( + child: Padding( padding: const EdgeInsets.only(left: 16.0), - child: new Column( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - new Text( + Text( game.name, style: Theme.of(context).textTheme.subhead, maxLines: 3, overflow: TextOverflow.fade, ), - new Padding( + Padding( padding: const EdgeInsets.only(top: 8.0), - child: new RatingInformation(game), + child: RatingInformation(game), ), - new Padding( + Padding( padding: const EdgeInsets.only(top: 12.0), - child: new Row( + child: Row( children: [ - new OutlineButton( + OutlineButton( onPressed: () => {}, - child: new Row( + child: Row( children: [ - new Icon( + Icon( playOutlineIcon, - color: Theme - .of(context) + color: Theme.of(context) .textTheme .display2 .color, ), - new Text("Trailer", + Text("Trailer", style: - Theme.of(context).textTheme.display2), + Theme.of(context).textTheme.display2), ], ), padding: const EdgeInsets.fromLTRB( 6.0, 0.0, 12.0, 0.0), - shape: new RoundedRectangleBorder( - borderRadius: - new BorderRadius.circular(30.0)), - borderSide: new BorderSide( - color: Colors.black54, width: 2.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0)), + borderSide: + BorderSide(color: Colors.black54, width: 2.0), highlightColor: Colors.white70, splashColor: Colors.black12, highlightElevation: 0.0, ), - new Padding(padding: EdgeInsets.only(left: 8.0)), - new OutlineButton( + Padding(padding: EdgeInsets.only(left: 8.0)), + OutlineButton( onPressed: () => {}, - child: new Row( + child: Row( children: [ - new Icon( + Icon( plusIcon, - color: Theme - .of(context) + color: Theme.of(context) .textTheme .display2 .color, ), - new Text("Wishlist", + Text("Wishlist", style: - Theme.of(context).textTheme.display2), + Theme.of(context).textTheme.display2), ], ), padding: const EdgeInsets.fromLTRB( 6.0, 0.0, 12.0, 0.0), - shape: new RoundedRectangleBorder( - borderRadius: - new BorderRadius.circular(30.0)), - borderSide: new BorderSide( - color: Colors.black54, width: 2.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0)), + borderSide: + BorderSide(color: Colors.black54, width: 2.0), highlightColor: Colors.white70, splashColor: Colors.black12, highlightElevation: 0.0, @@ -134,8 +128,8 @@ class GameDetailHeader extends StatelessWidget { Widget _buildDiagonalImageBackground(BuildContext context) { var screenWidth = MediaQuery.of(context).size.width; - return new DiagonallyCutColoredImage( - new FadeInImage.assetNetwork( + return DiagonallyCutColoredImage( + FadeInImage.assetNetwork( image: game.cover, placeholder: "assets/placeholder_cover.jpg", width: screenWidth, diff --git a/lib/component/item_screenshot_container.dart b/lib/component/item_screenshot_container.dart index 0ad7491..88e3d4d 100644 --- a/lib/component/item_screenshot_container.dart +++ b/lib/component/item_screenshot_container.dart @@ -1,26 +1,26 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/ui/item_image_height.dart'; class ScreenshotContainerItem extends StatelessWidget { - ScreenshotContainerItem(this.buildContext, this.screenshot, {this.height = 400.0}); + ScreenshotContainerItem(this.buildContext, this.screenshot, + {this.height = 400.0}); final BuildContext buildContext; final String screenshot; final double height; @override Widget build(BuildContext context) { - return new Padding( + return Padding( padding: const EdgeInsets.only(right: 12.0), - child: new InkWell( + child: InkWell( onTap: () => {}, - child: new Column( + child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - new ImageHeightItem(context, screenshot, height), + ImageHeightItem(context, screenshot, height), ], ), ), ); } -} \ No newline at end of file +} diff --git a/lib/controller/scroll_horizontal_game.dart b/lib/controller/scroll_horizontal_game.dart index ec1e44c..2f2d255 100644 --- a/lib/controller/scroll_horizontal_game.dart +++ b/lib/controller/scroll_horizontal_game.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/component/item_game_container.dart'; import 'package:stream_games/model/game.dart'; @@ -9,9 +8,9 @@ class HorizontalGameController extends StatelessWidget { @override Widget build(BuildContext context) { - return new SizedBox.fromSize( + return SizedBox.fromSize( size: const Size.fromHeight(240.0), - child: new ListView.builder( + child: ListView.builder( itemCount: gameItems.length, scrollDirection: Axis.horizontal, padding: const EdgeInsets.only(left: 12.0, top: 4.0), diff --git a/lib/controller/scroll_horizontal_screenshots.dart b/lib/controller/scroll_horizontal_screenshots.dart index 50c259c..5e4f5b6 100644 --- a/lib/controller/scroll_horizontal_screenshots.dart +++ b/lib/controller/scroll_horizontal_screenshots.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/component/item_screenshot_container.dart'; class HorizontalScreenshotController extends StatelessWidget { @@ -10,14 +9,15 @@ class HorizontalScreenshotController extends StatelessWidget { Widget build(BuildContext context) { const double height = 240.0; - return new SizedBox.fromSize( + return SizedBox.fromSize( size: const Size.fromHeight(height), - child: new ListView.builder( + child: ListView.builder( itemCount: screenshots.length, scrollDirection: Axis.horizontal, padding: const EdgeInsets.only(left: 12.0), itemBuilder: (BuildContext context, int position) { - return ScreenshotContainerItem(context, screenshots[position], height: height - 16.0); + return ScreenshotContainerItem(context, screenshots[position], + height: height - 16.0); }), ); } diff --git a/lib/main.dart b/lib/main.dart index 69344cb..aa95d71 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,17 +1,16 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/page/page_main.dart'; import 'package:stream_games/themes.dart'; -void main() => runApp(new FlutterGames()); +void main() => runApp(FlutterGames()); class FlutterGames extends StatelessWidget { @override Widget build(BuildContext context) { - return new MaterialApp( + return MaterialApp( title: 'Flutter Games', theme: defaultTheme, - home: new MainPage(), + home: MainPage(), debugShowCheckedModeBanner: false, ); } diff --git a/lib/model/repository.dart b/lib/model/repository.dart index 0111685..1b8527f 100644 --- a/lib/model/repository.dart +++ b/lib/model/repository.dart @@ -7,21 +7,16 @@ final List newGamesList = [ agentsofmayhem, mgsurvive ]; -final List popularGamesList = [ - codww2, - fallout4, - fc5, - pvzgw2, - riseoftr -]; +final List popularGamesList = [codww2, fallout4, fc5, pvzgw2, riseoftr]; -final Game pvzgw2 = new Game( +final Game pvzgw2 = Game( name: 'Plants vs. Zombies: Garden Warfare 2', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/pvzgw2.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/pvzgw2.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/pvzgw2.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/pvzgw2.jpg', description: - 'The battle for suburbia grows to crazy new heights! In this hilarious, action-packed shooter, zombie leader Dr. Zomboss has strengthened his horde and rebuilt suburbia as a zombie utopia. But hope remains, because for the first time the plants are taking the offensive in an all-out attack to reclaim their turf. Play as the plants in the all-new 24-player Herbal Assault mode, or choose your side in 4-player co-op or Solo Play!', + 'The battle for suburbia grows to crazy new heights! In this hilarious, action-packed shooter, zombie leader Dr. Zomboss has strengthened his horde and rebuilt suburbia as a zombie utopia. But hope remains, because for the first time the plants are taking the offensive in an all-out attack to reclaim their turf. Play as the plants in the all-new 24-player Herbal Assault mode, or choose your side in 4-player co-op or Solo Play!', platforms: [ 'XBOX ONE', 'PS4', @@ -35,13 +30,14 @@ final Game pvzgw2 = new Game( ], ); -final Game codww2 = new Game( +final Game codww2 = Game( name: 'Call of Duty WWII', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/codww2.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/codww2.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/codww2.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/codww2.jpg', description: - 'Step back in time with Call of Duty WWII. Land in Normandy on D-Day and battle across Europe through iconic locations in history’s most monumental war. Experience classic Call of Duty combat, the bonds of camaraderie, and the unforgiving nature of war. Go at it alone or grab your closest war buddies and take the battle online!', + 'Step back in time with Call of Duty WWII. Land in Normandy on D-Day and battle across Europe through iconic locations in history’s most monumental war. Experience classic Call of Duty combat, the bonds of camaraderie, and the unforgiving nature of war. Go at it alone or grab your closest war buddies and take the battle online!', platforms: [ 'XBOX ONE', 'PS4', @@ -55,13 +51,14 @@ final Game codww2 = new Game( ], ); -final Game fc5 = new Game( +final Game fc5 = Game( name: 'Far Cry 5', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/fc5.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/fc5.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/fc5.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/fc5.jpg', description: - 'Whether through coercion, starvation or forced baptisms, the cult will use every resource available to build a following in preparation of The Collapse. Committed to restoring freedom to Hope County, The Resistance has rallied together in order to stop the Father and his followers. And they’ll only succeed with your help.', + 'Whether through coercion, starvation or forced baptisms, the cult will use every resource available to build a following in preparation of The Collapse. Committed to restoring freedom to Hope County, The Resistance has rallied together in order to stop the Father and his followers. And they’ll only succeed with your help.', platforms: [ 'XBOX ONE', 'PS4', @@ -75,13 +72,14 @@ final Game fc5 = new Game( ], ); -final Game riseoftr = new Game( +final Game riseoftr = Game( name: 'Rise of the Tomb Raider ', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/riseoftr.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/rotr.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/riseoftr.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/rotr.jpg', description: - 'In Rise of the Tomb Raider, Lara uncovers an ancient mystery that places her in the cross-hairs of a ruthless organization. Featuring epic, high-octane action moments set in the most beautiful hostile environments on earth, Rise of the Tomb Raider delivers a cinematic survival action adventure where you will join Lara Croft on her first tomb raiding expedition as she seeks to discover the secret of immortality.', + 'In Rise of the Tomb Raider, Lara uncovers an ancient mystery that places her in the cross-hairs of a ruthless organization. Featuring epic, high-octane action moments set in the most beautiful hostile environments on earth, Rise of the Tomb Raider delivers a cinematic survival action adventure where you will join Lara Croft on her first tomb raiding expedition as she seeks to discover the secret of immortality.', platforms: [ 'XBOX ONE', 'PS4', @@ -95,14 +93,14 @@ final Game riseoftr = new Game( ], ); -final Game detroitbh = new Game( +final Game detroitbh = Game( name: 'Detroit: Become Human', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/detroitbh.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/detroitbh.jpg', cover: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/detroitbh.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/detroitbh.jpg', description: - 'Travel to the near-future metropolis of Detroit – a city rejuvenated by an exciting technological development: androids. Witness your brave new world turn to chaos as you take on the role of Kara, a female android trying to find her own place in a turbulent social landscape.', + 'Travel to the near-future metropolis of Detroit – a city rejuvenated by an exciting technological development: androids. Witness your brave new world turn to chaos as you take on the role of Kara, a female android trying to find her own place in a turbulent social landscape.', platforms: [ 'PS4', ], @@ -112,16 +110,16 @@ final Game detroitbh = new Game( 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/screenshot/detroitbh_2.jpg', 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/screenshot/detroitbh_3.jpg', 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/screenshot/detroitbh_4.jpg', - ] -); + ]); -final Game shadowcolossus = new Game( +final Game shadowcolossus = Game( name: 'Shadow of the Colossus', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/shadowcolossus.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/shadowcolossus.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/shadowcolossus.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/shadowcolossus.jpg', description: - 'Armed with only a sword and a bow, journey through ancient lands to seek out gigantic beasts.', + 'Armed with only a sword and a bow, journey through ancient lands to seek out gigantic beasts.', platforms: [ 'PS4', ], @@ -134,13 +132,14 @@ final Game shadowcolossus = new Game( ], ); -final Game agentsofmayhem = new Game( +final Game agentsofmayhem = Game( name: 'Agents of Mayhem', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/agentsofmayhem.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/agentsofmayhem.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/agentsofmayhem.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/agentsofmayhem.jpg', description: - 'In Agents of Mayhem, a nefarious plot is set in motion to build a world-altering device that will grant unrivaled power to the supervillain organization known as LEGION. Pick your squad of 3 highly skilled and iconic characters from a roster of 12 uniquely designed MAYHEM agents and get ready to save the world!', + 'In Agents of Mayhem, a nefarious plot is set in motion to build a world-altering device that will grant unrivaled power to the supervillain organization known as LEGION. Pick your squad of 3 highly skilled and iconic characters from a roster of 12 uniquely designed MAYHEM agents and get ready to save the world!', platforms: [ 'XBOX ONE', 'PS4', @@ -154,13 +153,14 @@ final Game agentsofmayhem = new Game( ], ); -final Game fallout4 = new Game( +final Game fallout4 = Game( name: 'Fallout 4', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/fallout4.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/fallout4.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/fallout4.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/fallout4.jpg', description: - 'As the sole survivor of Vault 111, you enter a world destroyed by nuclear war. Every second is a fight for survival, and every choice is yours. Only you can rebuild and determine the fate of the Wasteland. Welcome home.', + 'As the sole survivor of Vault 111, you enter a world destroyed by nuclear war. Every second is a fight for survival, and every choice is yours. Only you can rebuild and determine the fate of the Wasteland. Welcome home.', platforms: [ 'XBOX ONE', 'PS4', @@ -174,13 +174,14 @@ final Game fallout4 = new Game( ], ); -final Game mgsurvive = new Game( +final Game mgsurvive = Game( name: 'Metal Gear Survive', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/mgsurvive.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/mgsurvive.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/mgsurvive.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/mgsurvive.jpg', description: - 'Create your own character and learn to survive. Scavenge resources, craft weapons, build a base camp and explore the unknown while developing the survival skills necessary in this hostile environment.', + 'Create your own character and learn to survive. Scavenge resources, craft weapons, build a base camp and explore the unknown while developing the survival skills necessary in this hostile environment.', platforms: [ 'XBOX ONE', 'PS4', @@ -194,13 +195,14 @@ final Game mgsurvive = new Game( ], ); -final Game seaofthieves = new Game( +final Game seaofthieves = Game( name: 'Sea of Thieves', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/seaoftheives.jpg', - cover: 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/seaofthieves.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/seaoftheives.jpg', + cover: + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/cover/seaofthieves.jpg', description: - 'Sea of Thieves offers the essential pirate experience, from sailing and fighting to exploring and looting—everything you need to live the pirate life and create all-new legends.', + 'Sea of Thieves offers the essential pirate experience, from sailing and fighting to exploring and looting—everything you need to live the pirate life and create all-new legends.', platforms: [ 'XBOX ONE', ], @@ -213,13 +215,13 @@ final Game seaofthieves = new Game( ], ); -final Game godofwar = new Game( +final Game godofwar = Game( name: 'God of War', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/godofwar.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/godofwar.jpg', cover: '', description: - 'Living as a man outside the shadow of the gods, Kratos must adapt to the unfamiliar Norse lands, unexpected threats, and a second chance at being a father.', + 'Living as a man outside the shadow of the gods, Kratos must adapt to the unfamiliar Norse lands, unexpected threats, and a second chance at being a father.', platforms: [ 'PS4', ], @@ -232,13 +234,13 @@ final Game godofwar = new Game( ], ); -final Game monsterhunterw = new Game( +final Game monsterhunterw = Game( name: 'Monster Hunter World', box: - 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/monsterhunterw.jpg', + 'https://raw.githubusercontent.com/searchy2/FlutterGames/master/images/box/monsterhunterw.jpg', cover: '', description: - 'Monster Hunter: World puts you in a living, breathing ecosystem as a hunter that seeks and slays ferocious beasts in heart-pounding battles that unfold across the vast ever-changing terrain. Venture on quests alone or cooperatively with up to three hunters via online drop-in multiplayer.', + 'Monster Hunter: World puts you in a living, breathing ecosystem as a hunter that seeks and slays ferocious beasts in heart-pounding battles that unfold across the vast ever-changing terrain. Venture on quests alone or cooperatively with up to three hunters via online drop-in multiplayer.', platforms: [ 'XBOX ONE', 'PS4', @@ -251,7 +253,7 @@ final Game monsterhunterw = new Game( '', ], ); -//final Game = new Game( +//final Game = Game( // name: '', // cover: '', // description: '', diff --git a/lib/page/page_coming_soon.dart b/lib/page/page_coming_soon.dart index dd13670..9c9e1c4 100644 --- a/lib/page/page_coming_soon.dart +++ b/lib/page/page_coming_soon.dart @@ -6,28 +6,26 @@ class ComingSoonPage extends StatefulWidget { final IconData icon; @override - _ComingSoonPageState createState() => new _ComingSoonPageState(); + _ComingSoonPageState createState() => _ComingSoonPageState(); } class _ComingSoonPageState extends State { @override Widget build(BuildContext context) { - return new Center( - child: new Column( + return Center( + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - new Icon(widget.icon, color: Colors.black26, size: 96.0), - new Padding(padding: new EdgeInsets.only(bottom: 36.0)), - new Text('Coming soon!', style: Theme.of(context).textTheme.subhead), - new Padding(padding: new EdgeInsets.only(bottom: 8.0)), - new Container( - margin: new EdgeInsets.symmetric(horizontal: 64.0), - child: new Text( - "We're working hard on new features. Check back often!", + Icon(widget.icon, color: Colors.black26, size: 96.0), + Padding(padding: EdgeInsets.only(bottom: 36.0)), + Text('Coming soon!', style: Theme.of(context).textTheme.subhead), + Padding(padding: EdgeInsets.only(bottom: 8.0)), + Container( + margin: EdgeInsets.symmetric(horizontal: 64.0), + child: Text("We're working hard on new features. Check back often!", textAlign: TextAlign.center, - style: Theme - .of(context) + style: Theme.of(context) .textTheme .display1 .apply(color: Colors.black54)), diff --git a/lib/page/page_game_details.dart b/lib/page/page_game_details.dart index 4003d1b..161c712 100644 --- a/lib/page/page_game_details.dart +++ b/lib/page/page_game_details.dart @@ -1,10 +1,9 @@ -import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; - -import 'package:stream_games/model/game.dart'; -import 'package:stream_games/component/item_header_game.dart'; +import 'package:flutter/material.dart'; import 'package:stream_games/component/item_description.dart'; +import 'package:stream_games/component/item_header_game.dart'; import 'package:stream_games/controller/scroll_horizontal_screenshots.dart'; +import 'package:stream_games/model/game.dart'; class GameDetailsPage extends StatefulWidget { GameDetailsPage(this.game, {Key key}) : super(key: key); @@ -12,44 +11,46 @@ class GameDetailsPage extends StatefulWidget { final Game game; @override - _GameDetailsPageState createState() => new _GameDetailsPageState(); + _GameDetailsPageState createState() => _GameDetailsPageState(); } class _GameDetailsPageState extends State { @override Widget build(BuildContext context) { - return new Material( - borderRadius: new BorderRadius.circular(8.0), - child: new SingleChildScrollView( - child: new Column( + return Material( + borderRadius: BorderRadius.circular(8.0), + child: SingleChildScrollView( + child: Column( children: [ - new GameDetailHeader(widget.game), - new Padding( + GameDetailHeader(widget.game), + Padding( padding: const EdgeInsets.fromLTRB(16.0, 32.0, 16.0, 0.0), - child: new SizedBox( + child: SizedBox( width: double.infinity, // height: double.infinity, - child: new RaisedButton( + child: RaisedButton( onPressed: () => {}, - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - new Padding( + Padding( padding: const EdgeInsets.only(right: 8.0), - child: new Icon( + child: Icon( Icons.adjust, color: Colors.white, ), ), - new Text( + Text( "Rent", - style: Theme.of(context).textTheme.subhead.apply(color: Colors.white), + style: Theme.of(context) + .textTheme + .subhead + .apply(color: Colors.white), ), ], ), - shape: new RoundedRectangleBorder( - borderRadius: - new BorderRadius.circular(4.0)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.0)), padding: const EdgeInsets.all(12.0), color: Colors.green, highlightColor: Colors.green.shade400, @@ -59,34 +60,36 @@ class _GameDetailsPageState extends State { ), ), ), - new Padding( + Padding( padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0), - child: new SizedBox( + child: SizedBox( width: double.infinity, // height: double.infinity, - child: new OutlineButton( + child: OutlineButton( onPressed: () => {}, - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - new Padding( + Padding( padding: const EdgeInsets.only(right: 8.0), - child: new Icon( + child: Icon( Icons.archive, color: Colors.green, ), ), - new Text( + Text( "Buy", - style: Theme.of(context).textTheme.subhead.apply(color: Colors.green), + style: Theme.of(context) + .textTheme + .subhead + .apply(color: Colors.green), ), ], ), - shape: new RoundedRectangleBorder( - borderRadius: - new BorderRadius.circular(4.0)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.0)), padding: const EdgeInsets.all(12.0), - borderSide: new BorderSide(color: Colors.green, width: 4.0), + borderSide: BorderSide(color: Colors.green, width: 4.0), color: Colors.white, highlightColor: Colors.white70, splashColor: Colors.green.shade200, @@ -95,10 +98,12 @@ class _GameDetailsPageState extends State { ), ), ), - new Padding(padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0), - child: new DescriptionText(widget.game.description)), - new Padding(padding: const EdgeInsets.only(top: 16.0, bottom: 16.0), - child: new HorizontalScreenshotController(widget.game.screenshots)), + Padding( + padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0), + child: DescriptionText(widget.game.description)), + Padding( + padding: const EdgeInsets.only(top: 16.0, bottom: 16.0), + child: HorizontalScreenshotController(widget.game.screenshots)), ], ), ), diff --git a/lib/page/page_games.dart b/lib/page/page_games.dart index 1dd8be9..6dc9760 100644 --- a/lib/page/page_games.dart +++ b/lib/page/page_games.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/controller/scroll_horizontal_game.dart'; import 'package:stream_games/model/repository.dart'; @@ -7,31 +6,31 @@ class GamesPage extends StatefulWidget { GamesPage({Key key}) : super(key: key); @override - _GamesPageState createState() => new _GamesPageState(); + _GamesPageState createState() => _GamesPageState(); } class _GamesPageState extends State { @override Widget build(BuildContext context) { - return new SingleChildScrollView( - child: new Column( + return SingleChildScrollView( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - new Padding( + Padding( padding: const EdgeInsets.fromLTRB(16.0, 6.0, 8.0, 8.0), - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - new Text( + Text( "New Releases", style: Theme.of(context).textTheme.subhead, ), - new InkWell( + InkWell( onTap: () => {}, - child: new Padding( + child: Padding( padding: const EdgeInsets.symmetric( horizontal: 8.0, vertical: 4.0), - child: new Text( + child: Text( "Browse All", style: Theme.of(context).textTheme.display2, ), @@ -39,23 +38,23 @@ class _GamesPageState extends State { ), ]), ), - new HorizontalGameController(newGamesList), - new Divider(height: 2.0, indent: 8.0), - new Padding( + HorizontalGameController(newGamesList), + Divider(height: 2.0, indent: 8.0), + Padding( padding: const EdgeInsets.fromLTRB(16.0, 12.0, 8.0, 8.0), - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - new Text( + Text( "Most Popular", style: Theme.of(context).textTheme.subhead, ), - new InkWell( + InkWell( onTap: () => {}, - child: new Padding( + child: Padding( padding: const EdgeInsets.symmetric( horizontal: 8.0, vertical: 4.0), - child: new Text( + child: Text( "Browse All", style: Theme.of(context).textTheme.display2, ), @@ -63,7 +62,7 @@ class _GamesPageState extends State { ), ]), ), - new HorizontalGameController(popularGamesList), + HorizontalGameController(popularGamesList), ], ), ); diff --git a/lib/page/page_main.dart b/lib/page/page_main.dart index fac3714..512cc84 100644 --- a/lib/page/page_main.dart +++ b/lib/page/page_main.dart @@ -1,14 +1,13 @@ -import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; - +import 'package:flutter/material.dart'; import 'package:stream_games/bottom_menu_items.dart'; import 'package:stream_games/icons.dart'; -import 'package:stream_games/page/page_games.dart'; import 'package:stream_games/page/page_coming_soon.dart'; +import 'package:stream_games/page/page_games.dart'; class MainPage extends StatefulWidget { @override - _MainPageState createState() => new _MainPageState(); + _MainPageState createState() => _MainPageState(); } class _MainPageState extends State { @@ -16,43 +15,42 @@ class _MainPageState extends State { @override Widget build(BuildContext context) { - return new Material( - borderRadius: new BorderRadius.circular(8.0), - child: new Scaffold( - appBar: new AppBar( + return Material( + borderRadius: BorderRadius.circular(8.0), + child: Scaffold( + appBar: AppBar( elevation: 0.0, centerTitle: false, backgroundColor: Colors.white, automaticallyImplyLeading: false, - title: new Row( + title: Row( children: [ Text( menuItemName(_layoutSelection), style: Theme.of(context).textTheme.title, ), - new Padding(padding: new EdgeInsets.only(right: 8.0)), - new Icon(menuIcon(_layoutSelection), - size: 28.0, color: Colors.black), + Padding(padding: EdgeInsets.only(right: 8.0)), + Icon(menuIcon(_layoutSelection), size: 28.0, color: Colors.black), ], ), actions: [ - new Center( - child: new IconButton( + Center( + child: IconButton( onPressed: () => {}, - icon: new Stack( + icon: Stack( children: [ - new Align( + Align( alignment: Alignment.center, - child: new Icon(Icons.shopping_cart, + child: Icon(Icons.shopping_cart, size: 28.0, color: Colors.black), ), - new Align( + Align( alignment: Alignment.bottomRight, - child: new CircleAvatar( + child: CircleAvatar( radius: 8.0, backgroundColor: Colors.green, - child: new Text("0", - style: new TextStyle( + child: Text("0", + style: TextStyle( color: Colors.white, fontSize: 10.0)), ), ), @@ -61,7 +59,7 @@ class _MainPageState extends State { ), ], ), - bottomNavigationBar: new CupertinoTabBar( + bottomNavigationBar: CupertinoTabBar( activeColor: Colors.blueAccent, backgroundColor: Colors.white70, items: [ diff --git a/lib/page/page_movies.dart b/lib/page/page_movies.dart index 669a5cc..0c6a965 100644 --- a/lib/page/page_movies.dart +++ b/lib/page/page_movies.dart @@ -4,16 +4,16 @@ class MoviesPage extends StatefulWidget { MoviesPage({Key key}) : super(key: key); @override - _MoviesPageState createState() => new _MoviesPageState(); + _MoviesPageState createState() => _MoviesPageState(); } class _MoviesPageState extends State { @override Widget build(BuildContext context) { - return new SingleChildScrollView( - child: new Column( + return SingleChildScrollView( + child: Column( children: [ - new Text("Movies", style: Theme.of(context).textTheme.caption), + Text("Movies", style: Theme.of(context).textTheme.caption), ], ), ); diff --git a/lib/ui/item_game_box.dart b/lib/ui/item_game_box.dart index 88f9704..1808e23 100644 --- a/lib/ui/item_game_box.dart +++ b/lib/ui/item_game_box.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/model/game.dart'; class GameBoxItem extends StatelessWidget { @@ -14,11 +13,11 @@ class GameBoxItem extends StatelessWidget { Widget build(BuildContext context) { double height = IMAGE_RATIO * width; - return new Material( - borderRadius: new BorderRadius.circular(4.0), + return Material( + borderRadius: BorderRadius.circular(4.0), elevation: 8.0, - shadowColor: new Color(0xCC000000), - child: new FadeInImage.assetNetwork( + shadowColor: Color(0xCC000000), + child: FadeInImage.assetNetwork( image: game.box, placeholder: "assets/placeholder_box.png", width: width, diff --git a/lib/ui/item_header_diagonal.dart b/lib/ui/item_header_diagonal.dart index 6bdbbea..7b6ffef 100644 --- a/lib/ui/item_header_diagonal.dart +++ b/lib/ui/item_header_diagonal.dart @@ -9,11 +9,11 @@ class DiagonallyCutColoredImage extends StatelessWidget { @override Widget build(BuildContext context) { - return new ClipPath( - clipper: new DiagonalClipper(), - child: new DecoratedBox( + return ClipPath( + clipper: DiagonalClipper(), + child: DecoratedBox( position: DecorationPosition.foreground, - decoration: new BoxDecoration(color: color), + decoration: BoxDecoration(color: color), child: image, ), ); @@ -23,7 +23,7 @@ class DiagonallyCutColoredImage extends StatelessWidget { class DiagonalClipper extends CustomClipper { @override Path getClip(Size size) { - Path path = new Path(); + Path path = Path(); path.lineTo(0.0, size.height); path.lineTo(size.width, size.height - 50.0); path.lineTo(size.width, 0.0); diff --git a/lib/ui/item_image_height.dart b/lib/ui/item_image_height.dart index 4c453a7..f8b941a 100644 --- a/lib/ui/item_image_height.dart +++ b/lib/ui/item_image_height.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; class ImageHeightItem extends StatelessWidget { - - ImageHeightItem(this.buildContext, this.image, this.height, {this.imageRatio = 1.50}); + ImageHeightItem(this.buildContext, this.image, this.height, + {this.imageRatio = 1.50}); final BuildContext buildContext; final String image; final double height; @@ -12,11 +12,11 @@ class ImageHeightItem extends StatelessWidget { Widget build(BuildContext context) { double width = imageRatio * height; - return new Material( - borderRadius: new BorderRadius.circular(4.0), + return Material( + borderRadius: BorderRadius.circular(4.0), elevation: 8.0, - shadowColor: new Color(0xCC000000), - child: new FadeInImage.assetNetwork( + shadowColor: Color(0xCC000000), + child: FadeInImage.assetNetwork( image: image, placeholder: "assets/placeholder_cover.jpg", width: width, diff --git a/lib/ui/item_image_width.dart b/lib/ui/item_image_width.dart index 9b0e123..ced727d 100644 --- a/lib/ui/item_image_width.dart +++ b/lib/ui/item_image_width.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; class ImageWidthItem extends StatelessWidget { - - ImageWidthItem(this.buildContext, this.image, this.width, {this.imageRatio = 1.50}); + ImageWidthItem(this.buildContext, this.image, this.width, + {this.imageRatio = 1.50}); final BuildContext buildContext; final String image; final double width; @@ -12,11 +12,11 @@ class ImageWidthItem extends StatelessWidget { Widget build(BuildContext context) { double height = imageRatio * width; - return new Material( - borderRadius: new BorderRadius.circular(4.0), + return Material( + borderRadius: BorderRadius.circular(4.0), elevation: 8.0, - shadowColor: new Color(0xCC000000), - child: new FadeInImage.assetNetwork( + shadowColor: Color(0xCC000000), + child: FadeInImage.assetNetwork( image: image, placeholder: "assets/placeholder_cover.jpg", width: width, diff --git a/lib/ui/item_rating.dart b/lib/ui/item_rating.dart index 5e01663..dea5e0f 100644 --- a/lib/ui/item_rating.dart +++ b/lib/ui/item_rating.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - import 'package:stream_games/model/game.dart'; class RatingInformation extends StatelessWidget { @@ -12,7 +11,7 @@ class RatingInformation extends StatelessWidget { for (var i = 1; i <= 5; i++) { var color = i <= game.rating ? theme.accentColor : Colors.black12; - var star = new Icon( + var star = Icon( Icons.star, color: color, ); @@ -20,7 +19,7 @@ class RatingInformation extends StatelessWidget { stars.add(star); } - return new Row(children: stars); + return Row(children: stars); } @override @@ -29,20 +28,20 @@ class RatingInformation extends StatelessWidget { var textTheme = theme.textTheme; var ratingCaptionStyle = textTheme.caption.copyWith(color: Colors.black45); - var numericRating = new Column( + var numericRating = Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - new Text( + Text( game.rating.toString(), style: textTheme.title.copyWith( fontWeight: FontWeight.w400, color: theme.accentColor, ), ), - new Padding( + Padding( padding: const EdgeInsets.only(top: 4.0), - child: new Text( + child: Text( 'Rating', style: ratingCaptionStyle, ), @@ -50,14 +49,14 @@ class RatingInformation extends StatelessWidget { ], ); - var starRating = new Column( + var starRating = Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ _buildRatingBar(theme), -// new Padding( +// Padding( // padding: const EdgeInsets.only(top: 4.0, left: 4.0), -// child: new Text( +// child: Text( // 'Tap to Rate', // style: ratingCaptionStyle, // ), @@ -65,11 +64,11 @@ class RatingInformation extends StatelessWidget { ], ); - return new Row( + return Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ numericRating, - new Padding( + Padding( padding: const EdgeInsets.only(left: 16.0), child: starRating, ),