finish home-refactoring

merge-requests/648/head
mosazaid 5 years ago
parent f1babb776b
commit 4ce9a3c5bf

@ -28,7 +28,7 @@ class DashboardSliderItemWidget extends StatelessWidget {
child: new ListView( child: new ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: children:
new List.generate(item.summaryoptions.length, (int index) { List.generate(item.summaryoptions.length, (int index) {
return GetActivityButton(item.summaryoptions[index]); return GetActivityButton(item.summaryoptions[index]);
}))) })))
], ],

@ -26,8 +26,8 @@ class HomePageCard extends StatelessWidget {
child: Container( child: Container(
width: 100, width: 100,
height: MediaQuery.of(context).orientation == Orientation.portrait height: MediaQuery.of(context).orientation == Orientation.portrait
? 130 ? 100
: 250, : 200,
margin: this.margin, margin: this.margin,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder
@ -41,7 +41,7 @@ class HomePageCard extends StatelessWidget {
: Border.all(width: 0.0, color: Colors.transparent), : Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null image: imageName != null
? DecorationImage( ? DecorationImage(
image: AssetImage('assets/images/dashboard/${imageName}'), image: AssetImage('assets/images/dashboard/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: new ColorFilter.mode( colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn), Colors.black.withOpacity(0.2), BlendMode.dstIn),

@ -0,0 +1,83 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/screens/home/home_page_card.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class HomePatientCard extends StatelessWidget {
final Color backgroundColor;
final IconData cardIcon;
final Color backgroundIconColor;
final String text;
final Color textColor;
final Function onTap;
HomePatientCard({
@required this.backgroundColor,
@required this.backgroundIconColor,
@required this.cardIcon,
@required this.text,
@required this.textColor,
@required this.onTap,
});
@override
Widget build(BuildContext context) {
return HomePageCard(
color: backgroundColor,
margin: EdgeInsets.all(4),
child: Container(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
cardIcon,
size: 60,
color: backgroundIconColor,
),
),
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(
cardIcon,
size: 30,
color: textColor,
),
SizedBox(
height: 4,
),
],
),
),
],
),
),
Expanded(
child: Container(
child: AppText(
text,
color: textColor,
textAlign: TextAlign.start,
fontSize: SizeConfig.textMultiplier * 1.6,
),
),
),
],
),
),
hasBorder: false,
onTap: onTap,
);
}
}

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart';
import 'package:doctor_app_flutter/screens/home/home_patient_card.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart';
import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart';
@ -246,90 +247,44 @@ class _HomeScreenState extends State<HomeScreen> {
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Row(
children: <Widget>[
Container( Container(
width: 150,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Text( AppText(
TranslationBase.of(context).patients, TranslationBase.of(context).patients,
style: TextStyle(
fontSize: 12, fontSize: 12,
height: .5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins'), fontHeight: .5,
), ),
Text( AppText(
TranslationBase.of(context).services, TranslationBase.of(context).services,
style: TextStyle(
fontSize: 22, fontSize: 22,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins'),
), ),
], ],
)), )),
],
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
new Container( Container(
height: 130, height: 100,
child: new ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: [ children: [
HomePageCard( HomePatientCard(
color: Color(0xffD02127), backgroundColor: Color(0xffD02127),
margin: EdgeInsets.all(5), backgroundIconColor: Colors.white12,
child: Column( cardIcon: DoctorApp.inpatient,
mainAxisAlignment: textColor: Colors.white,
MainAxisAlignment.center, text:
crossAxisAlignment: TranslationBase.of(context).inPatient,
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp.inpatient,
size: 65,
color: Colors.white12,
),
),
Icon(
DoctorApp.inpatient,
size: 32,
color: Colors.white,
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.inPatient,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 15,
))
],
),
hasBorder: false,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -339,51 +294,13 @@ class _HomeScreenState extends State<HomeScreen> {
); );
}, },
), ),
HomePageCard( HomePatientCard(
color: Colors.grey[300], backgroundColor: Colors.grey[300],
margin: EdgeInsets.all(5), backgroundIconColor: Colors.white38,
child: Column( cardIcon: DoctorApp.arrival_patients,
mainAxisAlignment: textColor: Colors.black,
MainAxisAlignment.center, text: TranslationBase.of(context)
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp
.arrival_patients,
size: 65,
color: Colors.white38,
),
),
Icon(
DoctorApp.arrival_patients,
size: 35,
color: Colors.black,
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.myOutPatient, .myOutPatient,
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
))
],
),
hasBorder: false,
onTap: () { onTap: () {
String date = String date =
DateUtils.convertDateToFormat( DateUtils.convertDateToFormat(
@ -407,106 +324,30 @@ class _HomeScreenState extends State<HomeScreen> {
)); ));
}, },
), ),
HomePageCard( HomePatientCard(
color: Color(0xff2B353E), backgroundColor: Color(0xff2B353E),
margin: EdgeInsets.all(5), backgroundIconColor: Colors.white10,
child: Column( cardIcon: DoctorApp.referral_1,
mainAxisAlignment: textColor: Colors.white,
MainAxisAlignment.center, text: TranslationBase.of(context)
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp.referral_1,
size: 65,
color: Colors.white10
.withOpacity(0.1),
),
),
Icon(
DoctorApp.referral_1,
size: 35,
color: Colors.white,
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.patientsreferral, .patientsreferral,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 15,
))
],
),
hasBorder: false,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
PatientReferralScreen(), PatientReferralScreen(),
// MyReferredPatient(),
), ),
); );
}, },
), ),
HomePageCard( HomePatientCard(
color: Color(0xffD02127), backgroundColor: Color(0xffD02127),
margin: EdgeInsets.all(5), backgroundIconColor: Colors.white10,
child: Column( cardIcon: DoctorApp.search,
mainAxisAlignment: textColor: Colors.white,
MainAxisAlignment.center, text: TranslationBase.of(context)
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp.search,
size: 65,
color: Colors.white10,
),
),
Icon(
DoctorApp.search,
size: 35,
color: Colors.white,
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.searchPatient, .searchPatient,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 13,
))
],
),
hasBorder: false,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -516,51 +357,13 @@ class _HomeScreenState extends State<HomeScreen> {
)); ));
}, },
), ),
HomePageCard( HomePatientCard(
color: Color(0xffC9C9C9), backgroundColor: Color(0xffC9C9C9),
margin: EdgeInsets.all(5), backgroundIconColor: Colors.black12,
child: Column( cardIcon: DoctorApp.search_medicines,
mainAxisAlignment: textColor: Color(0xff2B353E),
MainAxisAlignment.center, text: TranslationBase.of(context)
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp
.search_medicines,
color: Colors.black12,
size: 65,
),
),
Icon(
DoctorApp.search_medicines,
size: 40,
color: Color(0xff2B353E),
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.searchMedicine, .searchMedicine,
color: Color(0xff2B353E),
textAlign: TextAlign.start,
fontSize: 13,
))
],
),
hasBorder: false,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -569,17 +372,8 @@ class _HomeScreenState extends State<HomeScreen> {
MedicineSearchScreen(), MedicineSearchScreen(),
)); ));
}, },
)
])),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 8,
),
],
), ),
])),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
@ -595,5 +389,4 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
); );
} }
} }

@ -17,17 +17,17 @@ class GetActivityButton extends StatelessWidget {
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(8),
child: AppText(value.value.toString(), child: AppText(value.value.toString(),
fontSize: 32, fontWeight: FontWeight.bold)), fontSize: 28, fontWeight: FontWeight.bold)),
Expanded( Expanded(
child: AppText( child: AppText(
value.kPIParameter, value.kPIParameter,
textOverflow: TextOverflow.clip, textOverflow: TextOverflow.clip,
fontSize: 12, fontSize: 10,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),

Loading…
Cancel
Save