Home page 1.2
|
Before Width: | Height: | Size: 613 B After Width: | Height: | Size: 613 B |
|
Before Width: | Height: | Size: 843 B After Width: | Height: | Size: 843 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20.446" height="30.29" viewBox="0 0 20.446 30.29">
|
||||
<path id="man_4_" data-name="man (4)" d="M96.552,5.524c0,6.413,0,6.013,0,6.08a.283.283,0,0,1-.566-.019V9.165a4.549,4.549,0,0,0-4.543-4.543H85a4.549,4.549,0,0,0-4.543,4.543v2.421a.283.283,0,0,1-.566.019c0-.067,0,.345,0-6.241a2.212,2.212,0,0,1,1.866-2.182,5.5,5.5,0,0,1,5-3.182h4.266a5.524,5.524,0,0,1,5.524,5.524Zm-5.111.107H85a3.538,3.538,0,0,0-3.534,3.534c0,.015,0,4.187,0,4.2a6.752,6.752,0,0,0,13.5-.054V9.165a3.538,3.538,0,0,0-3.534-3.534Zm2.146,16.26v1.874a.5.5,0,0,0,.344.478A2.718,2.718,0,0,1,95.8,26.819v2.318a.516.516,0,0,1-.471.521.5.5,0,0,1-.538-.5v-2.3a1.728,1.728,0,0,0-1.652-1.739,1.706,1.706,0,0,0-1.755,1.7v2.318a.516.516,0,0,1-.471.521.5.5,0,0,1-.538-.5V26.819a2.718,2.718,0,0,1,1.864-2.577.5.5,0,0,0,.344-.478V21.59a.147.147,0,0,0-.235-.116c-4.129,3.148-3.884,3.011-4.119,3.01s.036.158-4.12-3.01a.146.146,0,0,0-.234.116v2.866a.5.5,0,0,0,.288.456,1.893,1.893,0,1,1-1.591,0,.505.505,0,0,0,.293-.457V21.882a.252.252,0,0,0-.28-.251A5.208,5.208,0,0,0,78,26.8v2.982a.5.5,0,0,0,.5.5H97.941a.5.5,0,0,0,.5-.5V26.779a5.21,5.21,0,0,0-4.577-5.139.252.252,0,0,0-.282.251Zm-5.058,1.221,2.693-2.053a.3.3,0,0,0-.28-.529,7.775,7.775,0,0,1-5.429,0,.3.3,0,0,0-.29.525l2.694,2.053a.5.5,0,0,0,.612,0ZM82.48,26.63a.883.883,0,1,0,.883-.883A.884.884,0,0,0,82.48,26.63Z" transform="translate(-78 0)" fill="#28323a"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,108 @@
|
||||
import 'package:diplomaticquarterapp/models/hmg_services.dart';
|
||||
import 'package:diplomaticquarterapp/pages/landing/widgets/pharmacy_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HomePageFragment extends StatefulWidget {
|
||||
@override
|
||||
_HomePageFragmentState createState() => _HomePageFragmentState();
|
||||
}
|
||||
|
||||
class _HomePageFragmentState extends State<HomePageFragment> {
|
||||
List<HmgServices> hmgServices = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
initialiseHmgServices(false);
|
||||
// getFamilyFiles();
|
||||
}
|
||||
|
||||
initialiseHmgServices(bool isLogin) {
|
||||
hmgServices.add(new HmgServices(0, "LiveCare ", "Online Consulting", "assets/images/new/Live_Care.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(1, "Covid Test", "Drive-Thru", "assets/images/new/covid_test_drive_thru.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(2, "Checkup", "Comprehensive", "assets/images/new/comprehensive_checkup.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(3, "HHC Home", "Health Care", "assets/images/new/HHC.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(4, "E-Refferal", "Services", "assets/images/new/E_Refferal.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(5, "RRT", "Emergency", "assets/images/new/RRT.svg", isLogin));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 2,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(14),
|
||||
child: SliderView(),
|
||||
// height: MediaQuery.of(context).size.width / 2.6,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20, right: 20),
|
||||
child: Image.asset("assets/images/bn_offer.png"),
|
||||
),
|
||||
mHeight(20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 20,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"HMG Services",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"View All Services",
|
||||
style: TextStyle(
|
||||
color: CustomColors.accentColor,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
mHeight(20),
|
||||
GridView.builder(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: hmgServices.length,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return ServicesView(hmgServices[index],index);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 20,
|
||||
),
|
||||
child: PharmacyView(),
|
||||
),
|
||||
mHeight(140),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,231 @@
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
||||
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/gradient_color.dart';
|
||||
import 'package:diplomaticquarterapp/models/hmg_services.dart';
|
||||
import 'package:diplomaticquarterapp/models/slider_data.dart';
|
||||
import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/landing/widgets/pharmacy_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart';
|
||||
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' as s;
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LoggedHomePageFragment extends StatefulWidget {
|
||||
ProjectViewModel projectViewModel;
|
||||
|
||||
LoggedHomePageFragment(this.projectViewModel);
|
||||
|
||||
@override
|
||||
_HomePageFragmentState createState() => _HomePageFragmentState();
|
||||
}
|
||||
|
||||
class _HomePageFragmentState extends State<LoggedHomePageFragment> {
|
||||
List<HmgServices> hmgServices = [];
|
||||
var familyFileProvider = FamilyFilesProvider();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
initialiseHmgServices(false);
|
||||
// getFamilyFiles();
|
||||
}
|
||||
|
||||
initialiseHmgServices(bool isLogin) {
|
||||
hmgServices.add(new HmgServices(0, "LiveCare ", "Online Consulting", "assets/images/new/Live_Care.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(1, "Covid Test", "Drive-Thru", "assets/images/new/covid_test_drive_thru.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(2, "Checkup", "Comprehensive", "assets/images/new/comprehensive_checkup.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(3, "HHC Home", "Health Care", "assets/images/new/HHC.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(4, "E-Refferal", "Services", "assets/images/new/E_Refferal.svg", isLogin));
|
||||
hmgServices.add(new HmgServices(5, "RRT", "Emergency", "assets/images/new/RRT.svg", isLogin));
|
||||
}
|
||||
|
||||
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
|
||||
if (widget.projectViewModel.user != null) {
|
||||
print("calling_family");
|
||||
|
||||
if (await s.sharedPref.getObject(FAMILY_FILE) != null) {
|
||||
// print(await sharedPref.getObject(FAMILY_FILE));
|
||||
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await s.sharedPref.getObject(FAMILY_FILE)));
|
||||
} else {
|
||||
return familyFileProvider.getSharedRecordByStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
|
||||
List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: widget.projectViewModel, context: context, count: appoCountProvider.count, isLogin: widget.projectViewModel.isLogin);
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
FutureBuilder(
|
||||
future: getFamilyFiles(), // async work
|
||||
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
|
||||
switch (snapshot.connectionState) {
|
||||
case ConnectionState.waiting:
|
||||
return Padding(padding: EdgeInsets.all(10), child: Text(''));
|
||||
default:
|
||||
if (snapshot.hasError)
|
||||
return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error));
|
||||
else {
|
||||
List<SliderData> sliderData = [];
|
||||
sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + widget.projectViewModel.user.patientID.toString(),
|
||||
widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor));
|
||||
for (int i = 0; i < snapshot.data.getAllSharedRecordsByStatusList.length; i++) {
|
||||
if (snapshot.data.getAllSharedRecordsByStatusList[i].status == 3)
|
||||
sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + snapshot.data.getAllSharedRecordsByStatusList[i].responseID.toString(),
|
||||
snapshot.data.getAllSharedRecordsByStatusList[i].patientName, "", bannerColor[i + 1].darkColor, bannerColor[i + 1].lightColor));
|
||||
}
|
||||
|
||||
return AspectRatio(
|
||||
aspectRatio: 2,
|
||||
child: CarouselSlider(
|
||||
options: CarouselOptions(
|
||||
autoPlay: false,
|
||||
enlargeCenterPage: true,
|
||||
initialPage: 0,
|
||||
aspectRatio: 2.5,
|
||||
viewportFraction: 0.9,
|
||||
enableInfiniteScroll: false,
|
||||
onPageChanged: (index, reason) {
|
||||
print("onPageChanged");
|
||||
}),
|
||||
items: [
|
||||
for (int i = 0; i < sliderData.length; i++)
|
||||
Builder(
|
||||
builder: (BuildContext context) {
|
||||
return LoggedSliderView(sliderData[i]);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.height * 0.143,
|
||||
child: ListView.separated(
|
||||
itemCount: 4,
|
||||
padding: EdgeInsets.zero,
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return Container(
|
||||
child: myMedicalList[index],
|
||||
margin: EdgeInsets.only(left: index == 0 ? 20 : 0, right: index == 3 ? 20 : 0),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return mWidth(12);
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 16,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
mFlex(1),
|
||||
Text(
|
||||
"View Medical File",
|
||||
style: TextStyle(
|
||||
color: CustomColors.accentColor,
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
mHeight(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20, right: 20),
|
||||
child: Image.asset("assets/images/bn_offer.png"),
|
||||
),
|
||||
mHeight(14),
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 20,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"HMG Services",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"View All Services",
|
||||
style: TextStyle(
|
||||
color: CustomColors.accentColor,
|
||||
decoration: TextDecoration.underline,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
mHeight(20),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.height * 0.143,
|
||||
child: ListView.separated(
|
||||
itemCount: hmgServices.length,
|
||||
padding: EdgeInsets.zero,
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.height * 0.143,
|
||||
margin: EdgeInsets.only(left: index == 0 ? 20 : 0, right: index == hmgServices.length - 1 ? 20 : 0),
|
||||
child: ServicesView(hmgServices[index], index),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return mWidth(12);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 20,
|
||||
),
|
||||
child: PharmacyView(),
|
||||
),
|
||||
mHeight(140),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||