Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iampawan committed Apr 30, 2021
1 parent 922c79b commit d8b4d4d
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 86 deletions.
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Expand Up @@ -536,4 +536,4 @@
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
}
9 changes: 8 additions & 1 deletion lib/app/app.dart
@@ -1,9 +1,11 @@
import 'package:india_beats_covid/mutations/theme_mutation.dart';
import 'package:india_beats_covid/utils/constants.dart';
import 'package:india_beats_covid/utils/routes.dart';
import 'package:india_beats_covid/utils/themes/theme.dart';
import 'package:india_beats_covid/views/home/home_screen.dart';
import 'package:india_beats_covid/views/home/treating_covid_screen.dart';
import 'package:india_beats_covid/views/hospital/hospital_screen.dart';
import 'package:india_beats_covid/views/links/crowdfunding.dart';
import 'package:india_beats_covid/views/links/link_screen.dart';
import 'package:india_beats_covid/views/links/twitter_screen.dart';
import 'package:india_beats_covid/views/medicine/medicine_screen.dart';
Expand All @@ -21,7 +23,12 @@ class App extends StatelessWidget {
Routes.oxygenRoute: (_, __) => MaterialPage(child: OxygenScreen()),
Routes.linkRoute: (_, __) => MaterialPage(child: LinkScreen()),
Routes.medicineRoute: (_, __) => MaterialPage(child: MedicineScreen()),
Routes.twitterSearchRoute: (_, __) => MaterialPage(child: TwitterScreen()),
Routes.twitterSearchRoute: (_, __) =>
MaterialPage(child: Scaffold(body: TwitterScreen())),
Routes.crowdFundingRoute: (_, __) => MaterialPage(
child: Scaffold(
appBar: AppBar(title: Constants.crowdFunding.text.make()),
body: CrowdFunding())),
Routes.treatingCovidRoute: (_, __) =>
MaterialPage(child: TreatingCovidScreen()),
Routes.addPlasmaRoute: (_, __) => MaterialPage(child: AddPlasmaScreen()),
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/constants.dart
Expand Up @@ -35,6 +35,8 @@ mixin Constants {
static String medicineSuppliers = "COVID Medicine Suppliers";
static String externalLinks = "External Links";
static String twitterSearch = "Twitter Search for COVID";
static String crowdFunding = "Crowdfunding";
static String fundRaising = "Fundraising to fight with COVID";
static String twitterResources =
"Find latest resources in real time on Twitter";
static String selectRegion = "Select/Type Region";
Expand Down
1 change: 1 addition & 0 deletions lib/utils/routes.dart
Expand Up @@ -6,6 +6,7 @@ mixin Routes {
static String linkRoute = "/links";
static String medicineRoute = "/medicines";
static String twitterSearchRoute = "/search_twitter";
static String crowdFundingRoute = "/crowdfunding";
static String treatingCovidRoute = "/treating_covid";
static String addPlasmaRoute = "/add_plasma";
static String addHospitalRoute = "/add_hospital";
Expand Down
7 changes: 5 additions & 2 deletions lib/utils/themes/theme.dart
Expand Up @@ -9,7 +9,9 @@ class AppTheme {
brightness: Brightness.light,
primaryColor: AppColors.primaryColor,
accentColor: AppColors.accentColor,
fontFamily: GoogleFonts.muli().fontFamily,
// cardColor: Colors.white,
// scaffoldBackgroundColor: Colors.white,
fontFamily: GoogleFonts.poppins().fontFamily,
appBarTheme: AppBarTheme(
elevation: 0.0,
backgroundColor: Colors.white,
Expand All @@ -26,7 +28,8 @@ class AppTheme {
primarySwatch: Colors.teal,
primaryColor: AppColors.primaryColor,
accentColor: AppColors.accentColor,
fontFamily: GoogleFonts.muli().fontFamily,
// cardColor: Colors.black26,
fontFamily: GoogleFonts.poppins().fontFamily,
appBarTheme: AppBarTheme(
elevation: 0.0,
color: Colors.black26,
Expand Down
24 changes: 20 additions & 4 deletions lib/views/home/action_card.dart
Expand Up @@ -4,6 +4,7 @@ import '../../pkgs.dart';

class ActionCard extends StatelessWidget {
final Color color;
final Color titleColor;
final String title;
final String subtitle;
final String subtitle2;
Expand All @@ -14,6 +15,7 @@ class ActionCard extends StatelessWidget {
const ActionCard(
{Key key,
this.color = Vx.emerald400,
this.titleColor,
@required this.title,
this.subtitle,
this.subtitle2,
Expand All @@ -23,6 +25,10 @@ class ActionCard extends StatelessWidget {
: super(key: key);
@override
Widget build(BuildContext context) {
final Store store = VxState.store;
final _titleColor = store.isDarkTheme
? context.textTheme.bodyText1.color
: (titleColor ?? context.theme.textTheme.bodyText1.color);
return GestureDetector(
onTap: onTap,
child: Row(
Expand All @@ -36,7 +42,7 @@ class ActionCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
title.text.xl2.extraBold.make(),
title.text.xl2.extraBold.color(_titleColor).make(),
if (subtitle != null)
"${Constants.total} Count - $subtitle"
.text
Expand All @@ -60,11 +66,21 @@ class ActionCard extends StatelessWidget {
)
.box
.clip(Clip.antiAlias)
.color(context.theme.cardColor)
.width(context.percentWidth * 40)
// .height(Vx.isWeb ? null : context.percentHeight * 18)
.border(color: color)
.roundedSM
.linearGradient(
[
color.withOpacity(store.isDarkTheme ? 1.0 : 0.2),
if (store.isDarkTheme)
titleColor.withOpacity(0.2)
else
context.cardColor,
],
begin: Alignment.topRight,
end: Alignment.bottomLeft,
)
.outerShadowSm
.rounded
.make(),
);
}
Expand Down
4 changes: 4 additions & 0 deletions lib/views/home/add_action.dart
Expand Up @@ -22,6 +22,7 @@ class AddAction extends StatelessWidget {
subtitle2: "Click here to add",
title: "Plasma Donor Contact",
color: Vx.emerald500,
titleColor: Vx.emerald700,
onTap: link,
),
).wFull(context),
Expand All @@ -37,6 +38,7 @@ class AddAction extends StatelessWidget {
subtitle2: "Click here to add",
title: "Hospital Contact",
color: Vx.pink500,
titleColor: Vx.pink700,
onTap: link,
),
).wFull(context),
Expand All @@ -52,6 +54,7 @@ class AddAction extends StatelessWidget {
subtitle2: "Click here to add",
title: "Oxygen Supplier Contact",
color: Vx.cyan500,
titleColor: Vx.cyan700,
onTap: link,
),
).wFull(context),
Expand All @@ -67,6 +70,7 @@ class AddAction extends StatelessWidget {
subtitle2: "Click here to add",
title: "Medicine/Ambulance Contact",
color: Vx.amber500,
titleColor: Vx.amber700,
onTap: link,
),
).wFull(context),
Expand Down
8 changes: 4 additions & 4 deletions lib/views/home/bottom_bar.dart
Expand Up @@ -17,16 +17,16 @@ class BottomBar extends StatelessWidget {
label: "Home",
icon: Icon(CupertinoIcons.home),
),
const BottomNavigationBarItem(
label: "Twitter Search",
icon: Icon(CupertinoIcons.search),
),
const BottomNavigationBarItem(
label: "External Links", icon: Icon(CupertinoIcons.link)),
const BottomNavigationBarItem(
label: "Contribute",
icon: Icon(CupertinoIcons.add),
),
const BottomNavigationBarItem(
label: "CrowdFunding",
icon: Icon(CupertinoIcons.group),
),
],
),
);
Expand Down
37 changes: 22 additions & 15 deletions lib/views/home/dashboard.dart
Expand Up @@ -24,7 +24,7 @@ class Dashboard extends StatelessWidget {
"${Constants.imageAsset}mask-man.svg",
height: 100.0,
),
"Dashboard".text.bodyText2(context).xl4.semiBold.make(),
"Dashboard".text.bodyText2(context).xl4.extraBlack.make(),
].hStack(),
20.heightBox,
Wrap(
Expand All @@ -36,22 +36,25 @@ class Dashboard extends StatelessWidget {
title: Constants.plasmaDonors,
subtitle: stats?.plasmaDonors?.total?.toString(),
dense: Utils.getFormattedTime(stats?.plasmaDonors?.formattedTime),
color: Vx.emerald400,
color: Vx.emerald300,
titleColor: Vx.emerald700,
onTap: () => context.vxNav.push(Uri.parse(Routes.plasmaRoute)),
),
ActionCard(
title: Constants.hospitalWithBeds,
subtitle: stats?.hospitalBeds?.total?.toString(),
dense: Utils.getFormattedTime(stats?.hospitalBeds?.formattedTime),
color: Vx.pink400,
color: Vx.pink300,
titleColor: Vx.pink700,
onTap: () => context.vxNav.push(Uri.parse(Routes.hospitalRoute)),
),
ActionCard(
title: Constants.oxygenSuppliers,
subtitle: stats?.oxygenSuppliers?.total?.toString(),
dense:
Utils.getFormattedTime(stats?.oxygenSuppliers?.formattedTime),
color: Vx.cyan400,
color: Vx.yellow300,
titleColor: Vx.yellow700,
onTap: () => context.vxNav.push(Uri.parse(Routes.oxygenRoute)),
),
ActionCard(
Expand All @@ -60,21 +63,23 @@ class Dashboard extends StatelessWidget {
dense: stats?.medicines?.formattedTime != "NA"
? Utils.getFormattedTime(stats?.medicines?.formattedTime)
: stats?.medicines?.formattedTime,
color: Vx.amber400,
color: Vx.cyan300,
titleColor: Vx.cyan700,
onTap: () => context.vxNav.push(Uri.parse(Routes.medicineRoute)),
),
],
),
20.heightBox,
ActionCard(
title: Constants.twitterSearch,
subtitle2: Constants.twitterResources,
title: Constants.crowdFunding,
subtitle2: Constants.fundRaising,
iconOrImage: const Icon(
FontAwesome.twitter,
color: Vx.blue400,
FontAwesome.group,
color: Vx.blue300,
).pOnly(left: 8),
color: Vx.blue400,
onTap: () => context.vxNav.push(Uri.parse(Routes.twitterSearchRoute)),
color: Vx.blue300,
titleColor: Vx.blue700,
onTap: () => context.vxNav.push(Uri.parse(Routes.crowdFundingRoute)),
).wFull(context).pOnly(right: 30.0),
20.heightBox,
Link(
Expand All @@ -85,9 +90,10 @@ class Dashboard extends StatelessWidget {
subtitle2: Constants.vaccineSub,
iconOrImage: const Icon(
MaterialCommunityIcons.medical_bag,
color: Vx.rose400,
color: Vx.rose300,
).pOnly(left: 8),
color: Vx.rose400,
color: Vx.rose300,
titleColor: Vx.rose700,
onTap: followLink,
).wFull(context).pOnly(right: 30.0),
),
Expand All @@ -97,9 +103,10 @@ class Dashboard extends StatelessWidget {
subtitle2: Constants.careTips,
iconOrImage: const Icon(
AntDesign.Safety,
color: Vx.purple400,
color: Vx.purple300,
).pOnly(left: 8),
color: Vx.purple400,
color: Vx.purple300,
titleColor: Vx.purple700,
onTap: () => context.vxNav.push(Uri.parse(Routes.treatingCovidRoute)),
).wFull(context).pOnly(right: 30.0),
],
Expand Down
11 changes: 7 additions & 4 deletions lib/views/home/home_screen.dart
Expand Up @@ -7,6 +7,7 @@ import 'package:india_beats_covid/views/home/bottom_bar.dart';
import 'package:india_beats_covid/views/home/theme_button.dart';
import 'package:india_beats_covid/views/links/crowdfunding.dart';
import 'package:india_beats_covid/views/links/link_screen.dart';
import 'package:india_beats_covid/views/links/twitter_screen.dart';
import 'package:url_launcher/link.dart';

import '../../pkgs.dart';
Expand Down Expand Up @@ -65,11 +66,13 @@ class HomeScreen extends StatelessWidget {
return const CupertinoActivityIndicator().centered();
} else if (status == VxStatus.success) {
if (store.selectedIndex == 0)
return HomeWidgets();
return HomeWidgets().scrollVertical();
else if (store.selectedIndex == 1)
return TwitterScreen();
else if (store.selectedIndex == 2)
return LinkScreen();
else if (store.selectedIndex == 2) return AddAction();
return CrowdFunding();
else if (store.selectedIndex == 3) return AddAction();
return HomeWidgets();
} else if (status == VxStatus.error) {
return ErrorPage();
}
Expand All @@ -79,7 +82,7 @@ class HomeScreen extends StatelessWidget {
StatsMutation,
BottomBarMutation,
CheckVersionMutation
}).p16().scrollVertical(),
}).p16(),
);
}
}
2 changes: 1 addition & 1 deletion lib/views/links/crowdfunding.dart
Expand Up @@ -257,6 +257,6 @@ class CrowdFunding extends StatelessWidget {
),
),
],
).h(context.percentHeight * 80);
);
}
}

0 comments on commit d8b4d4d

Please sign in to comment.