map picker, firebase improvement and changes for v2.5

merge-requests/569/head
Sikander Saleem 4 years ago
parent 14b0c4c125
commit e3bf988df5

@ -5,12 +5,12 @@ import com.facebook.stetho.Stetho
import io.flutter.app.FlutterApplication import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService //import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
class Application : FlutterApplication(), PluginRegistrantCallback { class Application : FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
FlutterFirebaseMessagingService.setPluginRegistrant(this) // FlutterFirebaseMessagingService.setPluginRegistrant(this)
// Stetho.initializeWithDefaults(this); // Stetho.initializeWithDefaults(this);
// Create an InitializerBuilder // Create an InitializerBuilder
@ -38,7 +38,7 @@ class Application : FlutterApplication(), PluginRegistrantCallback {
} }
override fun registerWith(registry: PluginRegistry) { override fun registerWith(registry: PluginRegistry) {
io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin")); // io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
} }
} }

@ -2,14 +2,14 @@
package com.ejada.hmg package com.ejada.hmg
import io.flutter.plugin.common.PluginRegistry import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin //import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin
object FirebaseCloudMessagingPluginRegistrant { object FirebaseCloudMessagingPluginRegistrant {
fun registerWith(registry: PluginRegistry?) { fun registerWith(registry: PluginRegistry?) {
if (alreadyRegisteredWith(registry)) { if (alreadyRegisteredWith(registry)) {
return return
} }
FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin")) // FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"))
} }
private fun alreadyRegisteredWith(registry: PluginRegistry?): Boolean { private fun alreadyRegisteredWith(registry: PluginRegistry?): Boolean {

@ -134,7 +134,7 @@ class BaseAppClient {
print(jsonBody); print(jsonBody);
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -307,7 +307,7 @@ class BaseAppClient {
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -408,7 +408,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get( final response = await http.get(
url.trim(), Uri.parse(url.trim()),
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}, headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -450,7 +450,7 @@ class BaseAppClient {
var ss = json.encode(queryParams); var ss = json.encode(queryParams);
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: { final response = await http.get(Uri.parse(url.trim()), headers: {
'Content-Type': 'text/html; charset=utf-8', 'Content-Type': 'text/html; charset=utf-8',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
@ -494,7 +494,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.post( final response = await http.post(
url.trim(), Uri.parse(url.trim()),
body: json.encode(body), body: json.encode(body),
headers: headers, headers: headers,
); );
@ -526,7 +526,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.get( final response = await http.get(
url.trim(), Uri.parse(url.trim()),
headers: headers, headers: headers,
); );
@ -551,7 +551,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.put( final response = await http.put(
url.trim(), Uri.parse(url.trim()),
body: json.encode(body), body: json.encode(body),
headers: headers, headers: headers,
); );
@ -585,7 +585,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.delete( final response = await http.delete(
url.trim(), Uri.parse(url.trim()),
headers: headers, headers: headers,
); );
@ -726,7 +726,7 @@ class BaseAppClient {
var ss = json.encode(body); var ss = json.encode(body);
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), body: json.encode(body), headers: { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: {
// 'Content-Type': 'application/json', // 'Content-Type': 'application/json',
// 'Accept': 'application/json', // 'Accept': 'application/json',
// 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', // 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
@ -23,11 +24,17 @@ import 'core/viewModels/project_view_model.dart';
import 'locator.dart'; import 'locator.dart';
import 'pages/pharmacies/compare-list.dart'; import 'pages/pharmacies/compare-list.dart';
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp();
print("Handling a background message: ${message.messageId}");
}
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
FirebaseApp defaultApp = await Firebase.initializeApp(); // FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
await Firebase.initializeApp();
await setupLocator(); setupLocator();
runApp(MyApp()); runApp(MyApp());
} }
@ -41,9 +48,9 @@ class _MyApp extends State<MyApp> {
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
Future<void> checkForUpdate() async { Future<void> checkForUpdate() async { // todo need to verify 'imp'
InAppUpdate.checkForUpdate().then((info) { InAppUpdate.checkForUpdate().then((info) {
if (info.updateAvailable) { if (info.immediateUpdateAllowed) {
InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString()));
} }
}).catchError((e) { }).catchError((e) {

@ -63,7 +63,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
} }
_getCurrentLocation() async { _getCurrentLocation() async {
await getLastKnownPosition().then((value) { await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude; _latitude = value.latitude;
_longitude = value.longitude; _longitude = value.longitude;
}).catchError((e) { }).catchError((e) {
@ -89,7 +89,7 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
void showConfirmMessage(CMCViewModel model, GetCMCAllOrdersResponseModel order) { void showConfirmMessage(CMCViewModel model, GetCMCAllOrdersResponseModel order) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg, message: TranslationBase.of(context).cancelOrderMsg,
onTap: () async { onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);

@ -1,14 +1,11 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart'; import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/photo_view_page.dart'; import 'package:diplomaticquarterapp/widgets/photo_view_page.dart';
@ -125,7 +122,10 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
), ),
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: IconButton( child: IconButton(
icon: SvgPicture.asset("assets/images/new/ic_zoom.svg",color: Colors.white,), icon: SvgPicture.asset(
"assets/images/new/ic_zoom.svg",
color: Colors.white,
),
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
onPressed: () { onPressed: () {
showDraggableDialog(context, PhotoViewPage(projectViewModel.isArabic ? "assets/images/cc_ar.png" : "assets/images/cc_en.png")); showDraggableDialog(context, PhotoViewPage(projectViewModel.isArabic ? "assets/images/cc_ar.png" : "assets/images/cc_en.png"));
@ -162,9 +162,9 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList];
await widget.model.getCustomerInfo(); await widget.model.getCustomerInfo();
// if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(); Utils.showErrorToast();
// } else { } else {
navigateTo( navigateTo(
context, context,
NewCMCStepTowPage( NewCMCStepTowPage(
@ -174,7 +174,7 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
model: widget.model, model: widget.model,
), ),
); );
// } }
} }
}, },
), ),

@ -284,7 +284,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
void confirmSelectLocationDialog(List<AddressInfo> addresses) { void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog( showDialog(
context: context, context: context,
child: SelectLocationDialog( builder: (cxt) => SelectLocationDialog(
addresses: addresses, addresses: addresses,
selectedAddress: _selectedAddress, selectedAddress: _selectedAddress,
onValueSelected: (value) { onValueSelected: (value) {

@ -32,7 +32,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
void showConfirmMessage(CMCViewModel model, GetCMCAllOrdersResponseModel order) { void showConfirmMessage(CMCViewModel model, GetCMCAllOrdersResponseModel order) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg, message: TranslationBase.of(context).cancelOrderMsg,
onTap: () { onTap: () {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);

@ -238,7 +238,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
void confirmSelectRelationTypeDialog(List<GetAllRelationshipTypeResponseModel> relations) { void confirmSelectRelationTypeDialog(List<GetAllRelationshipTypeResponseModel> relations) {
showDialog( showDialog(
context: context, context: context,
child: SelectRelationTypeDialog( builder: (cxt) => SelectRelationTypeDialog(
relationTypes: relations, relationTypes: relations,
selectedRelation: _selectedRelation, selectedRelation: _selectedRelation,
onValueSelected: (value) { onValueSelected: (value) {

@ -459,7 +459,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) { void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) {
showDialog( showDialog(
context: context, context: context,
child: SelectCityDialog( builder: (cxt) => SelectCityDialog(
cities: cities, cities: cities,
selectedCity: _selectedCity, selectedCity: _selectedCity,
onValueSelected: (value) { onValueSelected: (value) {

@ -270,7 +270,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) { void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) {
showDialog( showDialog(
context: context, context: context,
child: SelectCityDialog( builder: (cxt) => SelectCityDialog(
cities: cities, cities: cities,
selectedCity: _selectedCity, selectedCity: _selectedCity,
onValueSelected: (value) { onValueSelected: (value) {
@ -285,7 +285,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
void confirmSelectCountryTypeDialog() { void confirmSelectCountryTypeDialog() {
showDialog( showDialog(
context: context, context: context,
child: SelectCountryDialog( builder: (cxt) => SelectCountryDialog(
selectedCountry: _selectedCountry, selectedCountry: _selectedCountry,
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {

@ -89,7 +89,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
} }
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: selectedCriteria.value, selectedIndex: selectedCriteria.value,
onValueSelected: (index) { onValueSelected: (index) {
@ -229,7 +229,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
void confirmSelectCountryTypeDialog() { void confirmSelectCountryTypeDialog() {
showDialog( showDialog(
context: context, context: context,
child: SelectCountryDialog( builder: (cxt) => SelectCountryDialog(
selectedCountry: _selectedCountry, selectedCountry: _selectedCountry,
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {

@ -7,7 +7,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -46,90 +46,81 @@ class _LocationPageState extends State<LocationPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<HomeHealthCareViewModel>( return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {}, onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).addAddress, appBarTitle: TranslationBase.of(context).addAddress,
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
body: PlacePicker( body: PlacePicker(
apiKey: GOOGLE_API_KEY, apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true, enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false, automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true, autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true, selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true, enableMapTypeButton: true,
searchForInitialValue: false, searchForInitialValue: false,
onPlacePicked: (PickResult result) { onPlacePicked: (PickResult result) {
print(result.adrAddress); print("onPlacePickedonPlacePickedonPlacePickedonPlacePicked");
}, print(result.adrAddress);
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { },
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
return isSearchBarFocused return isSearchBarFocused
? Container() ? Container()
: FloatingCard( : FloatingCard(
bottomPosition: 0.0, bottomPosition: 0.0,
leftPosition: 0.0, leftPosition: 0.0,
rightPosition: 0.0, rightPosition: 0.0,
width: 500, width: 500,
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(0.0),
child: state == SearchingState.Searching child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator()) ? SizedBox(height: 43,child: Center(child: CircularProgressIndicator())).insideContainer
: Container( : DefaultButton(TranslationBase.of(context).addNewAddress, () async {
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () async {
AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1: selectedPlace.formattedAddress,
address2: selectedPlace.formattedAddress,
customerAttributes: "",
city: "",
createdOnUtc: "",
id: 0,
latLong: "$latitude,$longitude",
email: "")
]),
);
selectedPlace.addressComponents.forEach((e) { // print();
if (e.types.contains("country")) { AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
addNewAddressRequestModel.customer.addresses[0].country = e.longName; customer: Customer(addresses: [
} Addresses(
if (e.types.contains("postal_code")) { address1: selectedPlace.formattedAddress,
addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName; address2: selectedPlace.formattedAddress,
} customerAttributes: "",
if (e.types.contains("locality")) { city: "",
addNewAddressRequestModel.customer.addresses[0].city = e.longName; createdOnUtc: "",
} id: 0,
}); latLong: "${selectedPlace.geometry.location}",
email: "")
]),
);
await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); selectedPlace.addressComponents.forEach((e) {
if (model.state == ViewState.ErrorLocal) { if (e.types.contains("country")) {
Utils.showErrorToast(model.error); addNewAddressRequestModel.customer.addresses[0].country = e.longName;
} else { }
AppToast.showSuccessToast(message: "Address Added Successfully"); if (e.types.contains("postal_code")) {
} addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
Navigator.of(context).pop(addNewAddressRequestModel); }
}, if (e.types.contains("locality")) {
label: TranslationBase.of(context).addNewAddress, addNewAddressRequestModel.customer.addresses[0].city = e.longName;
), }
], });
),
), await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
); if (model.state == ViewState.ErrorLocal) {
}, Utils.showErrorToast(model.error);
initialPosition: LatLng(latitude, longitude), } else {
useCurrentLocation: showCurrentLocation, AppToast.showSuccessToast(message: "Address Added Successfully");
), }
)); Navigator.of(context).pop(addNewAddressRequestModel);
}).insideContainer
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: showCurrentLocation,
),
),
);
} }
} }

@ -279,7 +279,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
void confirmSelectLocationDialog(List<AddressInfo> addresses) { void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog( showDialog(
context: context, context: context,
child: SelectLocationDialog( builder: (cxt) => SelectLocationDialog(
addresses: addresses, addresses: addresses,
selectedAddress: _selectedAddress, selectedAddress: _selectedAddress,
onValueSelected: (value) { onValueSelected: (value) {

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
@ -41,7 +40,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
} }
_getCurrentLocation() async { _getCurrentLocation() async {
await getLastKnownPosition().then((value) { await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude; _latitude = value.latitude;
_longitude = value.longitude; _longitude = value.longitude;
}).catchError((e) { }).catchError((e) {
@ -67,22 +66,22 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
void showConfirmMessage(HomeHealthCareViewModel model, GetCMCAllOrdersResponseModel order) { void showConfirmMessage(HomeHealthCareViewModel model, GetCMCAllOrdersResponseModel order) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg, message: TranslationBase.of(context).cancelOrderMsg,
onTap: () async { onTap: () async {
model.setState(ViewState.Busy); model.setState(ViewState.Busy);
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
await model.updateHHCPresOrder(updatePresOrderRequestModel); await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders(); await model.getHHCAllPresOrders();
// await model.getHHCAllServices(); // await model.getHHCAllServices();
} }
}, },
)); ));
} }
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);

@ -28,7 +28,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
void showConfirmMessage(HomeHealthCareViewModel model, GetCMCAllOrdersResponseModel order) { void showConfirmMessage(HomeHealthCareViewModel model, GetCMCAllOrdersResponseModel order) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg, message: TranslationBase.of(context).cancelOrderMsg,
onTap: () async { onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);

@ -271,7 +271,7 @@ class _H2oSettingState extends State<H2oSetting> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedActiveLevel, selectedIndex: _selectedActiveLevel,
onValueSelected: (index) { onValueSelected: (index) {
@ -300,7 +300,7 @@ class _H2oSettingState extends State<H2oSetting> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedRemindedTime, selectedIndex: _selectedRemindedTime,
onValueSelected: (index) { onValueSelected: (index) {

@ -341,7 +341,7 @@ class _TodayPageState extends State<TodayPage> {
String title = "${TranslationBase.of(context).areyousure} $amount ${(isUnitML ? TranslationBase.of(context).ml : TranslationBase.of(context).l).toLowerCase()} ?"; String title = "${TranslationBase.of(context).areyousure} $amount ${(isUnitML ? TranslationBase.of(context).ml : TranslationBase.of(context).l).toLowerCase()} ?";
await showDialog( await showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: title, message: title,
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -149,7 +149,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedHospitalIndex, selectedIndex: _selectedHospitalIndex,
isScrollable: true, isScrollable: true,
@ -170,7 +170,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedGenderIndex, selectedIndex: _selectedGenderIndex,
onValueSelected: (index) { onValueSelected: (index) {
@ -195,7 +195,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedBloodTypeIndex, selectedIndex: _selectedBloodTypeIndex,
isScrollable: true, isScrollable: true,

@ -44,7 +44,7 @@ class ConfirmPaymentPage extends StatelessWidget {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
child: ConfirmSMSDialog( builder: (cxt) => ConfirmSMSDialog(
phoneNumber: patientInfoAndMobileNumber.mobileNumber, phoneNumber: patientInfoAndMobileNumber.mobileNumber,
), ),
).then((value) { ).then((value) {

@ -192,7 +192,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.body2 .bodyText2
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[

@ -43,20 +43,20 @@ Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String
onClick: (int i) async { onClick: (int i) async {
if (i == 0) { if (i == 0) {
// Before 30 mints // Before 30 mints
dateTime = Jiffy(dateTime).subtract(minutes: 30); dateTime = Jiffy(dateTime).subtract(minutes: 30).dateTime;
// dateTime.add(new Duration(minutes: -30)); // dateTime.add(new Duration(minutes: -30));
} else if (i == 1) { } else if (i == 1) {
// Before 1 hour // Before 1 hour
// dateTime.add(new Duration(minutes: -60)); // dateTime.add(new Duration(minutes: -60));
dateTime = Jiffy(dateTime).subtract(hours: 1); dateTime = Jiffy(dateTime).subtract(hours: 1).dateTime;
} else if (i == 2) { } else if (i == 2) {
// Before 1 hour and 30 mints // Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90)); // dateTime.add(new Duration(minutes: -90));
dateTime = Jiffy(dateTime).subtract(hours: 1, minutes: 30); dateTime = Jiffy(dateTime).subtract(hours: 1, minutes: 30).dateTime;
} else if (i == 3) { } else if (i == 3) {
// Before 2 hours // Before 2 hours
// dateTime.add(new Duration(minutes: -120)); // dateTime.add(new Duration(minutes: -120));
dateTime = Jiffy(dateTime).subtract(hours: 2); dateTime = Jiffy(dateTime).subtract(hours: 2).dateTime;
} }
if (onMultiDateSuccess == null) { if (onMultiDateSuccess == null) {
CalendarUtils calendarUtils = await CalendarUtils.getInstance(); CalendarUtils calendarUtils = await CalendarUtils.getInstance();

@ -300,7 +300,7 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
void confirmSelectDayDialog() { void confirmSelectDayDialog() {
showDialog( showDialog(
context: context, context: context,
child: DayCheckBoxDialog( builder: (cxt) => DayCheckBoxDialog(
title: 'Select Day', title: 'Select Day',
selectedDaysOfWeek: widget.daysOfWeek, selectedDaysOfWeek: widget.daysOfWeek,
onValueSelected: (value) { onValueSelected: (value) {

@ -145,7 +145,7 @@ class VaccinationTablePage extends StatelessWidget {
//=============== //===============
showDialog( showDialog(
context: context, context: context,
child: SelectGenderDialog( builder: (cxt) => SelectGenderDialog(
okFunction: () async { okFunction: () async {
await model.getCreateVaccinationTable(babyInfo, true); await model.getCreateVaccinationTable(babyInfo, true);
if (model.state == ViewState.Idle) { if (model.state == ViewState.Idle) {

@ -595,7 +595,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
deleteFamily(family, context) { deleteFamily(family, context) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).removeFamilyMember, message: TranslationBase.of(context).removeFamilyMember,
onTap: () { onTap: () {
removeFamily(family, context); removeFamily(family, context);

@ -1,9 +1,6 @@
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -17,9 +14,7 @@ class NotificationsDetailsPage extends StatelessWidget {
DateTime d = DateUtil.convertStringToDate(date); DateTime d = DateUtil.convertStringToDate(date);
String monthName = DateUtil.getMonth(d.month).toString(); String monthName = DateUtil.getMonth(d.month).toString();
TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute); TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute);
String minute = timeOfDay.minute < 10 String minute = timeOfDay.minute < 10 ? timeOfDay.minute.toString().padLeft(2, '0') : timeOfDay.minute.toString();
? timeOfDay.minute.toString().padLeft(2, '0')
: timeOfDay.minute.toString();
String hour = '${timeOfDay.hourOfPeriod}:$minute'; String hour = '${timeOfDay.hourOfPeriod}:$minute';
if (timeOfDay.period == DayPeriod.am) { if (timeOfDay.period == DayPeriod.am) {
@ -39,67 +34,50 @@ class NotificationsDetailsPage extends StatelessWidget {
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).notificationDetails, appBarTitle: TranslationBase.of(context).notificationDetails,
body: SingleChildScrollView( body: ListView(
child: Center( physics: BouncingScrollPhysics(),
child: FractionallySizedBox( padding: EdgeInsets.all(21),
widthFactor: 0.9, children: [
child: Column( Text(
children: [ DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) +
SizedBox( " " +
height: 25, DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false),
), style: TextStyle(
Container( fontSize: 16,
width: double.infinity, fontWeight: FontWeight.w600,
child: Padding( color: Color(0xff2E303A),
padding: const EdgeInsets.all(8.0), letterSpacing: -0.64,
child: Text( ),
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), ),
style: TextStyle(
fontSize: 18.0, if (notification.messageTypeData.length != 0)
color: Colors.black, Padding(
fontWeight: FontWeight.w600 padding: const EdgeInsets.only(top: 18),
), child: Image.network(notification.messageTypeData, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent loadingProgress) {
), if (loadingProgress == null) return child;
), return Center(
), child: SizedBox(
SizedBox( width: 40.0,
height: 15, height: 40.0,
), child: AppCircularProgressIndicator(),
if (notification.messageTypeData.length != 0)
FractionallySizedBox(
widthFactor: 0.9,
child: Image.network(notification.messageTypeData,
loadingBuilder: (BuildContext context, Widget child,
ImageChunkEvent loadingProgress) {
if (loadingProgress == null) return child;
return Center(
child: SizedBox(
width: 40.0,
height: 40.0,
child: AppCircularProgressIndicator(),
),
);
},
fit: BoxFit
.fill) //Image.network(notification.messageTypeData),
),
SizedBox(
height: 15,
),
Row(
children: [
Expanded(
child: Center(
child: Text(notification.message),
),
),
],
), ),
], );
), }, fit: BoxFit.fill),
),
SizedBox(height: 18),
Text(
notification.message.trim(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.48,
), ),
), ),
),
],
),
); );
} }
} }

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -36,6 +35,7 @@ class NotificationsPage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).notifications, appBarTitle: TranslationBase.of(context).notifications,
baseViewModel: model, baseViewModel: model,
body: ListView.separated( body: ListView.separated(
physics: BouncingScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index == model.notifications.length) { if (index == model.notifications.length) {
return InkWell( return InkWell(
@ -47,87 +47,90 @@ class NotificationsPage extends StatelessWidget {
await model.getNotifications(getNotificationsRequestModel, context); await model.getNotifications(getNotificationsRequestModel, context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
child: Center( child: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
// Image.asset('assets/images/notf.png'),
Icon( Icon(
Icons.notifications_active, Icons.notifications_active,
color: CustomColors.accentColor, color: CustomColors.accentColor,
size: 40, size: 24,
),
Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(TranslationBase.of(context).moreNotifications,
style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)),
), ),
SizedBox(width: 8),
Text(TranslationBase.of(context).moreNotifications,
style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.42, decoration: TextDecoration.underline)),
], ],
), ),
), ),
); );
} }
return InkWell( return InkWell(
onTap: () async { onTap: () async {
if (!model.notifications[index].isRead) { if (!model.notifications[index].isRead) {
model.markAsRead(model.notifications[index].id); model.markAsRead(model.notifications[index].id);
} }
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: NotificationsDetailsPage( page: NotificationsDetailsPage(
notification: model.notifications[index], notification: model.notifications[index],
))); ),
),
);
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(8.0), padding: EdgeInsets.fromLTRB(15.0, 14, 21, 12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05),
border: projectViewModel.isArabic border: projectViewModel.isArabic
? Border( ? Border(
right: BorderSide( right: BorderSide(
color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor,
width: 5.0, width: 6.0,
), ),
) )
: Border( : Border(
left: BorderSide( left: BorderSide(
color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor,
width: 5.0, width: 6.0,
), ),
), ),
), ),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Row(
child: Padding( children: [
padding: const EdgeInsets.all(8.0), Expanded(
child: Column( child: Text(
crossAxisAlignment: CrossAxisAlignment.start, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) +
children: <Widget>[
Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) +
" " + " " +
DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false)), DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false),
SizedBox( style: TextStyle(
height: 5, fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64,
), ),
Row( ),
children: [
Expanded(child: Texts(model.notifications[index].message)),
if (model.notifications[index].messageType == "image")
Icon(
FontAwesomeIcons.images,
color: CustomColors.grey,
)
],
),
SizedBox(
height: 5,
),
],
), ),
if (model.notifications[index].messageType == "image")
Icon(
FontAwesomeIcons.image,
color: Color(0xffC9C9C9),
)
],
),
SizedBox(height: 4),
Text(
model.notifications[index].message.trim(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.48,
), ),
), ),
], ],
@ -139,8 +142,9 @@ class NotificationsPage extends StatelessWidget {
return Column( return Column(
children: [ children: [
Divider( Divider(
color: Colors.grey[300], color: Color(0xffEFEFEF),
thickness: 2.0, thickness: 2.0,
height: 1,
), ),
], ],
); );

@ -376,7 +376,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
void showConfirmMessage(AmRequestViewModel model, int presOrderID, BuildContext context) { void showConfirmMessage(AmRequestViewModel model, int presOrderID, BuildContext context) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg, message: TranslationBase.of(context).cancelOrderMsg,
onTap: () { onTap: () {
Future.delayed(new Duration(milliseconds: 300)).then((value) async { Future.delayed(new Duration(milliseconds: 300)).then((value) async {

@ -54,7 +54,7 @@ class _PickupLocationState extends State<PickupLocation> {
} }
_getCurrentLocation() async { _getCurrentLocation() async {
await getLastKnownPosition().then((value) { await Geolocator.getLastKnownPosition().then((value) {
_latitude = value.latitude; _latitude = value.latitude;
_longitude = value.longitude; _longitude = value.longitude;
}).catchError((e) { }).catchError((e) {
@ -561,7 +561,7 @@ class _PickupLocationState extends State<PickupLocation> {
]; ];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedHospitalIndex, selectedIndex: _selectedHospitalIndex,
isScrollable: true, isScrollable: true,

@ -26,7 +26,7 @@ class OrderLogPage extends StatelessWidget {
void showConfirmMessage(AmRequestViewModel model, int presOrderID, BuildContext context) { void showConfirmMessage(AmRequestViewModel model, int presOrderID, BuildContext context) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg, message: TranslationBase.of(context).cancelOrderMsg,
onTap: () { onTap: () {
Future.delayed(new Duration(milliseconds: 300)).then((value) async { Future.delayed(new Duration(milliseconds: 300)).then((value) async {

@ -267,7 +267,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
void confirmSelectLocationDialog(List<AddressInfo> addresses) { void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog( showDialog(
context: context, context: context,
child: SelectLocationDialog( builder: (cxt) => SelectLocationDialog(
addresses: addresses, addresses: addresses,
selectedAddress: selectedAddress, selectedAddress: selectedAddress,
onValueSelected: (value) { onValueSelected: (value) {

@ -1,390 +1,390 @@
import 'dart:async'; // import 'dart:async';
//
import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart'; // import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart';
import 'package:diplomaticquarterapp/pages/conference/conference_button_bar.dart'; // import 'package:diplomaticquarterapp/pages/conference/conference_button_bar.dart';
import 'package:diplomaticquarterapp/pages/conference/conference_room.dart'; // import 'package:diplomaticquarterapp/pages/conference/conference_room.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; // import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/conference/draggable_publisher.dart'; // import 'package:diplomaticquarterapp/pages/conference/draggable_publisher.dart';
import 'package:diplomaticquarterapp/pages/conference/participant_widget.dart'; // import 'package:diplomaticquarterapp/pages/conference/participant_widget.dart';
import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; // import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart';
import 'package:diplomaticquarterapp/pages/conference/widgets/platform_alert_dialog.dart'; // import 'package:diplomaticquarterapp/pages/conference/widgets/platform_alert_dialog.dart';
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; // import 'package:flutter/services.dart';
import 'package:wakelock/wakelock.dart'; // import 'package:wakelock/wakelock.dart';
//
class ConferencePage extends StatefulWidget { // class ConferencePage extends StatefulWidget {
final RoomModel roomModel; // final RoomModel roomModel;
//
const ConferencePage({Key key, this.roomModel}) : super(key: key); // const ConferencePage({Key key, this.roomModel}) : super(key: key);
//
@override // @override
_ConferencePageState createState() => _ConferencePageState(); // _ConferencePageState createState() => _ConferencePageState();
} // }
//
class _ConferencePageState extends State<ConferencePage> { // class _ConferencePageState extends State<ConferencePage> {
final StreamController<bool> _onButtonBarVisibleStreamController = StreamController<bool>.broadcast(); // final StreamController<bool> _onButtonBarVisibleStreamController = StreamController<bool>.broadcast();
final StreamController<double> _onButtonBarHeightStreamController = StreamController<double>.broadcast(); // final StreamController<double> _onButtonBarHeightStreamController = StreamController<double>.broadcast();
ConferenceRoom _conferenceRoom; // // ConferenceRoom _conferenceRoom;
StreamSubscription _onConferenceRoomException; // StreamSubscription _onConferenceRoomException;
//
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
_lockInPortrait(); // _lockInPortrait();
_connectToRoom(); // _connectToRoom();
_wakeLock(true); // _wakeLock(true);
} // }
//
void _connectToRoom() async { // void _connectToRoom() async {
try { // try {
final conferenceRoom = ConferenceRoom( // final conferenceRoom = ConferenceRoom(
name: widget.roomModel.name, // name: widget.roomModel.name,
token: widget.roomModel.token, // token: widget.roomModel.token,
identity: widget.roomModel.identity, // identity: widget.roomModel.identity,
); // );
await conferenceRoom.connect(); // await conferenceRoom.connect();
setState(() { // setState(() {
_conferenceRoom = conferenceRoom; // _conferenceRoom = conferenceRoom;
_onConferenceRoomException = _conferenceRoom.onException.listen((err) async { // _onConferenceRoomException = _conferenceRoom.onException.listen((err) async {
await PlatformAlertDialog( // await PlatformAlertDialog(
title: err is PlatformException ? err.message : 'An error occured', // title: err is PlatformException ? err.message : 'An error occured',
content: err is PlatformException ? err.details : err.toString(), // content: err is PlatformException ? err.details : err.toString(),
defaultActionText: 'OK', // defaultActionText: 'OK',
).show(context); // ).show(context);
}); // });
_conferenceRoom.addListener(_conferenceRoomUpdated); // _conferenceRoom.addListener(_conferenceRoomUpdated);
}); // });
} catch (err) { // } catch (err) {
print(err); // print(err);
await PlatformAlertDialog( // await PlatformAlertDialog(
title: err is PlatformException ? err.message : 'An error occured', // title: err is PlatformException ? err.message : 'An error occured',
content: err is PlatformException ? err.details : err.toString(), // content: err is PlatformException ? err.details : err.toString(),
defaultActionText: 'OK', // defaultActionText: 'OK',
).show(context); // ).show(context);
//
Navigator.of(context).pop(); // Navigator.of(context).pop();
} // }
} // }
//
Future<void> _lockInPortrait() async { // Future<void> _lockInPortrait() async {
await SystemChrome.setPreferredOrientations(<DeviceOrientation>[ // await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
DeviceOrientation.portraitUp, // DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown, // DeviceOrientation.portraitDown,
]); // ]);
} // }
//
@override // @override
void dispose() { // void dispose() {
_freePortraitLock(); // _freePortraitLock();
_wakeLock(false); // _wakeLock(false);
_disposeStreamsAndSubscriptions(); // _disposeStreamsAndSubscriptions();
if (_conferenceRoom != null) _conferenceRoom.removeListener(_conferenceRoomUpdated); // if (_conferenceRoom != null) _conferenceRoom.removeListener(_conferenceRoomUpdated);
super.dispose(); // super.dispose();
} // }
//
Future<void> _freePortraitLock() async { // Future<void> _freePortraitLock() async {
await SystemChrome.setPreferredOrientations(<DeviceOrientation>[ // await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
DeviceOrientation.landscapeRight, // DeviceOrientation.landscapeRight,
DeviceOrientation.landscapeLeft, // DeviceOrientation.landscapeLeft,
DeviceOrientation.portraitUp, // DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown, // DeviceOrientation.portraitDown,
]); // ]);
} // }
//
Future<void> _disposeStreamsAndSubscriptions() async { // Future<void> _disposeStreamsAndSubscriptions() async {
if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close(); // if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close();
if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close(); // if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close();
if (_onConferenceRoomException != null) await _onConferenceRoomException.cancel(); // if (_onConferenceRoomException != null) await _onConferenceRoomException.cancel();
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return WillPopScope( // return WillPopScope(
onWillPop: () async => false, // onWillPop: () async => false,
child: Scaffold( // child: Scaffold(
backgroundColor: Colors.white, // backgroundColor: Colors.white,
body: _conferenceRoom == null ? showProgress() : buildLayout(), // body: _conferenceRoom == null ? showProgress() : buildLayout(),
), // ),
); // );
} // }
//
LayoutBuilder buildLayout() { // LayoutBuilder buildLayout() {
return LayoutBuilder( // return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) { // builder: (BuildContext context, BoxConstraints constraints) {
return Stack( // return Stack(
children: <Widget>[ // children: <Widget>[
_buildParticipants(context, constraints.biggest, _conferenceRoom), // _buildParticipants(context, constraints.biggest, _conferenceRoom),
ConferenceButtonBar( // ConferenceButtonBar(
audioEnabled: _conferenceRoom.onAudioEnabled, // audioEnabled: _conferenceRoom.onAudioEnabled,
videoEnabled: _conferenceRoom.onVideoEnabled, // videoEnabled: _conferenceRoom.onVideoEnabled,
onAudioEnabled: _conferenceRoom.toggleAudioEnabled, // onAudioEnabled: _conferenceRoom.toggleAudioEnabled,
onVideoEnabled: _conferenceRoom.toggleVideoEnabled, // onVideoEnabled: _conferenceRoom.toggleVideoEnabled,
onHangup: _onHangup, // onHangup: _onHangup,
onSwitchCamera: _conferenceRoom.switchCamera, // onSwitchCamera: _conferenceRoom.switchCamera,
onPersonAdd: _onPersonAdd, // onPersonAdd: _onPersonAdd,
onPersonRemove: _onPersonRemove, // onPersonRemove: _onPersonRemove,
onHeight: _onHeightBar, // onHeight: _onHeightBar,
onShow: _onShowBar, // onShow: _onShowBar,
onHide: _onHideBar, // onHide: _onHideBar,
), // ),
], // ],
); // );
}, // },
); // );
} // }
//
Widget showProgress() { // Widget showProgress() {
return Column( // return Column(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ // children: <Widget>[
Center(child: CircularProgressIndicator()), // Center(child: CircularProgressIndicator()),
SizedBox( // SizedBox(
height: 10, // height: 10,
), // ),
Text( // Text(
'Connecting to the call...', // 'Connecting to the call...',
style: TextStyle(color: Colors.white), // style: TextStyle(color: Colors.white),
), // ),
], // ],
); // );
} // }
//
Future<void> _onHangup() async { // Future<void> _onHangup() async {
print('onHangup'); // print('onHangup');
await _conferenceRoom.disconnect(); // await _conferenceRoom.disconnect();
LandingPage.isOpenCallPage = false; // LandingPage.isOpenCallPage = false;
Navigator.of(context).pop(); // Navigator.of(context).pop();
} // }
//
void _onPersonAdd() { // void _onPersonAdd() {
print('onPersonAdd'); // print('onPersonAdd');
try { // try {
_conferenceRoom.addDummy( // _conferenceRoom.addDummy(
child: Stack( // child: Stack(
children: <Widget>[ // children: <Widget>[
const Placeholder(), // const Placeholder(),
Center( // Center(
child: Text( // child: Text(
(_conferenceRoom.participants.length + 1).toString(), // (_conferenceRoom.participants.length + 1).toString(),
style: const TextStyle( // style: const TextStyle(
shadows: <Shadow>[ // shadows: <Shadow>[
Shadow( // Shadow(
blurRadius: 3.0, // blurRadius: 3.0,
color: Color.fromARGB(255, 0, 0, 0), // color: Color.fromARGB(255, 0, 0, 0),
), // ),
Shadow( // Shadow(
blurRadius: 8.0, // blurRadius: 8.0,
color: Color.fromARGB(255, 255, 255, 255), // color: Color.fromARGB(255, 255, 255, 255),
), // ),
], // ],
fontSize: 80, // fontSize: 80,
), // ),
), // ),
), // ),
], // ],
), // ),
); // );
} on PlatformException catch (err) { // } on PlatformException catch (err) {
PlatformAlertDialog( // PlatformAlertDialog(
title: err.message, // title: err.message,
content: err.details, // content: err.details,
defaultActionText: 'OK', // defaultActionText: 'OK',
).show(context); // ).show(context);
} // }
} // }
//
void _onPersonRemove() { // void _onPersonRemove() {
print('onPersonRemove'); // print('onPersonRemove');
_conferenceRoom.removeDummy(); // _conferenceRoom.removeDummy();
} // }
//
Widget _buildParticipants(BuildContext context, Size size, ConferenceRoom conferenceRoom) { // Widget _buildParticipants(BuildContext context, Size size, ConferenceRoom conferenceRoom) {
final children = <Widget>[]; // final children = <Widget>[];
final length = conferenceRoom.participants.length; // final length = conferenceRoom.participants.length;
//
if (length <= 2) { // if (length <= 2) {
_buildOverlayLayout(context, size, children); // _buildOverlayLayout(context, size, children);
return Stack(children: children); // return Stack(children: children);
} // }
//
void buildInCols(bool removeLocalBeforeChunking, bool moveLastOfEachRowToNextRow, int columns) { // void buildInCols(bool removeLocalBeforeChunking, bool moveLastOfEachRowToNextRow, int columns) {
_buildLayoutInGrid( // _buildLayoutInGrid(
context, // context,
size, // size,
children, // children,
removeLocalBeforeChunking: removeLocalBeforeChunking, // removeLocalBeforeChunking: removeLocalBeforeChunking,
moveLastOfEachRowToNextRow: moveLastOfEachRowToNextRow, // moveLastOfEachRowToNextRow: moveLastOfEachRowToNextRow,
columns: columns, // columns: columns,
); // );
} // }
//
// if (length <= 3) { // // if (length <= 3) {
// buildInCols(true, false, 1); // // buildInCols(true, false, 1);
// } else if (length == 5) { // // } else if (length == 5) {
// buildInCols(false, true, 2); // // buildInCols(false, true, 2);
// } else if (length <= 6 || length == 8) { // // } else if (length <= 6 || length == 8) {
// buildInCols(false, false, 2); // // buildInCols(false, false, 2);
// } else if (length == 7 || length == 9) { // // } else if (length == 7 || length == 9) {
// buildInCols(true, false, 2); // // buildInCols(true, false, 2);
// } else if (length == 10) { // // } else if (length == 10) {
// buildInCols(false, true, 3); // // buildInCols(false, true, 3);
// } else if (length == 13 || length == 16) { // // } else if (length == 13 || length == 16) {
// buildInCols(true, false, 3); // // buildInCols(true, false, 3);
// } else if (length <= 18) { // // } else if (length <= 18) {
// buildInCols(false, false, 3); // // buildInCols(false, false, 3);
// } // // }
//
return Column( // return Column(
children: children, // children: children,
); // );
} // }
//
void _buildOverlayLayout(BuildContext context, Size size, List<Widget> children) { // void _buildOverlayLayout(BuildContext context, Size size, List<Widget> children) {
final participants = _conferenceRoom.participants; // final participants = _conferenceRoom.participants;
if (participants.length == 1) { // if (participants.length == 1) {
children.add(_buildNoiseBox()); // children.add(_buildNoiseBox());
} else { // } else {
final remoteParticipant = participants.firstWhere((ParticipantWidget participant) => participant.isRemote, orElse: () => null); // final remoteParticipant = participants.firstWhere((ParticipantWidget participant) => participant.isRemote, orElse: () => null);
if (remoteParticipant != null) { // if (remoteParticipant != null) {
children.add(remoteParticipant); // children.add(remoteParticipant);
} // }
} // }
//
final localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null); // final localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null);
if (localParticipant != null) { // if (localParticipant != null) {
children.add(DraggablePublisher( // children.add(DraggablePublisher(
key: Key('publisher'), // key: Key('publisher'),
child: localParticipant, // child: localParticipant,
availableScreenSize: size, // availableScreenSize: size,
onButtonBarVisible: _onButtonBarVisibleStreamController.stream, // onButtonBarVisible: _onButtonBarVisibleStreamController.stream,
onButtonBarHeight: _onButtonBarHeightStreamController.stream, // onButtonBarHeight: _onButtonBarHeightStreamController.stream,
)); // ));
} // }
} // }
//
void _buildLayoutInGrid( // void _buildLayoutInGrid(
BuildContext context, // BuildContext context,
Size size, // Size size,
List<Widget> children, { // List<Widget> children, {
bool removeLocalBeforeChunking = false, // bool removeLocalBeforeChunking = false,
bool moveLastOfEachRowToNextRow = false, // bool moveLastOfEachRowToNextRow = false,
int columns = 2, // int columns = 2,
}) { // }) {
final participants = _conferenceRoom.participants; // final participants = _conferenceRoom.participants;
ParticipantWidget localParticipant; // ParticipantWidget localParticipant;
if (removeLocalBeforeChunking) { // if (removeLocalBeforeChunking) {
localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null); // localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null);
if (localParticipant != null) { // if (localParticipant != null) {
participants.remove(localParticipant); // participants.remove(localParticipant);
} // }
} // }
final chunkedParticipants = chunk(array: participants, size: columns); // final chunkedParticipants = chunk(array: participants, size: columns);
if (localParticipant != null) { // if (localParticipant != null) {
chunkedParticipants.last.add(localParticipant); // chunkedParticipants.last.add(localParticipant);
participants.add(localParticipant); // participants.add(localParticipant);
} // }
//
if (moveLastOfEachRowToNextRow) { // if (moveLastOfEachRowToNextRow) {
for (var i = 0; i < chunkedParticipants.length - 1; i++) { // for (var i = 0; i < chunkedParticipants.length - 1; i++) {
var participant = chunkedParticipants[i].removeLast(); // var participant = chunkedParticipants[i].removeLast();
chunkedParticipants[i + 1].insert(0, participant); // chunkedParticipants[i + 1].insert(0, participant);
} // }
} // }
//
for (final participantChunk in chunkedParticipants) { // for (final participantChunk in chunkedParticipants) {
final rowChildren = <Widget>[]; // final rowChildren = <Widget>[];
for (final participant in participantChunk) { // for (final participant in participantChunk) {
rowChildren.add( // rowChildren.add(
Container( // Container(
width: size.width / participantChunk.length, // width: size.width / participantChunk.length,
height: size.height / chunkedParticipants.length, // height: size.height / chunkedParticipants.length,
child: participant, // child: participant,
), // ),
); // );
} // }
children.add( // children.add(
Container( // Container(
height: size.height / chunkedParticipants.length, // height: size.height / chunkedParticipants.length,
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: rowChildren, // children: rowChildren,
), // ),
), // ),
); // );
} // }
} // }
//
NoiseBox _buildNoiseBox() { // NoiseBox _buildNoiseBox() {
return NoiseBox( // return NoiseBox(
density: NoiseBoxDensity.xLow, // density: NoiseBoxDensity.xLow,
backgroundColor: Colors.grey.shade900, // backgroundColor: Colors.grey.shade900,
child: Center( // child: Center(
child: Container( // child: Container(
color: Colors.black54, // color: Colors.black54,
width: double.infinity, // width: double.infinity,
height: 40, // height: 40,
child: Center( // child: Center(
child: Text( // child: Text(
'Waiting for another participant to connect to the call...', // 'Waiting for another participant to connect to the call...',
key: Key('text-wait'), // key: Key('text-wait'),
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), // style: TextStyle(color: Colors.white),
), // ),
), // ),
), // ),
), // ),
); // );
} // }
//
List<List<T>> chunk<T>({@required List<T> array, @required int size}) { // List<List<T>> chunk<T>({@required List<T> array, @required int size}) {
final result = <List<T>>[]; // final result = <List<T>>[];
if (array.isEmpty || size <= 0) { // if (array.isEmpty || size <= 0) {
return result; // return result;
} // }
var first = 0; // var first = 0;
var last = size; // var last = size;
final totalLoop = array.length % size == 0 ? array.length ~/ size : array.length ~/ size + 1; // final totalLoop = array.length % size == 0 ? array.length ~/ size : array.length ~/ size + 1;
for (var i = 0; i < totalLoop; i++) { // for (var i = 0; i < totalLoop; i++) {
if (last > array.length) { // if (last > array.length) {
result.add(array.sublist(first, array.length)); // result.add(array.sublist(first, array.length));
} else { // } else {
result.add(array.sublist(first, last)); // result.add(array.sublist(first, last));
} // }
first = last; // first = last;
last = last + size; // last = last + size;
} // }
return result; // return result;
} // }
//
void _onHeightBar(double height) { // void _onHeightBar(double height) {
_onButtonBarHeightStreamController.add(height); // _onButtonBarHeightStreamController.add(height);
} // }
//
void _onShowBar() { // void _onShowBar() {
setState(() { // setState(() {
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]); // SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);
}); // });
_onButtonBarVisibleStreamController.add(true); // _onButtonBarVisibleStreamController.add(true);
} // }
//
void _onHideBar() { // void _onHideBar() {
setState(() { // setState(() {
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]); // SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
}); // });
_onButtonBarVisibleStreamController.add(false); // _onButtonBarVisibleStreamController.add(false);
} // }
//
Future<void> _wakeLock(bool enable) async { // Future<void> _wakeLock(bool enable) async {
try { // try {
return await (enable ? Wakelock.enable() : Wakelock.disable()); // return await (enable ? Wakelock.enable() : Wakelock.disable());
} catch (err) { // } catch (err) {
print('Unable to change the Wakelock and set it to $enable'); // print('Unable to change the Wakelock and set it to $enable');
print(err); // print(err);
} // }
} // }
//
void _conferenceRoomUpdated() { // void _conferenceRoomUpdated() {
setState(() {}); // setState(() {});
} // }
} // }

File diff suppressed because it is too large Load Diff

@ -445,7 +445,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: selectedStatusIndex, selectedIndex: selectedStatusIndex,
onValueSelected: (index) { onValueSelected: (index) {

@ -95,7 +95,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: selectedStatusIndex, selectedIndex: selectedStatusIndex,
onValueSelected: (index) { onValueSelected: (index) {

@ -352,7 +352,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, InsuranceViewModel model}) { void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, InsuranceViewModel model}) {
showDialog( showDialog(
context: context, context: context,
child: AttachInsuranceCardImageDialog( builder: (cxt) => AttachInsuranceCardImageDialog(
fileNo: fileNo, fileNo: fileNo,
name: name, name: name,
image: (file, image) async { image: (file, image) async {

@ -84,7 +84,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
///inject the user data ///inject the user data
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging?.instance;
final authService = new AuthProvider(); final authService = new AuthProvider();
var event = RobotProvider(); var event = RobotProvider();
@ -264,7 +264,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// }).checkAndConnectIfNoInternet(); // }).checkAndConnectIfNoInternet();
if (Platform.isIOS) { if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions(); _firebaseMessaging.requestPermission();
} }
requestPermissions().then((results) { requestPermissions().then((results) {
@ -288,113 +288,178 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// if (results[Permission.accessMediaLocation].isGranted) ; // if (results[Permission.accessMediaLocation].isGranted) ;
// if (results[Permission.calendar].isGranted) ; // if (results[Permission.calendar].isGranted) ;
}); });
// }); // });
// FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
// //_firebase Background message handler print("onMessage: $message");
_firebaseMessaging.configure( print(message);
onMessage: (Map<String, dynamic> message) async { print(message.data['name']);
// showDialog("onMessage: $message"); print(message.data['appointmentdate']);
print("onMessage: $message");
print(message); if (Platform.isIOS) {
print(message['name']); if (message.data['is_call'] == "true") {
print(message['appointmentdate']); var route = ModalRoute.of(context);
if (Platform.isIOS) { if (route != null) {
if (message['is_call'] == "true") { print(route.settings.name);
var route = ModalRoute.of(context); }
if (route != null) { Map<String, dynamic> myMap = new Map<String, dynamic>.from(message.data);
print(route.settings.name); print(myMap);
} LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message); if (!isPageNavigated) {
print(myMap); isPageNavigated = true;
LandingPage.isOpenCallPage = true; Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); isPageNavigated = false;
if (!isPageNavigated) { });
isPageNavigated = true;
Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
isPageNavigated = false;
});
}
} else {
print("Is Call Not Found iOS");
} }
} else { } else {
print("Is Call Not Found iOS"); print("Is Call Not Found iOS");
} }
} else {
print("Is Call Not Found iOS");
}
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (message['data'].containsKey("is_call")) { if (message.data['data'].containsKey("is_call")) {
var route = ModalRoute.of(context); var route = ModalRoute.of(context);
if (route != null) { if (route != null) {
print(route.settings.name); print(route.settings.name);
}
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
print(myMap);
if (LandingPage.isOpenCallPage) {
return;
}
LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
if (!isPageNavigated) {
isPageNavigated = true;
Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
Future.delayed(Duration(seconds: 5), () {
isPageNavigated = false;
});
});
}
} else {
print("Is Call Not Found Android");
LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']);
} }
} else {
print("Is Call Not Found Android"); Map<String, dynamic> myMap = new Map<String, dynamic>.from(message.data);
} print(myMap);
}, if (LandingPage.isOpenCallPage) {
onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, return;
onLaunch: (Map<String, dynamic> message) async { }
print("onLaunch: $message"); LandingPage.isOpenCallPage = true;
// showDialog("onLaunch: $message"); LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
}, if (!isPageNavigated) {
onResume: (Map<String, dynamic> message) async { isPageNavigated = true;
print("onResume: $message"); Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
print(message); Future.delayed(Duration(seconds: 5), () {
print(message['name']);
print(message['appointmentdate']);
// showDialog("onResume: $message");
if (Platform.isIOS) {
if (message['is_call'] == "true") {
var route = ModalRoute.of(context);
if (route != null) {
print(route.settings.name);
}
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
print(myMap);
LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
if (!isPageNavigated) {
isPageNavigated = true;
Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
isPageNavigated = false; isPageNavigated = false;
}); });
} });
} else {
print("Is Call Not Found iOS");
} }
} else { } else {
print("Is Call Not Found iOS"); print("Is Call Not Found Android");
LocalNotification.getInstance().showNow(title: message.data['notification']['title'], subtitle: message.data['notification']['body']);
} }
}, } else {
); print("Is Call Not Found Android");
}
});
FirebaseMessaging.onBackgroundMessage((message) {
return Platform.isIOS ? null : myBackgroundMessageHandler(message.data);
});
// todo verify all functionality
// _firebaseMessaging.configure(
// // onMessage: (Map<String, dynamic> message) async {
// // // showDialog("onMessage: $message");
// // print("onMessage: $message");
// // print(message);
// // print(message['name']);
// // print(message['appointmentdate']);
// //
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// //
// // if (Platform.isAndroid) {
// // if (message['data'].containsKey("is_call")) {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
// // print(myMap);
// // if (LandingPage.isOpenCallPage) {
// // return;
// // }
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
// // Future.delayed(Duration(seconds: 5), () {
// // isPageNavigated = false;
// // });
// // });
// // }
// // } else {
// // print("Is Call Not Found Android");
// // LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']);
// // }
// // } else {
// // print("Is Call Not Found Android");
// // }
// // },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message");
// // showDialog("onLaunch: $message");
// },
// onResume: (Map<String, dynamic> message) async {
// print("onResume: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// // showDialog("onResume: $message");
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
// },
// );
} }
Future<Map<Permission, PermissionStatus>> requestPermissions() async { Future<Map<Permission, PermissionStatus>> requestPermissions() async {
@ -424,8 +489,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
LandingPage.isOpenCallPage = true; LandingPage.isOpenCallPage = true;
// Future.delayed(Duration(seconds: 3), () { // Future.delayed(Duration(seconds: 3), () {
// Navigator.push(locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))); // Navigator.push(locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData)));
NavigationService.instance.navigateTo(INCOMING_CALL_PAGE); NavigationService.instance.navigateTo(INCOMING_CALL_PAGE);
// }); // });
// if (!isPageNavigated) { // if (!isPageNavigated) {
// isPageNavigated = true; // isPageNavigated = true;

@ -3,8 +3,6 @@ import 'dart:ui';
import 'package:camera/camera.dart'; import 'package:camera/camera.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart'; import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart';
import 'package:diplomaticquarterapp/pages/conference/conference_page.dart';
import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page.dart';
import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart'; import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -350,12 +348,12 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
// ConferencePage(roomModel: roomModel), // ConferencePage(roomModel: roomModel),
// ), // ),
// ); // );
await Navigator.of(context).push( // await Navigator.of(context).push( // todo temporary comment lines for call
MaterialPageRoute<ConferencePage>( // MaterialPageRoute<ConferencePage>(
fullscreenDialog: true, // fullscreenDialog: true,
builder: (BuildContext context) => CallHomePage(), // builder: (BuildContext context) => CallHomePage(),
), // ),
); // );
} catch (err) { } catch (err) {
print(err); print(err);
await PlatformExceptionAlertDialog( await PlatformExceptionAlertDialog(

@ -223,7 +223,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
openInvoice() { openInvoice() {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: projectViewModel.user.emailAddress, email: projectViewModel.user.emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
sendInvoiceEmail(context); sendInvoiceEmail(context);

@ -57,7 +57,7 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
duration: widget.pendingERRequestHistoryList.watingtimeInteger * 60, duration: widget.pendingERRequestHistoryList.watingtimeInteger * 60,
width: MediaQuery.of(context).size.width / 2, width: MediaQuery.of(context).size.width / 2,
height: MediaQuery.of(context).size.height / 2, height: MediaQuery.of(context).size.height / 2,
color: Colors.white, ringColor: Colors.white,
fillColor: CustomColors.green, fillColor: CustomColors.green,
strokeWidth: 7.0, strokeWidth: 7.0,
textStyle: TextStyle(fontSize: 32.0, color: Color(0xff2E303A), fontWeight: FontWeight.w400), textStyle: TextStyle(fontSize: 32.0, color: Color(0xff2E303A), fontWeight: FontWeight.w400),

@ -107,7 +107,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return Scaffold( return Scaffold(
backgroundColor: Color(0xfff8f8f8), backgroundColor: Color(0xfff8f8f8),
resizeToAvoidBottomPadding: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
leading: IconButton( leading: IconButton(

@ -21,7 +21,7 @@ class LoginType extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Color(0xfff8f8f8), backgroundColor: Color(0xfff8f8f8),
resizeToAvoidBottomPadding: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
leading: IconButton( leading: IconButton(

@ -281,7 +281,7 @@ class _ReminderPageState extends State<ReminderPage> {
void confirmSelectDayDialog() { void confirmSelectDayDialog() {
showDialog( showDialog(
context: context, context: context,
child: DayCheckBoxDialog( builder: (cxt) => DayCheckBoxDialog(
title: 'Select Day', title: 'Select Day',
selectedDaysOfWeek: widget.daysOfWeek, selectedDaysOfWeek: widget.daysOfWeek,
onValueSelected: (value) { onValueSelected: (value) {

@ -101,7 +101,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
]; ];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: selectedIndex:
beneficiaryType == BeneficiaryType.MyAccount ? 0 : (beneficiaryType == BeneficiaryType.MyFamilyFiles ? 1 : (beneficiaryType == BeneficiaryType.OtherAccount ? 2 : -1)), beneficiaryType == BeneficiaryType.MyAccount ? 0 : (beneficiaryType == BeneficiaryType.MyFamilyFiles ? 1 : (beneficiaryType == BeneficiaryType.OtherAccount ? 2 : -1)),
@ -359,7 +359,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
]; ];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedHospitalIndex, selectedIndex: _selectedHospitalIndex,
isScrollable: true, isScrollable: true,
@ -380,7 +380,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
]; ];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
isScrollable: true, isScrollable: true,
selectedIndex: _selectedPatientIndex, selectedIndex: _selectedPatientIndex,
@ -404,7 +404,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
]; ];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
isScrollable: true, isScrollable: true,
selectedIndex: _selectedFamilyMemberIndex, selectedIndex: _selectedFamilyMemberIndex,

@ -189,7 +189,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context).textTheme.body2.copyWith( style: Theme.of(context).textTheme.bodyText2.copyWith(
fontSize: widget.fontSize, fontWeight: widget.fontWeight), fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[

@ -106,7 +106,7 @@ class ClassesPage extends StatelessWidget {
void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: email, email: email,
onTapSendEmail: () { onTapSendEmail: () {
onTap(); onTap();

@ -167,7 +167,7 @@ class ContactLensPage extends StatelessWidget {
void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: email, email: email,
onTapSendEmail: () { onTapSendEmail: () {
onTap(); onTap();

@ -167,7 +167,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: email, email: email,
onTapSendEmail: () { onTapSendEmail: () {
onTap(); onTap();

@ -9,8 +9,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -96,7 +94,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: weightUnit, selectedIndex: weightUnit,
onValueSelected: (index) { onValueSelected: (index) {
@ -198,7 +196,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).removeMeasure, message: TranslationBase.of(context).removeMeasure,
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -57,7 +57,7 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
onPressed: () { onPressed: () {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user.emailAddress,
onTapSendEmail: () async { onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -106,7 +106,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: measuredArm, selectedIndex: measuredArm,
onValueSelected: (index) { onValueSelected: (index) {

@ -127,7 +127,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
() { () {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user.emailAddress,
onTapSendEmail: () async { onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -214,7 +214,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).removeMeasure, message: TranslationBase.of(context).removeMeasure,
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -301,7 +301,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedMeasureUnitIndex, selectedIndex: _selectedMeasureUnitIndex,
onValueSelected: (index) { onValueSelected: (index) {
@ -320,7 +320,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedMeasureTimeIndex, selectedIndex: _selectedMeasureTimeIndex,
isScrollable: true, isScrollable: true,

@ -135,7 +135,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage> with SingleTick
() { () {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user.emailAddress,
onTapSendEmail: () async { onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -13,12 +13,7 @@ class CurvedChartBloodPressure extends StatelessWidget {
final int indexes; final int indexes;
final double horizontalInterval; final double horizontalInterval;
CurvedChartBloodPressure( CurvedChartBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.horizontalInterval = 20.0});
{this.title,
this.timeSeries1,
this.indexes,
this.timeSeries2,
this.horizontalInterval = 20.0});
List<int> xAxixs = List(); List<int> xAxixs = List();
List<double> yAxixs = List(); List<double> yAxixs = List();
@ -43,8 +38,7 @@ class CurvedChartBloodPressure extends StatelessWidget {
), ),
Text( Text(
title, title,
style: TextStyle( style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox( SizedBox(
@ -52,8 +46,7 @@ class CurvedChartBloodPressure extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), swapAnimationDuration: const Duration(milliseconds: 250),
@ -72,9 +65,7 @@ class CurvedChartBloodPressure extends StatelessWidget {
Container( Container(
width: 20, width: 20,
height: 20, height: 20,
decoration: BoxDecoration( decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor),
shape: BoxShape.rectangle,
color: Theme.of(context).primaryColor),
), ),
SizedBox( SizedBox(
width: 5, width: 5,
@ -90,8 +81,7 @@ class CurvedChartBloodPressure extends StatelessWidget {
Container( Container(
width: 20, width: 20,
height: 20, height: 20,
decoration: BoxDecoration( decoration: BoxDecoration(shape: BoxShape.rectangle, color: secondaryColor),
shape: BoxShape.rectangle, color: secondaryColor),
), ),
SizedBox( SizedBox(
width: 5, width: 5,
@ -124,19 +114,17 @@ class CurvedChartBloodPressure extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData( gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
margin: 22, margin: 22,
getTitles: (value) { getTitles: (value) {
if (timeSeries1.length < 15) { if (timeSeries1.length < 15) {
@ -145,10 +133,8 @@ class CurvedChartBloodPressure extends StatelessWidget {
} else } else
return ''; return '';
} else { } else {
if (value.toInt() == 0) if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == timeSeries1.length - 1)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) { if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
} }
@ -158,9 +144,12 @@ class CurvedChartBloodPressure extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, interval: getMaxY() - getMinY() <= 500
? 50
getTextStyles: (value) => const TextStyle( : getMaxY() - getMinY() <= 1000
? 100
: 200,
getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,

@ -163,14 +163,14 @@ class LineChartCurved extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
@ -194,7 +194,7 @@ class LineChartCurved extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,

@ -113,14 +113,14 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
@ -138,7 +138,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
? 30 ? 30
: 40, : 40,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,

@ -87,7 +87,7 @@ class MonthLineChartCurved extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData( gridData: FlGridData(
@ -100,7 +100,7 @@ class MonthLineChartCurved extends StatelessWidget {
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
@ -111,7 +111,7 @@ class MonthLineChartCurved extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,

@ -66,7 +66,7 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
void showConfirmMessage(PatientSickLeaveViewMode model, int index) { void showConfirmMessage(PatientSickLeaveViewMode model, int index) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user.emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
model.sendSickLeaveEmail( model.sendSickLeaveEmail(

@ -7,14 +7,14 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -39,6 +39,7 @@ class PrescriptionDeliveryAddressPage extends StatefulWidget {
class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAddressPage> { class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAddressPage> {
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
int _selectedAddressIndex = -1;
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();
CameraPosition _kGooglePlex = CameraPosition( CameraPosition _kGooglePlex = CameraPosition(
@ -86,55 +87,58 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( CommonDropDownView(TranslationBase.of(context).selectAddress, getAddressName(), () {
margin: EdgeInsets.only(left: 12, right: 12, bottom: 12, top: 12), List<RadioSelectionDialogModel> list = [
decoration: cardRadius(12), for (int i = 0; i < model.addressesList.length; i++) RadioSelectionDialogModel(model.addressesList[i].address1, i),
child: Container( ];
child: InkWell(
onTap: () => confirmSelectLocationDialog(model.addressesList), showDialog(
child: Container( context: context,
padding: EdgeInsets.all(8), builder: (cxt) => RadioSelectionDialog(
width: double.infinity, listData: list,
// height: 65, isScrollable: true,
decoration: BoxDecoration( selectedIndex: _selectedAddressIndex,
borderRadius: BorderRadius.circular(10), onValueSelected: (index) {
color: Colors.white, _selectedAddressIndex = index;
), _selectedAddress = model.addressesList[index];
child: Row( List latLongArr = _selectedAddress.latLong.split(',');
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ latitude = double.parse(latLongArr[0]);
Expanded( longitude = double.parse(latLongArr[1]);
child: Text( markers = Set();
getAddressName(), markers.add(
style: TextStyle( Marker(
fontWeight: FontWeight.w600, markerId: MarkerId(
fontSize: 12, _selectedAddress.latLong.hashCode.toString(),
letterSpacing: -0.45,
),
),
), ),
Icon(Icons.arrow_drop_down) position: LatLng(latitude, longitude),
], ),
), );
), _kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
setState(() {});
},
), ),
height: 50, );
width: double.infinity, }).withBorderedContainer,
), SizedBox(height: 12),
),
InkWell( InkWell(
onTap: () async { onTap: () async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: LocationPage( page: LocationPage(
latitude: latitude, latitude: latitude,
longitude: longitude, longitude: longitude,
)), ),
),
).then((value) { ).then((value) {
if (value != null && value is AddNewAddressRequestModel) { if (value != null && value is AddNewAddressRequestModel) {
setState(() { setState(() {
@ -179,140 +183,108 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
} }
}); });
}, },
child: Padding( child: Row(
padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8), children: [
child: Row( Icon(Icons.add_circle_outline_sharp),
children: [ mWidth(12),
Icon(Icons.add_circle_outline_sharp), Text(
mWidth(12), TranslationBase.of(context).addNewAddress,
Text( style: TextStyle(
TranslationBase.of(context).addNewAddress, fontSize: 14,
style: TextStyle( fontWeight: FontWeight.w600,
fontSize: 14, letterSpacing: -0.46,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
), ),
], ),
), ],
), ),
), ),
SizedBox(height: 12),
if (_selectedAddress != null) if (_selectedAddress != null)
Container( Container(
decoration: cardRadius(12), decoration: cardRadius(15),
margin: EdgeInsets.all(12), padding: const EdgeInsets.all(12.0),
child: Padding( child: Column(
padding: const EdgeInsets.all(12.0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ TranslationBase.of(context).selectAddress + ":",
Texts( style: TextStyle(fontSize: 14, color: Color(0xff575757), fontWeight: FontWeight.w600, letterSpacing: -0.56),
TranslationBase.of(context).selectAddress + ":", ),
fontSize: 12, mHeight(12),
color: CustomColors.grey, Container(
fontWeight: FontWeight.w600, height: 175,
), decoration: containerColorRadiusBorder(Colors.white, 12, Color(0xffDDDDDD)),
mHeight(12), clipBehavior: Clip.antiAlias,
Container( child: Container(
height: 175, decoration: cardRadius(10),
decoration: containerColorRadiusBorder(Colors.white, 12, Colors.grey),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Container( margin: const EdgeInsets.all(0),
decoration: cardRadius(12), child: Image.network(
clipBehavior: Clip.antiAlias, "https://maps.googleapis.com/maps/api/staticmap?center=" +
margin: const EdgeInsets.all(0), _kGooglePlex.target.latitude.toString() +
// child: GoogleMap( "," +
// mapType: MapType.normal, _kGooglePlex.target.longitude.toString() +
// markers: markers, "&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" +
// initialCameraPosition: _kGooglePlex, _kGooglePlex.target.latitude.toString() +
// onMapCreated: (GoogleMapController controller) { "," +
// _controller.complete(controller); _kGooglePlex.target.longitude.toString() +
// }, "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
// ), width: double.infinity,
child: Image.network( height: double.infinity,
"https://maps.googleapis.com/maps/api/staticmap?center=" + fit: BoxFit.cover,
_kGooglePlex.target.latitude.toString() +
"," +
_kGooglePlex.target.longitude.toString() +
"&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" +
_kGooglePlex.target.latitude.toString() +
"," +
_kGooglePlex.target.longitude.toString() +
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
width: double.infinity,
height: double.infinity,
fit: BoxFit.cover,
),
), ),
), ),
SizedBox( ),
height: 10, SizedBox(height: 18),
), Text(
Texts( TranslationBase.of(context).shippingAddresss + ":",
TranslationBase.of(context).shippingAddresss + ":", style: TextStyle(fontSize: 14, color: Color(0xff575757), fontWeight: FontWeight.w600, letterSpacing: -0.56),
fontSize: 12, ),
color: CustomColors.grey, SizedBox(height: 2),
fontWeight: FontWeight.w600, Text(
), '${model.user.firstName} ${model.user.lastName}',
SizedBox( style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
height: 2, ),
), Text(
Texts( _selectedAddress.address1,
'${model.user.firstName} ${model.user.lastName}', style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
fontSize: 12, ),
fontWeight: FontWeight.w600, Text(
), _selectedAddress.address2,
Texts( style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
_selectedAddress.address1, ),
fontSize: 12, Text(
fontWeight: FontWeight.w600, _selectedAddress.city + " " + _selectedAddress.country,
), style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
Texts( ),
_selectedAddress.address2, ],
fontSize: 12,
fontWeight: FontWeight.w600,
),
Texts(
_selectedAddress.city + " " + _selectedAddress.country,
fontSize: 12,
fontWeight: FontWeight.w600,
),
],
),
), ),
) )
], ],
), ),
), ),
), ),
Container( DefaultButton(
decoration: cardRadius(0), TranslationBase.of(context).continues.toUpperCase(),
margin: EdgeInsets.zero, _selectedAddress == null
child: Container( ? null
width: double.infinity, : () {
padding: EdgeInsets.only(left: 16, right: 16, top: 16), Navigator.push(
child: Button( context,
label: TranslationBase.of(context).continues.toUpperCase(), FadePage(
disabled: _selectedAddress == null, page: PrescriptionOrderOverview(
backgroundColor: _selectedAddress == null ? CustomColors.grey2 : CustomColors.accentColor, latitude: latitude,
onTap: () { longitude: longitude,
Navigator.push( prescriptionReportEnhList: widget.prescriptionReportEnhList,
context, prescriptionReportList: widget.prescriptionReportList,
FadePage( prescriptions: widget.prescriptions,
page: PrescriptionOrderOverview( selectedAddress: _selectedAddress,
latitude: latitude, ),
longitude: longitude,
prescriptionReportEnhList: widget.prescriptionReportEnhList,
prescriptionReportList: widget.prescriptionReportList,
prescriptions: widget.prescriptions,
selectedAddress: _selectedAddress,
), ),
), );
); },
}, disabledColor: CustomColors.grey2,
), ).insideContainer,
),
),
], ],
), ),
), ),
@ -325,7 +297,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
) { ) {
showDialog( showDialog(
context: context, context: context,
child: SelectLocationDialog( builder: (cxt) => SelectLocationDialog(
addresses: addresses, addresses: addresses,
selectedAddress: _selectedAddress, selectedAddress: _selectedAddress,
onValueSelected: (value) { onValueSelected: (value) {
@ -355,9 +327,6 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
} }
String getAddressName() { String getAddressName() {
if (_selectedAddress != null) return _selectedAddress?.address1 ?? "";
return _selectedAddress.address1;
else
return TranslationBase.of(context).selectAddress;
} }
} }

@ -184,7 +184,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
() async { () async {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).confirmPrescription, message: TranslationBase.of(context).confirmPrescription,
okTitle: TranslationBase.of(context).ok, okTitle: TranslationBase.of(context).ok,
onTap: () async { onTap: () async {
@ -225,7 +225,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
void showErrorDialog(BuildContext context, String error) { void showErrorDialog(BuildContext context, String error) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).youAlreadyHaveOrder, message: TranslationBase.of(context).youAlreadyHaveOrder,
okTitle: TranslationBase.of(context).orderOverview, okTitle: TranslationBase.of(context).orderOverview,
onTap: () { onTap: () {

@ -28,7 +28,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget {
body: Column( body: Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.fromLTRB(21, 21, 21, 0), padding: const EdgeInsets.fromLTRB(21, 21, 21, 10),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
@ -50,7 +50,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget {
ClipRRect( ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)), borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network( child: Image.network(
prescriptionReport.imageSRCUrl, prescriptionReport?.imageSRCUrl ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 60,
height: 70, height: 70,
@ -60,7 +60,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? ''), child: Texts((prescriptionReport?.itemDescription ?? "").isNotEmpty ? prescriptionReport?.itemDescription ?? "" : prescriptionReport?.itemDescriptionN ?? ''),
), ),
), ),
) )
@ -72,7 +72,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget {
? Expanded( ? Expanded(
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
padding: EdgeInsets.all(21), padding: EdgeInsets.fromLTRB(21, 11, 21, 21),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
GetHMGLocationsModel location = GetHMGLocationsModel(); GetHMGLocationsModel location = GetHMGLocationsModel();

@ -1,279 +1,216 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/show_zoom_image_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PrescriptionDetailsPageINP extends StatelessWidget { class PrescriptionDetailsPageINP extends StatelessWidget {
final PrescriptionReportINP prescriptionReport; final PrescriptionReportINP prescriptionReport;
final Prescriptions prescriptions;
PrescriptionDetailsPageINP({Key key, this.prescriptionReport}); PrescriptionDetailsPageINP({Key key, this.prescriptionReport, this.prescriptions});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).prescriptions, appBarTitle: TranslationBase.of(context).prescriptions,
body: SingleChildScrollView( body: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ DoctorHeader(
Container( headerModel: HeaderModel(
width: double.infinity, prescriptions.doctorName,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), prescriptions.doctorID,
padding: EdgeInsets.all(8.0), prescriptions.doctorImageURL,
decoration: BoxDecoration( prescriptions.speciality,
color: Colors.white, "",
borderRadius: BorderRadius.all( prescriptions.name,
Radius.circular(10.0), DateUtil.convertStringToDate(prescriptions.appointmentDate),
), DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
border: Border.all(color: Colors.grey[200], width: 0.5), prescriptions.nationalityFlagURL,
), prescriptions.doctorRate,
child: Row( prescriptions.actualDoctorRate,
children: <Widget>[ prescriptions.noOfPatientsRate,
ClipRRect( "",
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReport.imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
),
),
)
],
),
),
Container(
margin: EdgeInsets.all(8),
child: Row(
children: [
Expanded(
child: InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PharmacyForPrescriptionsPage(
itemID: prescriptionReport.itemID,
),
),
),
child: Center(
child: Column(
children: <Widget>[
Container(
width: 50,
decoration: BoxDecoration(color: Colors.white, shape: BoxShape.rectangle),
child: Column(
children: <Widget>[
Icon(
Icons.pin_drop,
color: Colors.red[800],
size: 55,
),
],
),
),
SizedBox(
height: 5,
),
Texts(TranslationBase.of(context).availability)
],
),
)),
),
_addReminderButton(context)
],
),
), ),
Container( isNeedToShowButton: false,
color: Colors.white, ),
margin: EdgeInsets.only(top: 10, left: 10, right: 10), Expanded(
child: Table( child: ListView(
border: TableBorder.symmetric(inside: BorderSide(width: 0.5), outside: BorderSide(width: 0.5)), physics: BouncingScrollPhysics(),
children: [ padding: EdgeInsets.all(21),
TableRow( children: [
children: [ Container(
Container( padding: EdgeInsets.all(14),
color: Colors.white, decoration: BoxDecoration(
height: 40, color: Colors.white,
width: double.infinity, borderRadius: BorderRadius.all(Radius.circular(10.0)),
child: Center( boxShadow: [
child: Texts( BoxShadow(
TranslationBase.of(context).route, color: Color(0xff000000).withOpacity(.05),
fontSize: 14, //spreadRadius: 5,
))), blurRadius: 27,
Container( offset: Offset(0, -3),
color: Colors.white, ),
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).frequency,
fontSize: 14,
))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 4),
child: Center(
child: Texts(
"${TranslationBase.of(context).dailyDoses}",
fontSize: 14,
))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).duration,
fontSize: 14,
))),
], ],
), ),
TableRow( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Row(
color: Colors.white, children: <Widget>[
height: 50, InkWell(
width: double.infinity, child: Stack(
child: Center(child: Text(prescriptionReport.routeN ?? ''))), alignment: Alignment.center,
Container( children: [
color: Colors.white, Container(
height: 50, child: Image.network(
width: double.infinity, prescriptionReport.imageSRCUrl,
child: Center(child: Text(prescriptionReport.frequencyN ?? ''))), fit: BoxFit.cover,
Container( width: 48,
color: Colors.white, height: 49,
height: 50, ),
width: double.infinity, margin: EdgeInsets.zero,
child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))), clipBehavior: Clip.antiAlias,
Container( decoration: cardRadius(2000),
color: Colors.white, ),
height: 50, Container(
width: double.infinity, child: Icon(
child: Center(child: Text('${prescriptionReport.days}'))) Icons.search,
size: 18,
color: Colors.white,
),
padding: EdgeInsets.all(6),
decoration: containerRadius(Colors.black.withOpacity(0.3), 200),
)
],
),
onTap: () {
showZoomImageDialog(context, prescriptionReport.imageSRCUrl);
},
),
SizedBox(width: 12),
Expanded(
child: Text(
(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? '').toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
),
)
],
),
SizedBox(height: 12),
Table(border: TableBorder(horizontalInside: BorderSide(width: 1, color: Colors.black, style: BorderStyle.solid)), children: [
TableRow(
children: [
Utils.tableColumnTitle(TranslationBase.of(context).route, showDivider: false),
Utils.tableColumnTitle(TranslationBase.of(context).frequency, showDivider: false),
Utils.tableColumnTitle(TranslationBase.of(context).dailyDoses, showDivider: false),
Utils.tableColumnTitle(TranslationBase.of(context).duration, showDivider: false)
],
),
TableRow(
children: [
Utils.tableColumnValue(prescriptionReport?.routeN ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(prescriptionReport?.frequencyN ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(prescriptionReport?.doseDailyQuantity.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(prescriptionReport?.days.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel),
],
),
]),
Text(
TranslationBase.of(context).remarks,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48),
),
Text(
prescriptionReport.remarks,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
], ],
), ),
], ),
), ],
), ),
Container( ),
margin: EdgeInsets.only(top: 10, left: 10, right: 10), Container(
width: double.infinity, color: Colors.white,
color: Colors.white, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
padding: EdgeInsets.all(5), child: Row(
child: Center( mainAxisSize: MainAxisSize.min,
child: Column( children: [
children: <Widget>[ Expanded(
Texts(TranslationBase.of(context).notes), child: DefaultButton(
SizedBox( TranslationBase.of(context).availability,
height: 5, () {
), Navigator.push(
Divider( context,
height: 0.5, FadePage(
color: Colors.grey[300], page: PharmacyForPrescriptionsPage(
), itemID: prescriptionReport.itemID,
SizedBox( prescriptionReport: PrescriptionReport.fromJson(prescriptionReport.toJson()),
height: 5, ),
), ),
Texts(prescriptionReport.remarks ?? ''), );
], },
iconData: Icons.location_on,
color: Color(0xff359846),
),
), ),
), SizedBox(width: 10),
) Expanded(
], child: DefaultButton(
), TranslationBase.of(context).addReminder,
), () {
); DateTime startDate = DateTime.now();
} DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport.days);
Widget _addReminderButton(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return GestureDetector( showReminderDialog(
onTap: () { context,
DateTime startDate = DateTime.now(); endDate,
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport.days); "",
prescriptionReport.itemID.toString(),
print(prescriptionReport); "",
showGeneralDialog( "",
barrierColor: Colors.black.withOpacity(0.5), title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
transitionBuilder: (context, a1, a2, widget) { description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; onSuccess: () {
return Transform( AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), },
child: Opacity( onMultiDateSuccess: (int selectedIndex) {
opacity: a1.value, setCalender(context, prescriptionReport.itemID.toString(), selectedIndex);
child: ReminderDialog( },
eventId: prescriptionReport.itemID.toString(), );
title: "Prescription Reminder", return;
description: },
"${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ", iconData: Icons.notifications_active,
startDate: "/Date(${startDate.millisecondsSinceEpoch}+0300)/", color: Color(0xffD02127),
endDate: "/Date(${endDate.millisecondsSinceEpoch}+0300)/", fontSize: 13.0,
location: prescriptionReport.remarks, //textColor: Color(0xff2B353E),
), ),
), ),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
},
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Container(
// height: 100.0,
margin: EdgeInsets.all(7.0),
padding: EdgeInsets.only(bottom: 4.0),
decoration: BoxDecoration(
boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)],
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0),
child: Text("add",
overflow: TextOverflow.clip,
style: TextStyle(color: new Color(0xffB8382C), letterSpacing: 1.0, fontSize: 18.0)),
),
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Text("reminder",
overflow: TextOverflow.clip,
style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
),
Container(
alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
margin: projectViewModel.isArabic
? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0)
: EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0),
child: Image.asset("assets/images/new-design/reminder_icon.png", width: 45.0, height: 45.0),
),
], ],
), ),
), ),
@ -281,4 +218,57 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
), ),
); );
} }
setCalender(BuildContext context, String eventId, int reminderIndex) async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
int frequencyNumber = int.parse(prescriptionReport?.frequency);
DateTime actualDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 0); //Time will start at 8:00 AM from starting date
if (frequencyNumber == null) frequencyNumber = 1; //Some time frequency number is null so by default will be 2
int remainingDays = prescriptionReport.days - (Jiffy(DateTime.now()).diff(DateUtil.convertStringToDate(prescriptionReport.orderDate), Units.DAY));
GifLoaderDialogUtils.showMyDialog(context);
for (int i = 0; i < remainingDays; i++) {
//event for number of days.
for (int j = 0; j < frequencyNumber ?? 1; j++) {
// event for number of times per day.
if (j != 0) {
actualDate.add(new Duration(hours: 8)); // 8 hours addition for daily dose.
}
//Time subtraction from actual reminder time. like before 30, or 1 hour.
if (reminderIndex == 0) {
// Before 30 mints
actualDate = Jiffy(actualDate).subtract(minutes: 30).dateTime;
// dateTime.add(new Duration(minutes: -30));
} else if (reminderIndex == 1) {
// Before 1 hour
// dateTime.add(new Duration(minutes: -60));
actualDate = Jiffy(actualDate).subtract(hours: 1).dateTime;
} else if (reminderIndex == 2) {
// Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90));
actualDate = Jiffy(actualDate).subtract(hours: 1, minutes: 30).dateTime;
} else if (reminderIndex == 3) {
// Before 2 hours
// dateTime.add(new Duration(minutes: -120));
actualDate = Jiffy(actualDate).subtract(hours: 2).dateTime;
}
calendarUtils
.createOrUpdateEvent(
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
scheduleDateTime: actualDate,
eventId: eventId + (i.toString() + j.toString()), //event id with varitions
)
.then((value) {});
actualDate = DateTime(actualDate.year, actualDate.month, actualDate.day, 8, 0);
}
actualDate = Jiffy(actualDate).add(days: 1).dateTime;
print(actualDate);
}
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
GifLoaderDialogUtils.hideDialog(context);
}
} }

@ -98,21 +98,6 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
children: [ children: [
Row( Row(
children: <Widget>[ children: <Widget>[
// Container(
// decoration: BoxDecoration(
// border: Border.all(width: 1.0, color: Color(0xffEBEBEB)),
// borderRadius: BorderRadius.all(Radius.circular(30.0)),
// ),
// child: ClipRRect(
// borderRadius: BorderRadius.all(Radius.circular(30)),
// child: Image.network(
// prescriptionReport.imageSRCUrl,
// fit: BoxFit.cover,
// width: 48,
// height: 48,
// ),
// ),
// ),
InkWell( InkWell(
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
@ -257,8 +242,8 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
checkIfHasReminder() async { checkIfHasReminder() async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance(); CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30); DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30).dateTime;
DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120); DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120).dateTime;
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
@ -276,8 +261,8 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
cancelReminders() async { cancelReminders() async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance(); CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30); DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30).dateTime;
DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120); DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120).dateTime;
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
@ -313,20 +298,20 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
//Time subtraction from actual reminder time. like before 30, or 1 hour. //Time subtraction from actual reminder time. like before 30, or 1 hour.
if (reminderIndex == 0) { if (reminderIndex == 0) {
// Before 30 mints // Before 30 mints
actualDate = Jiffy(actualDate).subtract(minutes: 30); actualDate = Jiffy(actualDate).subtract(minutes: 30).dateTime;
// dateTime.add(new Duration(minutes: -30)); // dateTime.add(new Duration(minutes: -30));
} else if (reminderIndex == 1) { } else if (reminderIndex == 1) {
// Before 1 hour // Before 1 hour
// dateTime.add(new Duration(minutes: -60)); // dateTime.add(new Duration(minutes: -60));
actualDate = Jiffy(actualDate).subtract(hours: 1); actualDate = Jiffy(actualDate).subtract(hours: 1).dateTime;
} else if (reminderIndex == 2) { } else if (reminderIndex == 2) {
// Before 1 hour and 30 mints // Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90)); // dateTime.add(new Duration(minutes: -90));
actualDate = Jiffy(actualDate).subtract(hours: 1, minutes: 30); actualDate = Jiffy(actualDate).subtract(hours: 1, minutes: 30).dateTime;
} else if (reminderIndex == 3) { } else if (reminderIndex == 3) {
// Before 2 hours // Before 2 hours
// dateTime.add(new Duration(minutes: -120)); // dateTime.add(new Duration(minutes: -120));
actualDate = Jiffy(actualDate).subtract(hours: 2); actualDate = Jiffy(actualDate).subtract(hours: 2).dateTime;
} }
calendarUtils calendarUtils
.createOrUpdateEvent( .createOrUpdateEvent(
@ -338,7 +323,7 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
.then((value) {}); .then((value) {});
actualDate = DateTime(actualDate.year, actualDate.month, actualDate.day, 8, 0); actualDate = DateTime(actualDate.year, actualDate.month, actualDate.day, 8, 0);
} }
actualDate = Jiffy(actualDate).add(days: 1); actualDate = Jiffy(actualDate).add(days: 1).dateTime;
print(actualDate); print(actualDate);
} }
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);

@ -79,6 +79,7 @@ class PrescriptionItemsPage extends StatelessWidget {
FadePage( FadePage(
page: PrescriptionDetailsPageINP( page: PrescriptionDetailsPageINP(
prescriptionReport: model.prescriptionReportListINP[index], prescriptionReport: model.prescriptionReportListINP[index],
prescriptions: prescriptions,
), ),
), ),
); );
@ -410,7 +411,7 @@ class PrescriptionItemsPage extends StatelessWidget {
void showConfirmMessage(BuildContext context, PrescriptionsViewModel model) { void showConfirmMessage(BuildContext context, PrescriptionsViewModel model) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user.emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
model.sendPrescriptionEmail( model.sendPrescriptionEmail(

@ -110,7 +110,7 @@ class RadiologyDetailsPage extends StatelessWidget {
void showConfirmMessage({FinalRadiology finalRadiology, RadiologyViewModel model}) { void showConfirmMessage({FinalRadiology finalRadiology, RadiologyViewModel model}) {
showDialog( showDialog(
context: AppGlobal.context, context: AppGlobal.context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user.emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
model.sendRadReportEmail(mes: TranslationBase.of(AppGlobal.context).sendSuc, finalRadiology: finalRadiology); model.sendRadReportEmail(mes: TranslationBase.of(AppGlobal.context).sendSuc, finalRadiology: finalRadiology);

@ -121,7 +121,7 @@ class ReportListWidget extends StatelessWidget {
void showConfirmMessage(Reports report) { void showConfirmMessage(Reports report) {
showDialog( showDialog(
context: AppGlobal.context, context: AppGlobal.context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: emailAddress, email: emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
sendReportEmail(report); sendReportEmail(report);

@ -20,7 +20,7 @@ class MedicalReports extends StatelessWidget {
void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).confirmMsgReport, message: TranslationBase.of(context).confirmMsgReport,
onTap: () => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), onTap: () => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport),
), ),

@ -101,14 +101,14 @@ class LineChartCurved extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
@ -132,7 +132,7 @@ class LineChartCurved extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,

@ -142,14 +142,14 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
@ -173,7 +173,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,

@ -242,7 +242,7 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
]; ];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedHospitalIndex, selectedIndex: _selectedHospitalIndex,
isScrollable: true, isScrollable: true,

@ -195,7 +195,7 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
]; ];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( builder: (cxt) => RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedClinic, selectedIndex: _selectedClinic,
isScrollable: true, isScrollable: true,

@ -1,341 +1,341 @@
import 'dart:async'; // import 'dart:async';
import 'dart:typed_data'; // import 'dart:typed_data';
import 'dart:ui' as ui; // import 'dart:ui' as ui;
//
import 'package:async/async.dart'; // import 'package:async/async.dart';
import 'package:diplomaticquarterapp/config/config.dart'; // import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart'; // import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; // import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/locator.dart'; // import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; // import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; // import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; // import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; // import 'package:flutter/services.dart';
import 'package:flutter_animarker/lat_lng_interpolation.dart'; // import 'package:flutter_animarker/lat_lng_interpolation.dart';
import 'package:flutter_animarker/models/lat_lng_delta.dart'; // import 'package:flutter_animarker/models/lat_lng_delta.dart';
import 'package:flutter_animarker/models/lat_lng_info.dart'; // import 'package:flutter_animarker/models/lat_lng_info.dart';
import 'package:flutter_polyline_points/flutter_polyline_points.dart'; // import 'package:flutter_polyline_points/flutter_polyline_points.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; // import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:location/location.dart'; // import 'package:location/location.dart';
//
class TrackDriver extends StatefulWidget { // class TrackDriver extends StatefulWidget {
final OrderDetailModel order; // final OrderDetailModel order;
TrackDriver({this.order}); // TrackDriver({this.order});
//
@override // @override
State<TrackDriver> createState() => _TrackDriverState(); // State<TrackDriver> createState() => _TrackDriverState();
} // }
//
class _TrackDriverState extends State<TrackDriver> { // class _TrackDriverState extends State<TrackDriver> {
OrderPreviewService _orderServices = locator<OrderPreviewService>(); // OrderPreviewService _orderServices = locator<OrderPreviewService>();
OrderDetailModel _order; // OrderDetailModel _order;
//
Completer<GoogleMapController> _controller = Completer(); // Completer<GoogleMapController> _controller = Completer();
//
//
double CAMERA_ZOOM = 14; // double CAMERA_ZOOM = 14;
double CAMERA_TILT = 0; // double CAMERA_TILT = 0;
double CAMERA_BEARING = 30; // double CAMERA_BEARING = 30;
LatLng SOURCE_LOCATION = null; // LatLng SOURCE_LOCATION = null;
LatLng DEST_LOCATION = null; // LatLng DEST_LOCATION = null;
//
// for my drawn routes on the map // // for my drawn routes on the map
Set<Polyline> _polylines = Set<Polyline>(); // Set<Polyline> _polylines = Set<Polyline>();
List<LatLng> polylineCoordinates = []; // List<LatLng> polylineCoordinates = [];
PolylinePoints polylinePoints; // PolylinePoints polylinePoints;
//
Set<Marker> _markers = Set<Marker>(); // Set<Marker> _markers = Set<Marker>();
//
BitmapDescriptor sourceIcon; // for my custom marker pins // BitmapDescriptor sourceIcon; // for my custom marker pins
BitmapDescriptor destinationIcon; // for my custom marker pins // BitmapDescriptor destinationIcon; // for my custom marker pins
Location location;// wrapper around the location API // Location location;// wrapper around the location API
//
//
int locationUpdateFreq = 2; // int locationUpdateFreq = 2;
LatLngInterpolationStream _latLngStream; // LatLngInterpolationStream _latLngStream;
StreamGroup<LatLngDelta> subscriptions; // StreamGroup<LatLngDelta> subscriptions;
//
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
//
_order = widget.order; // _order = widget.order;
DEST_LOCATION = _order.shippingAddress.getLocation(); // DEST_LOCATION = _order.shippingAddress.getLocation();
location = new Location(); // location = new Location();
polylinePoints = PolylinePoints(); // polylinePoints = PolylinePoints();
setSourceAndDestinationIcons(); // setSourceAndDestinationIcons();
//
initMarkerUpdateStream(); // initMarkerUpdateStream();
startUpdatingDriverLocation(); // startUpdatingDriverLocation();
//
} // }
//
@override // @override
void dispose() { // void dispose() {
super.dispose(); // super.dispose();
subscriptions.close(); // subscriptions.close();
_latLngStream.cancel(); // _latLngStream.cancel();
stopUpdatingDriverLocation(); // stopUpdatingDriverLocation();
} // }
//
initMarkerUpdateStream(){ // initMarkerUpdateStream(){
_latLngStream = LatLngInterpolationStream(movementDuration: Duration(seconds: locationUpdateFreq+1)); // _latLngStream = LatLngInterpolationStream(movementDuration: Duration(seconds: locationUpdateFreq+1));
subscriptions = StreamGroup<LatLngDelta>(); // subscriptions = StreamGroup<LatLngDelta>();
//
subscriptions.add(_latLngStream.getAnimatedPosition('sourcePin')); // subscriptions.add(_latLngStream.getAnimatedPosition('sourcePin'));
subscriptions.stream.listen((LatLngDelta delta) { // subscriptions.stream.listen((LatLngDelta delta) {
//Update the marker with animation // //Update the marker with animation
setState(() { // setState(() {
//Get the marker Id for this animation // //Get the marker Id for this animation
var markerId = MarkerId(delta.markerId); // var markerId = MarkerId(delta.markerId);
Marker sourceMarker = Marker( // Marker sourceMarker = Marker(
markerId: markerId, // markerId: markerId,
// rotation: delta.rotation, // // rotation: delta.rotation,
icon: sourceIcon, // icon: sourceIcon,
position: LatLng( // position: LatLng(
delta.from.latitude, // delta.from.latitude,
delta.from.longitude, // delta.from.longitude,
), // ),
onTap: onSourceMarkerTap // onTap: onSourceMarkerTap
); // );
//
_markers.removeWhere((m) => m.markerId.value == 'sourcePin'); // _markers.removeWhere((m) => m.markerId.value == 'sourcePin');
_markers.add(sourceMarker); // _markers.add(sourceMarker);
}); // });
}); // });
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
//
return AppScaffold( // return AppScaffold(
appBarTitle: TranslationBase.of(context).deliveryDriverTrack, // appBarTitle: TranslationBase.of(context).deliveryDriverTrack,
isShowAppBar: true, // isShowAppBar: true,
isPharmacy: true, // isPharmacy: true,
showPharmacyCart: false, // showPharmacyCart: false,
showHomeAppBarIcon: false, // showHomeAppBarIcon: false,
body: GoogleMap( // body: GoogleMap(
myLocationEnabled: true, // myLocationEnabled: true,
compassEnabled: true, // compassEnabled: true,
markers: _markers, // markers: _markers,
polylines: _polylines, // polylines: _polylines,
mapType: MapType.normal, // mapType: MapType.normal,
initialCameraPosition: CameraPosition(target: DEST_LOCATION, zoom: 4), // initialCameraPosition: CameraPosition(target: DEST_LOCATION, zoom: 4),
onMapCreated: (GoogleMapController controller) { // onMapCreated: (GoogleMapController controller) {
_controller.complete(controller); // _controller.complete(controller);
// showPinsOnMap(); // // showPinsOnMap();
}, // },
), // ),
// floatingActionButton: FloatingActionButton.extended( // // floatingActionButton: FloatingActionButton.extended(
// onPressed: _goToDriver, // // onPressed: _goToDriver,
// label: Text('To the lake!'), // // label: Text('To the lake!'),
// icon: Icon(Icons.directions_boat), // // icon: Icon(Icons.directions_boat),
// ), // // ),
); // );
} // }
//
//
void setSourceAndDestinationIcons() async { // void setSourceAndDestinationIcons() async {
final Uint8List srcMarkerBytes = await getBytesFromAsset('assets/images/map_markers/source_map_marker.png', getMarkerIconSize()); // final Uint8List srcMarkerBytes = await getBytesFromAsset('assets/images/map_markers/source_map_marker.png', getMarkerIconSize());
final Uint8List destMarkerBytes = await getBytesFromAsset('assets/images/map_markers/destination_map_marker.png', getMarkerIconSize()); // final Uint8List destMarkerBytes = await getBytesFromAsset('assets/images/map_markers/destination_map_marker.png', getMarkerIconSize());
sourceIcon = await BitmapDescriptor.fromBytes(srcMarkerBytes); // sourceIcon = await BitmapDescriptor.fromBytes(srcMarkerBytes);
destinationIcon = await BitmapDescriptor.fromBytes(destMarkerBytes); // destinationIcon = await BitmapDescriptor.fromBytes(destMarkerBytes);
} // }
//
CameraPosition _orderDeliveryLocationCamera(){ // CameraPosition _orderDeliveryLocationCamera(){
if(DEST_LOCATION != null){ // if(DEST_LOCATION != null){
final CameraPosition orderDeliveryLocCamera = CameraPosition( // final CameraPosition orderDeliveryLocCamera = CameraPosition(
bearing: CAMERA_BEARING, // bearing: CAMERA_BEARING,
target: DEST_LOCATION, // target: DEST_LOCATION,
tilt: CAMERA_TILT, // tilt: CAMERA_TILT,
zoom: CAMERA_ZOOM); // zoom: CAMERA_ZOOM);
return orderDeliveryLocCamera; // return orderDeliveryLocCamera;
} // }
return null; // return null;
} // }
//
CameraPosition _driverLocationCamera(){ // CameraPosition _driverLocationCamera(){
if(DEST_LOCATION != null) { // if(DEST_LOCATION != null) {
final CameraPosition driverLocCamera = CameraPosition( // final CameraPosition driverLocCamera = CameraPosition(
bearing: CAMERA_BEARING, // bearing: CAMERA_BEARING,
target: SOURCE_LOCATION, // target: SOURCE_LOCATION,
tilt: CAMERA_TILT, // tilt: CAMERA_TILT,
zoom: CAMERA_ZOOM); // zoom: CAMERA_ZOOM);
return driverLocCamera; // return driverLocCamera;
} // }
return null; // return null;
} // }
//
//
Future<void> _goToOrderDeliveryLocation() async { // Future<void> _goToOrderDeliveryLocation() async {
final GoogleMapController controller = await _controller.future; // final GoogleMapController controller = await _controller.future;
final CameraPosition orderDeliveryLocCamera = _orderDeliveryLocationCamera(); // final CameraPosition orderDeliveryLocCamera = _orderDeliveryLocationCamera();
controller.animateCamera(CameraUpdate.newCameraPosition(orderDeliveryLocCamera)); // controller.animateCamera(CameraUpdate.newCameraPosition(orderDeliveryLocCamera));
} // }
//
Future<void> _goToDriver() async { // Future<void> _goToDriver() async {
final GoogleMapController controller = await _controller.future; // final GoogleMapController controller = await _controller.future;
final CameraPosition driverLocCamera = _driverLocationCamera(); // final CameraPosition driverLocCamera = _driverLocationCamera();
controller.animateCamera(CameraUpdate.newCameraPosition(driverLocCamera)); // controller.animateCamera(CameraUpdate.newCameraPosition(driverLocCamera));
} // }
//
//
void showPinsOnMap() { // void showPinsOnMap() {
// source pin // // source pin
if(SOURCE_LOCATION != null){ // if(SOURCE_LOCATION != null){
setState(() { // setState(() {
var pinPosition = SOURCE_LOCATION; // var pinPosition = SOURCE_LOCATION;
_markers.removeWhere((m) => m.markerId.value == 'sourcePin'); // _markers.removeWhere((m) => m.markerId.value == 'sourcePin');
_markers.add(Marker( // _markers.add(Marker(
markerId: MarkerId('sourcePin'), // markerId: MarkerId('sourcePin'),
position: pinPosition, // position: pinPosition,
icon: sourceIcon, // icon: sourceIcon,
infoWindow: InfoWindow(title: TranslationBase.of(context).driver), // infoWindow: InfoWindow(title: TranslationBase.of(context).driver),
onTap: onSourceMarkerTap // onTap: onSourceMarkerTap
)); // ));
}); // });
} // }
//
// destination pin // // destination pin
if(DEST_LOCATION != null){ // if(DEST_LOCATION != null){
setState(() { // setState(() {
var destPosition = DEST_LOCATION; // var destPosition = DEST_LOCATION;
_markers.removeWhere((m) => m.markerId.value == 'destPin'); // _markers.removeWhere((m) => m.markerId.value == 'destPin');
_markers.add(Marker( // _markers.add(Marker(
markerId: MarkerId('destPin'), // markerId: MarkerId('destPin'),
position: destPosition, // position: destPosition,
icon: destinationIcon, // icon: destinationIcon,
infoWindow: InfoWindow(title: TranslationBase.of(context).deliveryLocation), // infoWindow: InfoWindow(title: TranslationBase.of(context).deliveryLocation),
onTap: onDestinationMarkerTap // onTap: onDestinationMarkerTap
)); // ));
}); // });
} // }
// set the route lines on the map from source to destination // // set the route lines on the map from source to destination
// for more info follow this tutorial // // for more info follow this tutorial
// drawRoute(); // // drawRoute();
} // }
//
void updatePinOnMap() async { // void updatePinOnMap() async {
_latLngStream.addLatLng(LatLngInfo(SOURCE_LOCATION.latitude, SOURCE_LOCATION.longitude, "sourcePin")); // _latLngStream.addLatLng(LatLngInfo(SOURCE_LOCATION.latitude, SOURCE_LOCATION.longitude, "sourcePin"));
drawRoute(); // drawRoute();
} // }
//
void drawRoute() async { // void drawRoute() async {
return; // Ignore draw Route // return; // Ignore draw Route
//
List<PointLatLng> result = await polylinePoints.getRouteBetweenCoordinates( // List<PointLatLng> result = await polylinePoints.getRouteBetweenCoordinates(
GOOGLE_API_KEY, // GOOGLE_API_KEY,
SOURCE_LOCATION.latitude, // SOURCE_LOCATION.latitude,
SOURCE_LOCATION.longitude, // SOURCE_LOCATION.longitude,
DEST_LOCATION.latitude, // DEST_LOCATION.latitude,
DEST_LOCATION.longitude); // DEST_LOCATION.longitude);
if(result.isNotEmpty){ // if(result.isNotEmpty){
result.forEach((PointLatLng point){ // result.forEach((PointLatLng point){
polylineCoordinates.add( // polylineCoordinates.add(
LatLng(point.latitude,point.longitude) // LatLng(point.latitude,point.longitude)
); // );
}); // });
setState(() { // setState(() {
_polylines.add(Polyline( // _polylines.add(Polyline(
width: 5, // set the width of the polylines // width: 5, // set the width of the polylines
polylineId: PolylineId('poly'), // polylineId: PolylineId('poly'),
color: Color.fromARGB(255, 40, 122, 198), // color: Color.fromARGB(255, 40, 122, 198),
points: polylineCoordinates // points: polylineCoordinates
)); // ));
}); // });
} // }
} // }
//
bool isLocationUpdating = false; // bool isLocationUpdating = false;
startUpdatingDriverLocation({int frequencyInSeconds = 2}) async{ // startUpdatingDriverLocation({int frequencyInSeconds = 2}) async{
isLocationUpdating = true; // isLocationUpdating = true;
int driverId = int.tryParse(_order.driverID); // int driverId = int.tryParse(_order.driverID);
//
Future.doWhile(() async{ // Future.doWhile(() async{
if(isLocationUpdating){ // if(isLocationUpdating){
//
await Future.delayed(Duration(seconds: frequencyInSeconds)); // await Future.delayed(Duration(seconds: frequencyInSeconds));
//
showLoading(); // showLoading();
LatLng driverLocation = (await _orderServices.getDriverLocation(driverId)); // LatLng driverLocation = (await _orderServices.getDriverLocation(driverId));
hideLoading(); // hideLoading();
//
if(driverLocation != null){ // if(driverLocation != null){
if(SOURCE_LOCATION == null || DEST_LOCATION == null){ // if(SOURCE_LOCATION == null || DEST_LOCATION == null){
SOURCE_LOCATION = driverLocation; // SOURCE_LOCATION = driverLocation;
DEST_LOCATION = _order.shippingAddress.getLocation(); // DEST_LOCATION = _order.shippingAddress.getLocation();
showPinsOnMap(); // showPinsOnMap();
} // }
SOURCE_LOCATION = driverLocation; // SOURCE_LOCATION = driverLocation;
updatePinOnMap(); // updatePinOnMap();
updateMapCamera(); // updateMapCamera();
}else{ // }else{
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
} // }
} // }
return isLocationUpdating; // return isLocationUpdating;
//
}); // });
} // }
//
showLoading(){ // showLoading(){
if(SOURCE_LOCATION == null){ // if(SOURCE_LOCATION == null){
GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
} // }
} // }
//
hideLoading(){ // hideLoading(){
if(SOURCE_LOCATION == null){ // if(SOURCE_LOCATION == null){
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
} // }
} // }
//
stopUpdatingDriverLocation(){ // stopUpdatingDriverLocation(){
isLocationUpdating = false; // isLocationUpdating = false;
} // }
//
Future<Uint8List> getBytesFromAsset(String path, int width) async { // Future<Uint8List> getBytesFromAsset(String path, int width) async {
ByteData data = await rootBundle.load(path); // ByteData data = await rootBundle.load(path);
ui.Codec codec = await ui.instantiateImageCodec(data.buffer.asUint8List(), targetWidth: width); // ui.Codec codec = await ui.instantiateImageCodec(data.buffer.asUint8List(), targetWidth: width);
ui.FrameInfo fi = await codec.getNextFrame(); // ui.FrameInfo fi = await codec.getNextFrame();
return (await fi.image.toByteData(format: ui.ImageByteFormat.png)).buffer.asUint8List(); // return (await fi.image.toByteData(format: ui.ImageByteFormat.png)).buffer.asUint8List();
} // }
//
int getMarkerIconSize(){ // int getMarkerIconSize(){
return 140; // return 140;
} // }
//
updateMapCamera() async{ // updateMapCamera() async{
if(SOURCE_LOCATION != null && DEST_LOCATION != null){ // if(SOURCE_LOCATION != null && DEST_LOCATION != null){
//
// 'package:google_maps_flutter_platform_interface/src/types/location.dart': Failed assertion: line 72 pos 16: 'southwest.latitude <= northeast.latitude': is not true. // // 'package:google_maps_flutter_platform_interface/src/types/location.dart': Failed assertion: line 72 pos 16: 'southwest.latitude <= northeast.latitude': is not true.
LatLngBounds bound; // LatLngBounds bound;
if(SOURCE_LOCATION.latitude <= DEST_LOCATION.latitude){ // if(SOURCE_LOCATION.latitude <= DEST_LOCATION.latitude){
bound = LatLngBounds(southwest: SOURCE_LOCATION, northeast: DEST_LOCATION); // bound = LatLngBounds(southwest: SOURCE_LOCATION, northeast: DEST_LOCATION);
}else{ // }else{
bound = LatLngBounds(southwest: DEST_LOCATION, northeast: SOURCE_LOCATION); // bound = LatLngBounds(southwest: DEST_LOCATION, northeast: SOURCE_LOCATION);
} // }
//
if(bound == null) // if(bound == null)
return; // return;
//
CameraUpdate camera = CameraUpdate.newLatLngBounds(bound, 50); // CameraUpdate camera = CameraUpdate.newLatLngBounds(bound, 50);
final GoogleMapController controller = await _controller.future; // final GoogleMapController controller = await _controller.future;
controller.animateCamera(camera); // controller.animateCamera(camera);
} // }
} // }
//
bool showSrcMarkerTitle = false; // bool showSrcMarkerTitle = false;
onSourceMarkerTap() async{ // onSourceMarkerTap() async{
// showSrcMarkerTitle = !showSrcMarkerTitle; // // showSrcMarkerTitle = !showSrcMarkerTitle;
} // }
//
bool showDestMarkerTitle = false; // bool showDestMarkerTitle = false;
onDestinationMarkerTap() async{ // onDestinationMarkerTap() async{
// showDestMarkerTitle = !showDestMarkerTitle; // // showDestMarkerTitle = !showDestMarkerTitle;
// Marker m = _markers.firstWhere((m) => m.markerId.value == 'destPin'); // // Marker m = _markers.firstWhere((m) => m.markerId.value == 'destPin');
// if(showDestMarkerTitle){ // // if(showDestMarkerTitle){
// } // // }
} // }
} // }

@ -431,7 +431,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: PharmacyAddressesPage())); Navigator.push(context, FadePage(page: PharmacyAddressesPage()));
}, },
child: Row( child: Row(
children: <Widget>[ children: <Widget>[

@ -96,7 +96,7 @@ class _MyVaccinesState extends State<MyVaccines> {
() { () {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: projectViewModel.user.emailAddress, email: projectViewModel.user.emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully); model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);

@ -1,7 +1,6 @@
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart'; import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -49,10 +48,9 @@ class _CallPageState extends State<CallPage> {
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
FirebaseMessaging().getToken().then((value){ FirebaseMessaging.instance.getToken().then((value) {
print('FCM_TOKEN: $value'); print('FCM_TOKEN: $value');
}); });
@ -123,10 +121,9 @@ class _CallPageState extends State<CallPage> {
], ],
), ),
); );
} }
dummyCall() async{ dummyCall() async {
final json = { final json = {
"callerID": "12345", "callerID": "12345",
"receiverID": "54321", "receiverID": "54321",
@ -146,7 +143,8 @@ class _CallPageState extends State<CallPage> {
"appointmentdate": "Sun, 15th Dec, 2019", "appointmentdate": "Sun, 15th Dec, 2019",
"appointmenttime": "09:00", "appointmenttime": "09:00",
"type": "video", "type": "video",
"session_id": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0LTE1OTg3NzQ1MDYiLCJpc3MiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0Iiwic3ViIjoiQUNhYWQ1YTNmOGM2NGZhNjczNTY3NTYxNTc0N2YyNmMyYiIsImV4cCI6MTU5ODc3ODEwNiwiZ3JhbnRzIjp7ImlkZW50aXR5IjoiSGFyb29uMSIsInZpZGVvIjp7InJvb20iOiJTbWFsbERhaWx5U3RhbmR1cCJ9fX0.7XUS5uMQQJfkrBZu9EjQ6STL6R7iXkso6BtO1HmrQKk", "session_id":
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0LTE1OTg3NzQ1MDYiLCJpc3MiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0Iiwic3ViIjoiQUNhYWQ1YTNmOGM2NGZhNjczNTY3NTYxNTc0N2YyNmMyYiIsImV4cCI6MTU5ODc3ODEwNiwiZ3JhbnRzIjp7ImlkZW50aXR5IjoiSGFyb29uMSIsInZpZGVvIjp7InJvb20iOiJTbWFsbERhaWx5U3RhbmR1cCJ9fX0.7XUS5uMQQJfkrBZu9EjQ6STL6R7iXkso6BtO1HmrQKk",
"identity": "Haroon1", "identity": "Haroon1",
"name": "SmallDailyStandup", "name": "SmallDailyStandup",
"videoUrl": "video", "videoUrl": "video",
@ -154,26 +152,19 @@ class _CallPageState extends State<CallPage> {
"is_call": "true" "is_call": "true"
}; };
IncomingCallData incomingCallData = IncomingCallData.fromJson(json); IncomingCallData incomingCallData = IncomingCallData.fromJson(json);
final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: incomingCallData))); final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: incomingCallData)));
} }
fcmConfigure(){ fcmConfigure() {
FirebaseMessaging().configure( FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
onMessage: (message) async{ print(message.toString());
print(message.toString());
IncomingCallData incomingCallData; IncomingCallData incomingCallData;
if(Platform.isAndroid) if (Platform.isAndroid)
incomingCallData = IncomingCallData.fromJson(message['data']); incomingCallData = IncomingCallData.fromJson(message.data['data']);
else if(Platform.isIOS) else if (Platform.isIOS) incomingCallData = IncomingCallData.fromJson(message.data);
incomingCallData = IncomingCallData.fromJson(message); if (incomingCallData != null) final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: incomingCallData)));
if(incomingCallData != null) });
final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: incomingCallData)));
}
);
} }
} }

@ -31,7 +31,7 @@ class LocalNotification {
_initialize() { _initialize() {
var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null);
var initializationSettings = InitializationSettings(initializationSettingsAndroid, initializationSettingsIOS); var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick);
} }
@ -53,10 +53,10 @@ class LocalNotification {
Future showNow({@required String title, @required String subtitle, String payload}) { Future showNow({@required String title, @required String subtitle, String payload}) {
Future.delayed(Duration(seconds: 1)).then((result) async { Future.delayed(Duration(seconds: 1)).then((result) async {
var androidPlatformChannelSpecifics = var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG',
AndroidNotificationDetails('com.hmg.local_notification', 'HMG', 'HMG', importance: Importance.Max, priority: Priority.High, ticker: 'ticker', vibrationPattern: _vibrationPattern()); channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern());
var iOSPlatformChannelSpecifics = IOSNotificationDetails(); var iOSPlatformChannelSpecifics = IOSNotificationDetails();
var platformChannelSpecifics = NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
print(err); print(err);
}); });
@ -71,7 +71,8 @@ class LocalNotification {
vibrationPattern[2] = 5000; vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000; vibrationPattern[3] = 2000;
var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', 'ActivePrescriptionsDescription', var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
channelDescription: 'ActivePrescriptionsDescription',
// icon: 'secondary_icon', // icon: 'secondary_icon',
sound: RawResourceAndroidNotificationSound('slow_spring_board'), sound: RawResourceAndroidNotificationSound('slow_spring_board'),
@ -86,14 +87,14 @@ class LocalNotification {
var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff');
// /change it to be as ionic // /change it to be as ionic
var platformChannelSpecifics = NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics);
} }
///Repeat notification every day at approximately 10:00:00 am ///Repeat notification every day at approximately 10:00:00 am
Future showDailyAtTime() async { Future showDailyAtTime() async {
var time = Time(10, 0, 0); var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', 'repeatDailyAtTime description'); var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description');
var iOSPlatformChannelSpecifics = IOSNotificationDetails(); var iOSPlatformChannelSpecifics = IOSNotificationDetails();
// var platformChannelSpecifics = NotificationDetails( // var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
@ -108,7 +109,7 @@ class LocalNotification {
///Repeat notification weekly on Monday at approximately 10:00:00 am ///Repeat notification weekly on Monday at approximately 10:00:00 am
Future showWeeklyAtDayAndTime() async { Future showWeeklyAtDayAndTime() async {
var time = Time(10, 0, 0); var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', 'show weekly description'); var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description');
var iOSPlatformChannelSpecifics = IOSNotificationDetails(); var iOSPlatformChannelSpecifics = IOSNotificationDetails();
// var platformChannelSpecifics = NotificationDetails( // var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);

@ -4,13 +4,13 @@ import '../widgets/Loader/gif_loader_container.dart';
class GifLoaderDialogUtils { class GifLoaderDialogUtils {
static showMyDialog(BuildContext context) { static showMyDialog(BuildContext context) {
showDialog(context: context, child: GifLoaderContainer()); showDialog(context: context, builder: (cxt) => GifLoaderContainer());
} }
static hideDialog(BuildContext context) { static hideDialog(BuildContext context) {
try{ try {
Navigator.of(context).pop(); Navigator.of(context).pop();
}catch(error){ } catch (error) {
Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context).pop()); Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context).pop());
} }
} }

@ -23,7 +23,7 @@ class ImageOptions {
icon: Icons.image, icon: Icons.image,
onTap: () async { onTap: () async {
File _image = File _image =
await ImagePicker.pickImage(source: ImageSource.gallery, imageQuality: 20); File((await ImagePicker.platform.pickImage(source: ImageSource.gallery, imageQuality: 20)).path);
String fileName = _image.path; String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync(); final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes); String base64Encode = base64.encode(bytes);
@ -37,7 +37,7 @@ class ImageOptions {
icon: Icons.camera_alt, icon: Icons.camera_alt,
onTap: () async { onTap: () async {
File _image = File _image =
await ImagePicker.pickImage(source: ImageSource.camera, imageQuality: 20); File((await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20)).path);
String fileName = _image.path; String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync(); final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes); String base64Encode = base64.encode(bytes);

@ -1,5 +1,3 @@
import 'dart:math' as math;
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -13,6 +11,7 @@ class LineChartModel {
class CustomLineChart extends StatefulWidget { class CustomLineChart extends StatefulWidget {
final List<LineChartModel> list; final List<LineChartModel> list;
final bool isArabic; final bool isArabic;
CustomLineChart(this.list, this.isArabic); CustomLineChart(this.list, this.isArabic);
@override @override
@ -81,7 +80,7 @@ class _CustomLineChartState extends State<CustomLineChart> {
SideTitles left = SideTitles( SideTitles left = SideTitles(
showTitles: true, showTitles: true,
interval: 1, interval: 1,
getTextStyles: (value) => const TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: 0), getTextStyles: (cxt, value) => const TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: 0),
getTitles: (value) { getTitles: (value) {
if (widget.list.isEmpty) { if (widget.list.isEmpty) {
return (value).toInt().toString(); return (value).toInt().toString();
@ -110,7 +109,7 @@ class _CustomLineChartState extends State<CustomLineChart> {
showTitles: true, showTitles: true,
reservedSize: 22, reservedSize: 22,
interval: 1, interval: 1,
getTextStyles: (value) => const TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: 0), getTextStyles: (cxt, value) => const TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: 0),
getTitles: (value) { getTitles: (value) {
String _title = list[value.toInt()].title; String _title = list[value.toInt()].title;
return (_title.length > 3 ? (widget.isArabic ? _title : _title.substring(0, 3)) : _title).toUpperCase(); return (_title.length > 3 ? (widget.isArabic ? _title : _title.substring(0, 3)) : _title).toUpperCase();

@ -102,21 +102,21 @@ class ShowChart extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),
rotateAngle: -65, rotateAngle: -65,
margin: 22, margin: 22,
getTitles: (value) { getTitles: (value) {
if(isWeeklyOrMonthly) { if (isWeeklyOrMonthly) {
return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.month}'; return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.month}';
} else { } else {
if (timeSeries.length < 15) { if (timeSeries.length < 15) {
@ -137,7 +137,7 @@ class ShowChart extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => const TextStyle( getTextStyles: (cxt, value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,

@ -132,7 +132,7 @@ class LabResultWidget extends StatelessWidget {
void showConfirmMessage(BuildContext context, String email, String isOutsideKSA) { void showConfirmMessage(BuildContext context, String email, String isOutsideKSA) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: email, email: email,
onTapSendEmail: () { onTapSendEmail: () {
generateCovidCertificate(context, isOutsideKSA); generateCovidCertificate(context, isOutsideKSA);

@ -76,14 +76,14 @@ class LineChartCurvedState extends State<LineChartCurved> {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (LineTouchResponse touchResponse) {}, touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: false, drawHorizontalLine: true), gridData: FlGridData(show: true, drawVerticalLine: false, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12), getTextStyles: (cxt, value) => TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12),
margin: 8, margin: 8,
rotateAngle: -0, rotateAngle: -0,
getTitles: (value) { getTitles: (value) {
@ -107,7 +107,7 @@ class LineChartCurvedState extends State<LineChartCurved> {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
getTextStyles: (value) => TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12), getTextStyles: (cxt, value) => TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12),
getTitles: (value) { getTitles: (value) {
return '${value}'; return '${value}';

@ -77,27 +77,38 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
shrinkWrap: !widget.isScrollable, shrinkWrap: !widget.isScrollable,
padding: EdgeInsets.only(bottom: widget.isScrollable ? 21 : 42, top: 10), padding: EdgeInsets.only(bottom: widget.isScrollable ? 21 : 42, top: 10),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Row( return InkWell(
children: [ onTap: () {
SizedBox( setState(() {
width: 22, selectedIndex = widget.listData[index].value;
height: 22, });
child: Radio( },
value: widget.listData[index].value, child: Row(
groupValue: selectedIndex, crossAxisAlignment: CrossAxisAlignment.start,
onChanged: (value) { children: [
setState(() { SizedBox(
selectedIndex = value; width: 22,
}); height: 22,
}, child: Radio(
value: widget.listData[index].value,
groupValue: selectedIndex,
onChanged: (value) {
setState(() {
selectedIndex = value;
});
},
),
), ),
), SizedBox(width: 8),
SizedBox(width: 8), Expanded(
Text( child: Text(
widget.listData[index].title, widget.listData[index].title,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56), // maxLines: 2,
), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56),
], ),
),
],
),
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 10), separatorBuilder: (context, index) => SizedBox(height: 10),
@ -110,7 +121,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).save, TranslationBase.of(context).save,
(){ () {
Navigator.pop(context); Navigator.pop(context);
widget.onValueSelected(selectedIndex); widget.onValueSelected(selectedIndex);
}, },

@ -22,19 +22,17 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)), inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)),
crossPlatform: InAppBrowserOptions(hideUrlBar: true), crossPlatform: InAppBrowserOptions(hideUrlBar: true),
ios: IOSInAppBrowserOptions( ios: IOSInAppBrowserOptions(
toolbarBottom: false, hideToolbarBottom: false,
)); ));
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE paymentType;
static String SERVICE_URL = static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String PREAUTH_SERVICE_URL = static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
@ -77,17 +75,17 @@ class MyInAppBrowser extends InAppBrowser {
} }
@override @override
Future onLoadStart(String url) async { Future onLoadStart(Uri url) async {
if (onLoadStartCallback != null) onLoadStartCallback(url); if (onLoadStartCallback != null) onLoadStartCallback(url);
} }
@override @override
Future onLoadStop(String url) async { Future onLoadStop(Uri url) async {
print("\n\nStopped $url\n\n"); print("\n\nStopped $url\n\n");
} }
@override @override
void onLoadError(String url, int code, String message) { void onLoadError(Uri url, int code, String message) {
print("Can't load $url.. Error: $message"); print("Can't load $url.. Error: $message");
} }
@ -100,18 +98,18 @@ class MyInAppBrowser extends InAppBrowser {
if (onExitCallback != null) onExitCallback(appo, isPaymentDone); if (onExitCallback != null) onExitCallback(appo, isPaymentDone);
} }
@override // @override
Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async { // Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async {
var url = shouldOverrideUrlLoadingRequest.url; // var url = shouldOverrideUrlLoadingRequest.url;
debugPrint("redirecting/overriding to: $url"); // debugPrint("redirecting/overriding to: $url");
//
if (paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL].contains(url)) { // if (paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL].contains(url)) {
isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL); // isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL);
close(); // close();
} // }
//
return ShouldOverrideUrlLoadingAction.ALLOW; // return ShouldOverrideUrlLoadingAction.ALLOW;
} // }
getLanguageID() async { getLanguageID() async {
return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
@ -136,7 +134,7 @@ class MyInAppBrowser extends InAppBrowser {
openPackagesPaymentBrowser({@required int customer_id, @required int order_id}) { openPackagesPaymentBrowser({@required int customer_id, @required int order_id}) {
paymentType = _PAYMENT_TYPE.PACKAGES; paymentType = _PAYMENT_TYPE.PACKAGES;
var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id'; var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id';
this.openUrl(url: full_url, options: _InAppBrowserOptions); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(full_url)), options: _InAppBrowserOptions);
} }
openPaymentBrowser(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID, openPaymentBrowser(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID,
@ -182,9 +180,8 @@ class MyInAppBrowser extends InAppBrowser {
service.applePayInsertRequest(applePayInsertRequest, context).then((res) { service.applePayInsertRequest(applePayInsertRequest, context).then((res) {
if (context != null) GifLoaderDialogUtils.hideDialog(context); if (context != null) GifLoaderDialogUtils.hideDialog(context);
var url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result'];
print(url); safariBrowser.open(url: Uri.parse(url));
safariBrowser.open(url: url);
// this.browser.openUrl(url: url, options: _InAppBrowserOptions); // this.browser.openUrl(url: url, options: _InAppBrowserOptions);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -196,7 +193,7 @@ class MyInAppBrowser extends InAppBrowser {
clinicID, doctorID) clinicID, doctorID)
.then((value) { .then((value) {
paymentType = _PAYMENT_TYPE.PATIENT; paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrl(url: value, options: _InAppBrowserOptions); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions);
}); });
} }
} }
@ -206,13 +203,13 @@ class MyInAppBrowser extends InAppBrowser {
this.browser = browser; this.browser = browser;
getPatientData(); getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
this.browser.openUrl(url: value); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)));
}); });
} }
openBrowser(String url) { openBrowser(String url) {
this.browser = browser; this.browser = browser;
this.browser.openUrl(url: url, options: _InAppBrowserOptions); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions);
} }
Future<String> generateURL(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID, Future<String> generateURL(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID,
@ -351,7 +348,7 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
final Function onLoadStartCallback; final Function onLoadStartCallback;
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
MyChromeSafariBrowser(browserFallback, {@required this.onExitCallback, @required this.onLoadStartCallback, @required this.appo}) : super(bFallback: browserFallback); MyChromeSafariBrowser(browserFallback, {@required this.onExitCallback, @required this.onLoadStartCallback, @required this.appo});
@override @override
void onOpened() { void onOpened() {

@ -176,7 +176,7 @@ class DoctorHeader extends StatelessWidget {
void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: email, email: email,
onTapSendEmail: () { onTapSendEmail: () {
onTap(); onTap();

@ -104,7 +104,7 @@ class _OffersAndPackagesWidgetState extends State<OffersAndPackagesWidget> {
return Container( return Container(
child: CarouselSlider.builder( child: CarouselSlider.builder(
itemCount: widget.models.length, itemCount: widget.models.length,
itemBuilder: (BuildContext context, int itemIndex) { itemBuilder: (BuildContext context, int itemIndex,int realIndex) {
var item = widget.models[itemIndex]; var item = widget.models[itemIndex];
return OfferPackagesItemWidget(model: item); return OfferPackagesItemWidget(model: item);
}, },

@ -269,7 +269,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
} }
requestPermissions() async { requestPermissions() async {
if (await Permission.microphone.isDenied || await Permission.microphone.isUndetermined) { if (await Permission.microphone.isDenied || await Permission.microphone.isPermanentlyDenied) {
Map<Permission, PermissionStatus> statuses = await [ Map<Permission, PermissionStatus> statuses = await [
Permission.microphone, Permission.microphone,
].request(); ].request();

@ -125,7 +125,7 @@ class _NotAutPageState extends State<NotAutPage> {
Scaffold( Scaffold(
backgroundColor: Color(0xfff8f8f8), backgroundColor: Color(0xfff8f8f8),
resizeToAvoidBottomPadding: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
leading: IconButton( leading: IconButton(

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -6,7 +7,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart'; import 'package:sms_retriever/sms_retriever.dart';
import '../otp_widget.dart'; import '../otp_widget.dart';
@ -58,6 +59,7 @@ class SMSOTP {
String _code; String _code;
dynamic setState; dynamic setState;
static String signature; static String signature;
displayDialog(BuildContext context) async { displayDialog(BuildContext context) async {
return showDialog( return showDialog(
context: context, context: context,
@ -84,7 +86,7 @@ class SMSOTP {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
type == 1 ?"assets/images/new/verify_sms.svg":"assets/images/new/verify_whatsapp.svg", type == 1 ? "assets/images/new/verify_sms.svg" : "assets/images/new/verify_whatsapp.svg",
height: 50, height: 50,
width: 50, width: 50,
), ),
@ -236,6 +238,10 @@ class SMSOTP {
} }
static getSignature() async { static getSignature() async {
return await SmsRetrieved.getAppSignature(); if (Platform.isAndroid) {
return await SmsRetriever.getAppSignature();
} else {
return null;
}
} }
} }

@ -5,7 +5,7 @@ description: A new Flutter application.
version: 4.3.5+1 version: 4.3.5+1
environment: environment:
sdk: ">=2.9.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
@ -14,58 +14,58 @@ dependencies:
# Localizations # Localizations
flutter_localizations: flutter_localizations:
sdk: flutter sdk: flutter
intl: ^0.16.0 intl: ^0.17.0
# web view # web view
webview_flutter: ^1.0.7 webview_flutter: ^2.3.1
# http client # http client
http: ^0.12.1 http: ^0.13.4
connectivity: ^0.4.9+3 connectivity: ^3.0.6
async: ^2.4.2 async: ^2.8.1
audio_wave: ^0.0.3 audio_wave: ^0.1.2
# State Management # State Management
provider: ^4.3.2+2 provider: ^6.0.1
#Dependency Injection #Dependency Injection
get_it: ^4.0.2 get_it: ^7.2.0
#Google Fit & Apple HealthKit #Google Fit & Apple HealthKit
fit_kit: ^1.1.2 fit_kit: ^1.1.2
#chart #chart
fl_chart: ^0.12.3 fl_chart: ^0.40.2
#Camera Preview #Camera Preview
camera: ^0.7.0+4 camera: ^0.9.4+5
# Permissions # Permissions
permission_handler: ^5.1.0+2 permission_handler: ^8.3.0
# Flutter Html View # Flutter Html View
flutter_html: ^1.2.0 flutter_html: ^2.1.5
# Pagnation # Pagnation
pull_to_refresh: 1.6.2 pull_to_refresh: ^2.0.0
# Native # Native
local_auth: ^0.6.2+3 local_auth: ^1.1.8
localstorage: ^3.0.3+6 localstorage: ^4.0.0+1
maps_launcher: ^1.2.1 maps_launcher: ^2.0.1
url_launcher: ^5.5.0 url_launcher: ^6.0.15
shared_preferences: ^0.5.8 shared_preferences: ^2.0.9
flutter_flexible_toast: ^0.1.4 flutter_flexible_toast: ^0.1.4
firebase_messaging: ^7.0.3 firebase_messaging: ^11.1.0
firebase_analytics: ^6.3.0 firebase_analytics: ^8.3.4
# Progress bar # Progress bar
progress_hud_v2: ^2.0.0 progress_hud_v2: ^2.0.0
percent_indicator: ^2.1.5 percent_indicator: ^3.4.0
# Icons # Icons
font_awesome_flutter: any font_awesome_flutter: any
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.0
# Image Attachments # Image Attachments
image_picker: ^0.6.7+1 image_picker: ^0.8.4+4
#GIF image #GIF image
flutter_gifimage: ^1.0.1 flutter_gifimage: ^1.0.1
@ -81,15 +81,15 @@ dependencies:
# flutter_local_notifications: # flutter_local_notifications:
# charts # charts
charts_flutter: ^0.9.0 charts_flutter: ^0.12.0
google_maps_flutter: ^1.0.3 google_maps_flutter: ^2.1.1
huawei_map: ^5.0.3+303 huawei_map: ^6.0.1+304
# Qr code Scanner TODO fix it # Qr code Scanner TODO fix it
# barcode_scanner: ^1.0.1 # barcode_scanner: ^1.0.1
flutter_polyline_points: ^0.1.0 flutter_polyline_points: ^1.0.0
location: ^2.3.5 location: ^4.3.0
# Qr code Scanner # Qr code Scanner
barcode_scan_fix: ^1.0.2 barcode_scan_fix: ^1.0.2
@ -97,66 +97,62 @@ dependencies:
rating_bar: ^0.2.0 rating_bar: ^0.2.0
# Calendar # Calendar
syncfusion_flutter_calendar: ^18.4.49 syncfusion_flutter_calendar: ^19.3.55
# SVG Images # SVG Images
flutter_svg: ^0.19.0 flutter_svg: ^0.23.0+1
#Calendar Events #Calendar Events
manage_calendar_events: ^1.0.2 manage_calendar_events: ^2.0.1
#InAppBrowser #InAppBrowser
flutter_inappwebview: ^4.0.0+4 flutter_inappwebview: ^5.3.2
#Circular progress bar for reverse timer #Circular progress bar for reverse timer
circular_countdown_timer: ^0.0.5 circular_countdown_timer: ^0.2.0
#Just Audio to play ringing for incoming video call #Just Audio to play ringing for incoming video call
just_audio: ^0.3.4 just_audio: ^0.9.18
#hijri #hijri
hijri: ^2.0.3 hijri: ^2.0.3
#datetime_picker #datetime_picker
flutter_datetime_picker: ^1.4.0 flutter_datetime_picker: ^1.5.1
# Carousel # Carousel
carousel_pro: ^1.0.0 carousel_pro: ^1.0.0
#local_notifications #local_notifications
flutter_local_notifications: ^1.5.0 flutter_local_notifications: ^9.1.4
#rxdart
rxdart: ^0.24.1
#device_calendar #device_calendar
device_calendar: ^3.1.0 device_calendar: ^3.1.0
#Handle Geolocation #Handle Geolocation
geolocator: ^6.1.10 geolocator: ^7.7.1
jiffy: ^3.0.0 jiffy: ^4.1.0
#Flutter WebRTC #Flutter WebRTC
flutter_webrtc: ^0.5.9 flutter_webrtc: ^0.7.1
screen: ^0.0.5 screen: ^0.0.5
#google maps places #google maps places
google_maps_place_picker: ^1.0.0
google_maps_place_picker: ^2.1.0-nullsafety.3
#countdown timer for Upcoming List #countdown timer for Upcoming List
flutter_countdown_timer: ^1.6.0 flutter_countdown_timer: ^4.1.0
#Dependencies for video call implementation #Dependencies for video call implementation
native_device_orientation: ^0.3.0 native_device_orientation: ^1.0.0
enum_to_string: ^1.0.9 wakelock: ^0.5.6
wakelock: ^0.2.1+1 after_layout: ^1.1.0
after_layout: ^1.0.7 # twilio_programmable_video: ^0.11.0+1
twilio_programmable_video: ^0.6.2 cached_network_image: ^3.1.0+1
cached_network_image: ^2.4.1
flutter_tts: flutter_tts:
path: flutter_tts-voice_enhancement path: flutter_tts-voice_enhancement
sms_otp_auto_verify: ^1.2.2
wifi: ^0.1.5 wifi: ^0.1.5
vibration: ^1.7.3 vibration: ^1.7.3
@ -165,42 +161,43 @@ dependencies:
speech_to_text: speech_to_text:
path: speech_to_text path: speech_to_text
in_app_update: ^1.1.15 in_app_update: ^2.0.0
in_app_review: ^1.0.4 in_app_review: ^2.0.3
badges: ^1.1.4 badges: ^2.0.1
syncfusion_flutter_sliders: ^18.4.49-beta syncfusion_flutter_sliders: ^19.3.55
searchable_dropdown: ^1.1.3 searchable_dropdown: ^1.1.3
dropdown_search: 0.4.9 dropdown_search: 0.4.9
# Dep by Zohaib # Dep by Zohaib
shimmer: ^1.1.2 shimmer: ^2.0.0
carousel_slider: ^2.3.1 carousel_slider: ^4.0.0
flutter_material_pickers: 1.7.4 flutter_material_pickers: ^3.1.2
flutter_staggered_grid_view: 0.3.4 flutter_staggered_grid_view: ^0.4.1
flutter_hms_gms_availability: ^1.0.0 flutter_hms_gms_availability: ^2.0.0
huawei_location: huawei_location:
path: ./hms-plugins/flutter-hms-location path: ./hms-plugins/flutter-hms-location
# Marker Animation # Marker Animation
flutter_animarker: ^1.0.0 flutter_animarker: ^3.2.0
auto_size_text: ^2.0.1 auto_size_text: ^3.0.0
equatable: ^1.2.5 equatable: ^2.0.3
signalr_core: ^1.0.8 signalr_core: ^1.1.1
wave: ^0.1.0 wave: ^0.2.0
sms_retriever: ^1.0.0
dependency_overrides:
provider : ^5.0.0
permission_handler : ^6.0.1+1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
build_runner: any build_runner: ^2.1.5
flutter: flutter:
uses-material-design: true uses-material-design: true
# assets: # assets:
assets: assets:
- assets/images/ - assets/images/

@ -10,15 +10,15 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
json_annotation: ^3.0.0 json_annotation: ^4.3.0
clock: ^1.0.1 clock: ^1.1.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
build_runner: ^1.0.0 build_runner: ^2.1.5
json_serializable: ^3.0.0 json_serializable: ^6.0.1
fake_async: ^1.0.1 fake_async: ^1.2.0
flutter: flutter:
plugin: plugin:

Loading…
Cancel
Save