From 43131a6ff6f27f338cc8861bbba170ed22a65bc3 Mon Sep 17 00:00:00 2001 From: manishalali12 <115717649+manishalali12@users.noreply.github.com> Date: Thu, 13 Oct 2022 19:15:55 +0530 Subject: [PATCH] Dart formate --- lib/pages/homepage.dart | 192 +++++++++++++++++++++------------------- 1 file changed, 101 insertions(+), 91 deletions(-) diff --git a/lib/pages/homepage.dart b/lib/pages/homepage.dart index 78363f6..4948bc9 100644 --- a/lib/pages/homepage.dart +++ b/lib/pages/homepage.dart @@ -16,110 +16,120 @@ class _HomePageState extends State { if (list.length == 0) { return Expanded( child: Center( - child: error != '' ? Text(error) : Text('Go do a search!!!!!')), + child: error != '' + ? Text(error) + : Text( + 'Go do a search!!!!!', + ), + ), ); } return Expanded( child: ListView.builder( - padding: const EdgeInsets.all(8), - itemCount: list.length, - itemBuilder: (BuildContext context, int index) { - return Card( - elevation: 10, - margin: EdgeInsets.symmetric(vertical: 20), - child: Container( - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(left: 30, bottom: 20), - child: Container( - height: 140, - width: 100, - child: OverflowBox( - alignment: Alignment.bottomCenter, - child: Image.network( - list[index].posterURL, - ), - maxWidth: 120, - minHeight: 0, - minWidth: 0, - maxHeight: 160, + padding: const EdgeInsets.all(8), + itemCount: list.length, + itemBuilder: (BuildContext context, int index) { + return Card( + elevation: 10, + margin: EdgeInsets.symmetric(vertical: 20), + child: Container( + child: Row( + children: [ + Padding( + padding: const EdgeInsets.only(left: 30, bottom: 20), + child: Container( + height: 140, + width: 100, + child: OverflowBox( + alignment: Alignment.bottomCenter, + child: Image.network( + list[index].posterURL, ), + maxWidth: 120, + minHeight: 0, + minWidth: 0, + maxHeight: 160, ), ), - SizedBox( - width: 40, - ), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - list[index].title, - style: TextStyle( - fontSize: 22, fontWeight: FontWeight.bold), - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.start, - maxLines: 2, - softWrap: true, - ), - SizedBox( - height: 12, - ), - Text( - "Genre : ${list[index].genre}", - style: - TextStyle(fontSize: 16, color: Colors.grey), - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.start, - softWrap: true, + ), + SizedBox(width: 40), + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + list[index].title, + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, ), - SizedBox( - height: 12, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.start, + maxLines: 2, + softWrap: true, + ), + SizedBox( + height: 12, + ), + Text( + "Genre : ${list[index].genre}", + style: TextStyle( + fontSize: 16, + color: Colors.grey, ), - Row( - children: [ - Text( - list[index].imdbRatings.toString(), - style: TextStyle( - fontSize: 20, - color: Colors.deepPurple, - fontWeight: FontWeight.bold), - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.start, - softWrap: true, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.start, + softWrap: true, + ), + SizedBox( + height: 12, + ), + Row( + children: [ + Text( + list[index].imdbRatings.toString(), + style: TextStyle( + fontSize: 20, + color: Colors.deepPurple, + fontWeight: FontWeight.bold, ), - RatingBar( - initialRating: list[index].imdbRatings / 2, - direction: Axis.horizontal, - itemSize: 25, - allowHalfRating: true, - itemCount: 5, - itemPadding: - EdgeInsets.symmetric(horizontal: 4.0), - itemBuilder: (context, _) => Icon( - Icons.star, - color: Colors.deepOrange, - ), - glow: true, - glowColor: Colors.orange, - ignoreGestures: true, - tapOnlyMode: false, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.start, + softWrap: true, + ), + RatingBar( + initialRating: list[index].imdbRatings / 2, + direction: Axis.horizontal, + itemSize: 25, + allowHalfRating: true, + itemCount: 5, + itemPadding: EdgeInsets.symmetric( + horizontal: 4.0, ), - ], - ), - ], - ), + itemBuilder: (context, _) => Icon( + Icons.star, + color: Colors.deepOrange, + ), + glow: true, + glowColor: Colors.orange, + ignoreGestures: true, + tapOnlyMode: false, + ), + ], + ), + ], ), - ) - ], - ), + ), + ) + ], ), - ); - }), + ), + ); + }, + ), ); }