Skip to content

Commit

Permalink
Added Select Plasma/Blood
Browse files Browse the repository at this point in the history
  • Loading branch information
niloysikdar committed May 2, 2021
1 parent d31f849 commit 77ae459
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 13 deletions.
26 changes: 14 additions & 12 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:plaso_connect/constants/colors.dart';
import 'package:plaso_connect/screens/homescreen.dart';
import 'package:plaso_connect/screens/selectplasma.dart';

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
Expand All @@ -18,19 +18,21 @@ Future<void> main() async {
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
textTheme: GoogleFonts.firaSansTextTheme(
Theme.of(context).textTheme,
return SafeArea(
child: MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
textTheme: GoogleFonts.firaSansTextTheme(
Theme.of(context).textTheme,
),
scaffoldBackgroundColor: kbackgroundLight,
primarySwatch: kelectronBlue,
accentColor: kelectronBlue,
primaryColor: kelectronBlue,
iconTheme: IconThemeData(color: kelectronBlue),
),
scaffoldBackgroundColor: kbackgroundLight,
primarySwatch: kelectronBlue,
accentColor: kelectronBlue,
primaryColor: kelectronBlue,
iconTheme: IconThemeData(color: kelectronBlue),
home: SelectPlasma(),
),
home: HomeScreen(),
);
}
}
3 changes: 2 additions & 1 deletion lib/screens/homescreen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:plaso_connect/constants/colors.dart';
import 'package:plaso_connect/screens/selectplasma.dart';
import 'package:plaso_connect/screens/statdashboard.dart';
import 'package:plaso_connect/widgets/boxdecoration.dart';

Expand Down Expand Up @@ -40,7 +41,7 @@ class HomeScreen extends StatelessWidget {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return TotalStatsDashboard();
return SelectPlasma();
}),
);
},
Expand Down
76 changes: 76 additions & 0 deletions lib/screens/selectplasma.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import 'package:flutter/material.dart';
import 'package:plaso_connect/constants/colors.dart';
import 'package:plaso_connect/screens/donorlist.dart';
import 'package:plaso_connect/screens/plasmaform.dart';
import 'package:plaso_connect/widgets/boxdecoration.dart';

class SelectPlasma extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 30, bottom: 15),
child: Text(
"Choose an option :",
style: TextStyle(
color: kelectronBlue,
fontSize: 22,
fontWeight: FontWeight.w600,
),
),
),
selectPlasmaButton(
text: "Donate Plasma/Blood",
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return PlasmaDonate();
}),
);
},
),
selectPlasmaButton(
text: "Availbe Donors",
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return DonorList();
}),
);
},
),
],
),
);
}

Widget selectPlasmaButton({
required String text,
required Function onTap,
}) {
return GestureDetector(
onTap: onTap as void Function()?,
child: Container(
margin: EdgeInsets.symmetric(horizontal: 30, vertical: 15),
padding: EdgeInsets.all(15),
decoration: newboxDecoration(),
child: Center(
child: Text(
text,
style: TextStyle(
color: kelectronBlue,
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
),
),
);
}
}

0 comments on commit 77ae459

Please sign in to comment.