Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlphamerc committed Apr 14, 2024
2 parents ccd7958 + 11112dc commit 0443489
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 431 deletions.
56 changes: 28 additions & 28 deletions lib/src/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> {
List<DoctorModel> doctorDataList;
@override
void initState() {
doctorDataList = doctorMapList.map((x)=> DoctorModel.fromJson(x)).toList();
void initState() {
doctorDataList = doctorMapList.map((x) => DoctorModel.fromJson(x)).toList();
super.initState();
}

Widget _appBar() {
return AppBar(
elevation: 0,
Expand Down Expand Up @@ -119,24 +120,29 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[
_categoryCard("Chemist & Drugist", "350 + Stores",
color: LightColor.green, lightColor: LightColor.lightGreen),
_categoryCard("Covid - 19 Specilist", "899 Doctors",
_categoryCard("Covid - 19 Specialist", "899 Doctors",
color: LightColor.skyBlue, lightColor: LightColor.lightBlue),
_categoryCard("Cardiologists Specilist", "500 + Doctors",
color: LightColor.orange, lightColor: LightColor.lightOrange)
_categoryCard("Cardiologists Specialist", "500 + Doctors",
color: LightColor.orange, lightColor: LightColor.lightOrange),
_categoryCard("Dermatologist", "300 + Doctors",
color: LightColor.green, lightColor: LightColor.lightGreen),
_categoryCard("General Surgeon", "500 + Doctors",
color: LightColor.skyBlue, lightColor: LightColor.lightBlue)
],
),
),
],
);
}

Widget _categoryCard(String title, String subtitle,{Color color, Color lightColor}) {
TextStyle titleStyle = TextStyles.title.bold.white;
TextStyle subtitleStyle = TextStyles.body.bold.white;
if(AppTheme.fullWidth(context) < 392){
titleStyle = TextStyles.body.bold.white;
subtitleStyle = TextStyles.bodySm.bold.white;
}
Widget _categoryCard(String title, String subtitle,
{Color color, Color lightColor}) {
TextStyle titleStyle = TextStyles.title.bold.white;
TextStyle subtitleStyle = TextStyles.body.bold.white;
if (AppTheme.fullWidth(context) < 392) {
titleStyle = TextStyles.body.bold.white;
subtitleStyle = TextStyles.bodySm.bold.white;
}
return AspectRatio(
aspectRatio: 6 / 8,
child: Container(
Expand Down Expand Up @@ -171,14 +177,9 @@ class _HomePageState extends State<HomePage> {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Flexible(
child: Text(
title,
style: titleStyle
).hP8,
),
SizedBox(
height: 10,
child: Text(title, style: titleStyle).hP8,
),
SizedBox(height: 10),
Flexible(
child: Text(
subtitle,
Expand Down Expand Up @@ -213,19 +214,18 @@ class _HomePageState extends State<HomePage> {
],
).hP16,
getdoctorWidgetList()


],
),
);
}
Widget getdoctorWidgetList(){
return Column(
children: doctorDataList.map((x){
return _doctorTile(x);
}).toList()
);

Widget getdoctorWidgetList() {
return Column(
children: doctorDataList.map((x) {
return _doctorTile(x);
}).toList());
}

Widget _doctorTile(DoctorModel model) {
return Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
Expand Down Expand Up @@ -268,7 +268,7 @@ class _HomePageState extends State<HomePage> {
),
title: Text(model.name, style: TextStyles.title.bold),
subtitle: Text(
model.type,
model.type,
style: TextStyles.bodySm.subTitleColor.bold,
),
trailing: Icon(
Expand Down
20 changes: 8 additions & 12 deletions lib/src/theme/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@ import 'light_color.dart';
class AppTheme {
const AppTheme();
static ThemeData lightTheme = ThemeData.light().copyWith(
backgroundColor: ColorResources.background,
primaryColor: ColorResources.themered,
cardTheme: CardTheme(color: ColorResources.background),
// textTheme: TextTheme(display1: TextStyle(color: ColorResources.black)),
iconTheme: IconThemeData(color: ColorResources.iconColor),
bottomAppBarColor: ColorResources.background,
dividerColor: ColorResources.grey,
// primaryTextTheme:
// TextTheme(body1: TextStyle(color: ColorResources.titleTextColor),
// ),
backgroundColor: LightColor.background,
primaryColor: LightColor.purple,
cardTheme: CardTheme(color: LightColor.background),
iconTheme: IconThemeData(color: LightColor.iconColor),
bottomAppBarColor: LightColor.background,
dividerColor: LightColor.grey,
);

static TextStyle titleStyle =
const TextStyle(color: ColorResources.titleTextColor, fontSize: 16);
const TextStyle(color: LightColor.titleTextColor, fontSize: 16);
static TextStyle subTitleStyle =
const TextStyle(color: ColorResources.subTitleTextColor, fontSize: 12);
const TextStyle(color: LightColor.subTitleTextColor, fontSize: 12);

static TextStyle h1Style =
const TextStyle(fontSize: 24, fontWeight: FontWeight.bold);
Expand Down
Loading

0 comments on commit 0443489

Please sign in to comment.