|
|
|
|
@ -31,7 +31,7 @@ import 'landing_page_pharmcy.dart';
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
|
|
|
final Function goToMyProfile;
|
|
|
|
|
|
|
|
|
|
HomePage({Key key, this.goToMyProfile});
|
|
|
|
|
HomePage({Key? key, required this.goToMyProfile});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_HomePageState createState() => _HomePageState();
|
|
|
|
|
@ -86,7 +86,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white.withOpacity(0.3),
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5))),
|
|
|
|
|
child: (model.user != null && model.user.outSA == 1)
|
|
|
|
|
child: (model.user != null && model.user!.outSA == 1)
|
|
|
|
|
? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
@ -133,7 +133,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
elevation: 0,
|
|
|
|
|
disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38),
|
|
|
|
|
disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12),
|
|
|
|
|
onPressed: (model.user != null && model.user.outSA == 1)
|
|
|
|
|
onPressed: (model.user != null && model.user!.outSA == 1)
|
|
|
|
|
? () {}
|
|
|
|
|
: () {
|
|
|
|
|
navigateToCovidDriveThru();
|
|
|
|
|
@ -268,11 +268,11 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
model.user.cRSVerificationStatus == 2
|
|
|
|
|
model.user!.cRSVerificationStatus == 2
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
model.user.firstName + " " + model.user.lastName,
|
|
|
|
|
model.user!.firstName! + " " + model.user!.lastName!,
|
|
|
|
|
color: Colors.grey[100],
|
|
|
|
|
bold: true,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
@ -283,11 +283,11 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: model.user.cRSVerificationStatus == 3
|
|
|
|
|
: model.user!.cRSVerificationStatus == 3
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
model.user.firstName + " " + model.user.lastName,
|
|
|
|
|
model.user!.firstName! + " " + model.user!.lastName!,
|
|
|
|
|
color: Colors.grey[100],
|
|
|
|
|
bold: true,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
@ -301,7 +301,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
model.user.firstName + " " + model.user.lastName,
|
|
|
|
|
model.user!.firstName! + " " + model.user!.lastName!,
|
|
|
|
|
color: Colors.grey[100],
|
|
|
|
|
bold: true,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
@ -309,7 +309,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
'${model.user.patientID}',
|
|
|
|
|
'${model.user!.patientID!}',
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
@ -317,7 +317,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user.age.toString() + "y"}',
|
|
|
|
|
'${DateUtil.getMonthDayYearDateFormatted(model.user!.dateofBirthDataTime!)} ,${model.user!.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user!.age.toString() + "y"}',
|
|
|
|
|
color: Colors.grey[100],
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
@ -414,7 +414,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(projectViewModel.user)));
|
|
|
|
|
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(projectViewModel.user!)));
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
@ -447,7 +447,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
if (projectViewModel.havePrivilege(64))
|
|
|
|
|
DashboardItem(
|
|
|
|
|
onTap: (model.user != null && model.user.outSA == 1)
|
|
|
|
|
onTap: (model.user != null && model.user!.outSA == 1)
|
|
|
|
|
? () {}
|
|
|
|
|
: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
@ -459,8 +459,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
},
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
|
|
|
|
|
child: (model.user != null && model.user.outSA == 1)
|
|
|
|
|
padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
|
|
|
|
|
child: (model.user != null && model.user!.outSA == 1)
|
|
|
|
|
? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
@ -485,7 +485,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.55,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.55,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
@ -496,11 +496,11 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
if (projectViewModel.havePrivilege(65))
|
|
|
|
|
DashboardItem(
|
|
|
|
|
onTap: () => (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model),
|
|
|
|
|
onTap: () => (model.user != null && model.user!.outSA == 1) ? () {} : getPharmacyToken(model),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
|
|
|
|
|
child: (model.user != null && model.user.outSA == 1)
|
|
|
|
|
padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
|
|
|
|
|
child: (model.user != null && model.user!.outSA == 1)
|
|
|
|
|
? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
@ -531,7 +531,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.55,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.55,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -542,7 +542,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
if (projectViewModel.havePrivilege(67))
|
|
|
|
|
DashboardItem(
|
|
|
|
|
onTap: (model.user != null && model.user.outSA == 1)
|
|
|
|
|
onTap: (model.user != null && model.user!.outSA == 1)
|
|
|
|
|
? () {}
|
|
|
|
|
: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
@ -554,8 +554,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
},
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
|
|
|
|
|
child: (model.user != null && model.user.outSA == 1)
|
|
|
|
|
padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0),
|
|
|
|
|
child: (model.user != null && model.user!.outSA == 1)
|
|
|
|
|
? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
@ -580,7 +580,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.55,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.55,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
@ -621,7 +621,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
color: Colors.black87,
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.7,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.7,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -657,7 +657,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
color: Colors.black87,
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.7,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.7,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -698,7 +698,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
color: Colors.black87,
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.7,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.7,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -755,7 +755,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
height: 100,
|
|
|
|
|
imageName: 'contact_us_bg.png',
|
|
|
|
|
opacity: 0.5,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
color: Colors.grey[700]!,
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.45,
|
|
|
|
|
onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())),
|
|
|
|
|
),
|
|
|
|
|
@ -796,7 +796,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
height: 100,
|
|
|
|
|
imageName: 'contact_us_bg.png',
|
|
|
|
|
opacity: 0.5,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
color: Colors.grey[700]!,
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.45,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -833,22 +833,22 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class DashboardItem extends StatelessWidget {
|
|
|
|
|
const DashboardItem({this.hasBorder = false, this.imageName, @required this.child, this.onTap, Key key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true})
|
|
|
|
|
const DashboardItem({this.hasBorder = false, this.imageName, this.child, this.onTap, Key? key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
final bool hasBorder;
|
|
|
|
|
final String imageName;
|
|
|
|
|
final Widget child;
|
|
|
|
|
final Function onTap;
|
|
|
|
|
final double width;
|
|
|
|
|
final double height;
|
|
|
|
|
final Color color;
|
|
|
|
|
final double opacity;
|
|
|
|
|
final String? imageName;
|
|
|
|
|
final Widget? child;
|
|
|
|
|
final Function? onTap;
|
|
|
|
|
final double? width;
|
|
|
|
|
final double? height;
|
|
|
|
|
final Color? color;
|
|
|
|
|
final double? opacity;
|
|
|
|
|
final bool hasColorFilter;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
onTap: onTap!(),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: width != null ? width : MediaQuery.of(context).size.width * 0.29,
|
|
|
|
|
height: height != null
|
|
|
|
|
@ -860,7 +860,7 @@ class DashboardItem extends StatelessWidget {
|
|
|
|
|
color: !hasBorder
|
|
|
|
|
? color != null
|
|
|
|
|
? color
|
|
|
|
|
: Color(0xFF050705).withOpacity(opacity)
|
|
|
|
|
: Color(0xFF050705).withOpacity(opacity!)
|
|
|
|
|
: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(6.0),
|
|
|
|
|
border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent),
|
|
|
|
|
|