Skip to content

Commit

Permalink
Update project to support flutter v2
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothvino42 committed Apr 14, 2021
1 parent dae9b59 commit a72a8e9
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 87 deletions.
79 changes: 58 additions & 21 deletions lib/views/mobile/account/account_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ class AccountScreen extends StatelessWidget {
color: Colors.grey[200],
child: Text(
'PAST ORDERS',
style: Theme.of(context).textTheme.subtitle2.copyWith(color: Colors.grey[700], fontSize: 12.0),
style: Theme.of(context)
.textTheme
.subtitle2
.copyWith(color: Colors.grey[700], fontSize: 12.0),
),
),
_PastOrderListView(),
Expand All @@ -70,12 +73,18 @@ class _AppBar extends StatelessWidget {
children: <Widget>[
Text(
'VINOTH',
style: Theme.of(context).textTheme.headline6.copyWith(fontWeight: FontWeight.bold, fontSize: 18.0),
style: Theme.of(context)
.textTheme
.headline6
.copyWith(fontWeight: FontWeight.bold, fontSize: 18.0),
),
InkWell(
child: Text(
'EDIT',
style: Theme.of(context).textTheme.headline6.copyWith(fontSize: 17.0, color: darkOrange),
style: Theme.of(context)
.textTheme
.headline6
.copyWith(fontSize: 17.0, color: darkOrange),
),
onTap: () {},
)
Expand Down Expand Up @@ -139,12 +148,18 @@ class _ListItem extends StatelessWidget {
children: <Widget>[
Text(
title,
style: Theme.of(context).textTheme.headline6.copyWith(fontSize: 15.0),
style: Theme.of(context)
.textTheme
.headline6
.copyWith(fontSize: 15.0),
),
UIHelper.verticalSpaceExtraSmall(),
Text(
body,
style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 13.0, color: Colors.black),
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(fontSize: 13.0, color: Colors.black),
),
],
),
Expand Down Expand Up @@ -195,10 +210,13 @@ class _PastOrderListView extends StatelessWidget {
foodItem: foods[index],
),
),
FlatButton(
TextButton(
child: Text(
'VIEW MORE ORDERS',
style: Theme.of(context).textTheme.subtitle2.copyWith(color: darkOrange),
style: Theme.of(context)
.textTheme
.subtitle2
.copyWith(color: darkOrange),
),
onPressed: () {},
),
Expand All @@ -212,7 +230,10 @@ class _PastOrderListView extends StatelessWidget {
height: 50.0,
child: Text(
'LOGOUT',
style: Theme.of(context).textTheme.subtitle2.copyWith(fontSize: 16.0),
style: Theme.of(context)
.textTheme
.subtitle2
.copyWith(fontSize: 16.0),
),
),
Spacer(),
Expand All @@ -226,8 +247,11 @@ class _PastOrderListView extends StatelessWidget {
height: 130.0,
color: Colors.grey[200],
child: Text(
'App Version v1.0.1',
style: Theme.of(context).textTheme.bodyText1.copyWith(color: Colors.grey[700], fontSize: 13.0),
'App Version v3.0.0',
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(color: Colors.grey[700], fontSize: 13.0),
),
)
],
Expand Down Expand Up @@ -270,14 +294,18 @@ class _PastOrdersListItemView extends StatelessWidget {
UIHelper.verticalSpaceExtraSmall(),
Text(
'Medavakkam',
style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 12.0),
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(fontSize: 12.0),
),
UIHelper.verticalSpaceSmall(),
Row(
children: <Widget>[
Text('Rs112'),
UIHelper.horizontalSpaceExtraSmall(),
Icon(Icons.keyboard_arrow_right, color: Colors.grey[600])
Icon(Icons.keyboard_arrow_right,
color: Colors.grey[600])
],
)
],
Expand Down Expand Up @@ -312,17 +340,22 @@ class _PastOrdersListItemView extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
OutlineButton(
color: darkOrange,
borderSide: BorderSide(width: 1.5, color: darkOrange),
OutlinedButton(
style: OutlinedButton.styleFrom(
side: BorderSide(width: 1.5, color: darkOrange),
),
child: Text(
'REORDER',
style: Theme.of(context).textTheme.subtitle2.copyWith(color: darkOrange),
style: Theme.of(context)
.textTheme
.subtitle2
.copyWith(color: darkOrange),
),
onPressed: () {},
),
UIHelper.verticalSpaceMedium(),
Text('Delivery rating not\napplicable for this order', maxLines: 2)
Text('Delivery rating not\napplicable for this order',
maxLines: 2)
],
),
),
Expand All @@ -331,12 +364,16 @@ class _PastOrdersListItemView extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
OutlineButton(
color: darkOrange,
borderSide: BorderSide(width: 1.5, color: Colors.black),
OutlinedButton(
style: OutlinedButton.styleFrom(
side: BorderSide(width: 1.5, color: Colors.black),
),
child: Text(
'RATE FOOD',
style: Theme.of(context).textTheme.subtitle2.copyWith(color: Colors.black),
style: Theme.of(context)
.textTheme
.subtitle2
.copyWith(color: Colors.black),
),
onPressed: () {},
),
Expand Down
34 changes: 23 additions & 11 deletions lib/views/mobile/swiggy/genie/genie_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class GenieScreen extends StatelessWidget {

return Scaffold(
body: SafeArea(
top: false,
child: Container(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 10.0),
color: Colors.indigo,
Expand Down Expand Up @@ -40,7 +39,10 @@ class GenieScreen extends StatelessWidget {
children: <Widget>[
Text(
'Genie',
style: Theme.of(context).textTheme.headline4.copyWith(color: Colors.white),
style: Theme.of(context)
.textTheme
.headline4
.copyWith(color: Colors.white),
),
UIHelper.horizontalSpaceSmall(),
Image.asset(
Expand All @@ -53,10 +55,11 @@ class GenieScreen extends StatelessWidget {
UIHelper.verticalSpaceExtraSmall(),
Text(
'Anything you need, delivered',
style: Theme.of(context).textTheme.bodyText1.copyWith(
color: Colors.grey[200],
fontSize: 17.0,
),
style:
Theme.of(context).textTheme.bodyText1.copyWith(
color: Colors.grey[200],
fontSize: 17.0,
),
)
],
),
Expand All @@ -78,7 +81,10 @@ class GenieScreen extends StatelessWidget {
UIHelper.verticalSpaceMedium(),
Text(
'Some things we can pick or drop for you',
style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 14.0),
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(fontSize: 14.0),
),
UIHelper.verticalSpaceMedium(),
LimitedBox(
Expand Down Expand Up @@ -116,7 +122,10 @@ class GenieScreen extends StatelessWidget {
services[index].title,
textAlign: TextAlign.center,
maxLines: 2,
style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 13.5),
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(fontSize: 13.5),
)
],
),
Expand Down Expand Up @@ -177,11 +186,14 @@ class _HeaderView extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 15.0),
height: 50.0,
width: double.infinity,
child: RaisedButton(
color: darkOrange,
child: ElevatedButton(
style: ElevatedButton.styleFrom(primary: darkOrange),
child: Text(
buttonTitle,
style: Theme.of(context).textTheme.subtitle2.copyWith(color: Colors.white, fontSize: 14.0),
style: Theme.of(context)
.textTheme
.subtitle2
.copyWith(color: Colors.white, fontSize: 14.0),
),
onPressed: () {},
),
Expand Down
25 changes: 18 additions & 7 deletions lib/views/mobile/swiggy/meat/meat_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class MeatScreen extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
IconButton(icon: Icon(Icons.arrow_back), onPressed: () => Navigator.pop(context)),
IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () => Navigator.pop(context)),
UIHelper.horizontalSpaceSmall(),
Container(
height: 32.0,
Expand Down Expand Up @@ -195,10 +197,13 @@ class _CardView extends StatelessWidget {
),
),
UIHelper.verticalSpaceExtraSmall(),
FlatButton(
TextButton(
child: Text(
'Know More',
style: Theme.of(context).textTheme.headline6.copyWith(color: darkOrange),
style: Theme.of(context)
.textTheme
.headline6
.copyWith(color: darkOrange),
),
onPressed: () {},
)
Expand Down Expand Up @@ -286,15 +291,21 @@ class _StoresListView extends StatelessWidget {
children: <Widget>[
Text(
foods[index].name,
style: Theme.of(context).textTheme.subtitle2.copyWith(fontSize: 16.0),
style: Theme.of(context)
.textTheme
.subtitle2
.copyWith(fontSize: 16.0),
),
Text(foods[index].desc,
style:
Theme.of(context).textTheme.bodyText1.copyWith(color: Colors.grey[800], fontSize: 13.5)),
style: Theme.of(context).textTheme.bodyText1.copyWith(
color: Colors.grey[800], fontSize: 13.5)),
UIHelper.verticalSpaceSmall(),
Text(
foods[index].coupon,
style: Theme.of(context).textTheme.bodyText1.copyWith(color: Colors.red[900], fontSize: 13.0),
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(color: Colors.red[900], fontSize: 13.0),
),
Divider(),
Row(
Expand Down
13 changes: 9 additions & 4 deletions lib/views/mobile/swiggy/swiggy_safety_banner_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class SwiggySafetyBannerView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isTabletDesktop = Responsive.isTabletDesktop(context);
final cardWidth = MediaQuery.of(context).size.width / (isTabletDesktop ? 3.8 : 1.2);
final cardWidth =
MediaQuery.of(context).size.width / (isTabletDesktop ? 3.8 : 1.2);

return Container(
margin: const EdgeInsets.all(15.0),
Expand Down Expand Up @@ -62,7 +63,8 @@ class SwiggySafetyBannerView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
padding:
const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -80,10 +82,13 @@ class SwiggySafetyBannerView extends StatelessWidget {
),
),
UIHelper.verticalSpaceExtraSmall(),
FlatButton(
TextButton(
child: Text(
'Know More',
style: Theme.of(context).textTheme.headline6.copyWith(color: darkOrange),
style: Theme.of(context)
.textTheme
.headline6
.copyWith(color: darkOrange),
),
onPressed: () {},
)
Expand Down
Loading

0 comments on commit a72a8e9

Please sign in to comment.