diff --git a/.dart_tool/dartpad/web_plugin_registrant.dart b/.dart_tool/dartpad/web_plugin_registrant.dart index e3a2f90..5f5480b 100644 --- a/.dart_tool/dartpad/web_plugin_registrant.dart +++ b/.dart_tool/dartpad/web_plugin_registrant.dart @@ -10,6 +10,7 @@ import 'package:fluttertoast/fluttertoast_web.dart'; import 'package:geolocator_web/geolocator_web.dart'; import 'package:image_picker_for_web/image_picker_for_web.dart'; import 'package:shared_preferences_web/shared_preferences_web.dart'; +import 'package:url_launcher_web/url_launcher_web.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart'; void registerPlugins([final Registrar? pluginRegistrar]) { @@ -18,5 +19,6 @@ void registerPlugins([final Registrar? pluginRegistrar]) { GeolocatorPlugin.registerWith(registrar); ImagePickerPlugin.registerWith(registrar); SharedPreferencesPlugin.registerWith(registrar); + UrlLauncherPlugin.registerWith(registrar); registrar.registerMessageHandler(); } diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 1893ccc..97310cb 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -487,6 +487,54 @@ "packageUri": "lib/", "languageVersion": "2.15" }, + { + "name": "url_launcher", + "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.11", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "url_launcher_android", + "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.38", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "url_launcher_ios", + "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.1.4", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "url_launcher_linux", + "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.5", + "packageUri": "lib/", + "languageVersion": "2.17" + }, + { + "name": "url_launcher_macos", + "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.6", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "url_launcher_platform_interface", + "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_platform_interface-2.1.3", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "url_launcher_web", + "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.18", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "url_launcher_windows", + "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.7", + "packageUri": "lib/", + "languageVersion": "2.18" + }, { "name": "uuid", "rootUri": "file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/uuid-4.1.0", @@ -530,7 +578,7 @@ "languageVersion": "2.18" } ], - "generated": "2023-11-29T10:19:58.570401Z", + "generated": "2024-03-05T10:02:46.197118Z", "generator": "pub", - "generatorVersion": "2.18.5" + "generatorVersion": "2.18.6" } diff --git a/.dart_tool/package_config_subset b/.dart_tool/package_config_subset index 5cd5e32..1ef535d 100644 --- a/.dart_tool/package_config_subset +++ b/.dart_tool/package_config_subset @@ -1,7 +1,7 @@ healthcare_delivery 2.18 -file:///D:/ArmintaProjects/healthcare-deliveryboy/ -file:///D:/ArmintaProjects/healthcare-deliveryboy/lib/ +file:///D:/HealthCareProjects/healthcare-deliveryboy/ +file:///D:/HealthCareProjects/healthcare-deliveryboy/lib/ archive 2.12 file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.4.2/ @@ -310,6 +310,38 @@ universal_io 2.15 file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.2.0/ file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.2.0/lib/ +url_launcher +2.18 +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.11/ +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.11/lib/ +url_launcher_android +2.18 +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.38/ +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.38/lib/ +url_launcher_ios +2.18 +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.1.4/ +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.1.4/lib/ +url_launcher_linux +2.17 +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.5/ +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.5/lib/ +url_launcher_macos +2.18 +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.6/ +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.6/lib/ +url_launcher_platform_interface +2.18 +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_platform_interface-2.1.3/ +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_platform_interface-2.1.3/lib/ +url_launcher_web +2.18 +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.18/ +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.18/lib/ +url_launcher_windows +2.18 +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.7/ +file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.7/lib/ uuid 2.14 file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/uuid-4.1.0/ diff --git a/.dart_tool/version b/.dart_tool/version index aa00c92..f9f89f5 100644 --- a/.dart_tool/version +++ b/.dart_tool/version @@ -1 +1 @@ -3.3.9 \ No newline at end of file +3.3.10 \ No newline at end of file diff --git a/lib/common/biddingrequests.dart b/lib/common/biddingrequests.dart new file mode 100644 index 0000000..a9ca9ff --- /dev/null +++ b/lib/common/biddingrequests.dart @@ -0,0 +1,271 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:healthcare_delivery/common/settings.dart'; +import 'package:healthcare_delivery/model/biddingrequest_model.dart'; +import 'package:intl/intl.dart'; +import 'package:url_launcher/url_launcher.dart'; + + +class DelivryBookingData extends StatefulWidget { + const DelivryBookingData({Key? key}) : super(key: key); + + @override + State createState() => _DelivryBookingDataState(); +} + +class _DelivryBookingDataState extends State { + bool isSupplierDataLoading=false; + bool isSereverIssue = false; + bool isSereverIssueConnected = false; + bool isSereverIssuePending = false; + String dropdownTypeOfPayment = 'Cash'; + String dueAmount = ''; + bool isDataLoading = false; + + TextEditingController amountPaidController = TextEditingController(); + + List bookingDataList = []; + List completedOrdersList = []; + List activeOrdersList = []; + bool isLoading=false; + + + + Future getBokkingsData() async { + isLoading = true; + try { + var response = await AppSettings.getdeliveryboybookings(); + setState(() { + activeOrdersList = + ((jsonDecode(response)['data']) as List).map((dynamic model) { + return demo.fromJson(model); + }).toList(); + isLoading = false; + }); + + + } catch (e) { + setState(() { + isLoading = false; + isSereverIssueConnected = true; + }); + } + } + + + @override + void initState() { + getBokkingsData(); + super.initState(); + } + + + + Widget activeOrders(){ + if (activeOrdersList.length != 0) { + return ListView.builder( + padding: EdgeInsets.all(8), + itemCount: activeOrdersList.length, + itemBuilder: (BuildContext context, int index) { + return Card( + child: Padding( + padding: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + // width: MediaQuery.of(context).size.width * .75, + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text('PharmacyName :', + style: labelTextStyle()), + SizedBox( + width: 5.0, + ), + Text( + activeOrdersList[index] + .pharmacyName + .toUpperCase(), + style: valuesTextStyle()), + ], + ), + Row( + children: [ + Text('Pharmacy Phone :', + style: labelTextStyle()), + SizedBox( + width: 5.0, + ), + Text( + activeOrdersList [index] + .pharmacyPhone + .toString(), + style: valuesTextStyle()), + ], + ), + Row( + children: [ + Text('User Name :', + style: labelTextStyle()), + SizedBox( + width: 5.0, + ), + Text(activeOrdersList[index].firstName, + style: valuesTextStyle()), + ], + ), + Row( + children: [ + Text('User Phone :', + style: labelTextStyle()), + SizedBox( + width: 5.0, + ), + Text(activeOrdersList[index].contactNumber, + style: valuesTextStyle()), + ], + ), + Row( + children: [ + Text('Address :', + style: labelTextStyle()), + SizedBox( + width: 5.0, + ), + Text(activeOrdersList[index].address, + style: valuesTextStyle()), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + children: [ + IconButton( + iconSize: 30, + icon: const Icon( + Icons.phone, + color: primaryColor, + ), + onPressed: () async { + final Uri _phoneUri = Uri( + scheme: "tel", + path: activeOrdersList[index] + .contactNumber); + try { + await launch( + _phoneUri.toString()); + } catch (error) { + throw ("Cannot dial"); + } + }, + ), + Text( + 'Call now', + style: iconBelowTextStyle(), + ), + ], + ), + SizedBox( + width: 30, + ), + Column( + children: [ + IconButton( + iconSize: 30, + icon: const Icon( + Icons.start, + color: primaryColor, + ), + onPressed: () { + + /* Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new OrderTrackingPage(lat:activeOrdersList[index].lat,lng:activeOrdersList[index].lng)));*/ + + + }, + ), + Text( + 'Start Trip', + style: iconBelowTextStyle(), + ), + ], + ), + SizedBox( + width: 30, + ), + + ], + ), + ], + ), + ), + ], + ), + ), + ); + }); + } + else { + return Center( + child: Padding( + padding: EdgeInsets.fromLTRB(0, 40, 0, 0), + child: isSereverIssueConnected + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage('images/logo.png'), + // height: MediaQuery.of(context).size.height * .10, + ), + SizedBox( + height: 20, + ), + Text( + 'No Data',style:serverIssueTextStyle() ,), + ], + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage('images/no_data.png'), + // height: MediaQuery.of(context).size.height * .10, + ), + SizedBox( + height: 20, + ), + Text( + 'No Connected Tankers',style:serverIssueTextStyle() ,), + ], + ), + )); + } + } + + /**/ + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('BiddingRequests'), + body: isDataLoading?Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ): activeOrders(), + ); + } +} diff --git a/lib/common/dashboard.dart b/lib/common/dashboard.dart index d5e7839..ed63a74 100644 --- a/lib/common/dashboard.dart +++ b/lib/common/dashboard.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:healthcare_delivery/common/biddingrequests.dart'; import 'package:healthcare_delivery/common/login.dart'; import 'package:healthcare_delivery/common/settings.dart'; import 'dart:io'; @@ -96,10 +97,10 @@ class _DashboardState extends State { Expanded( child: GestureDetector( onTap: () { - /*Navigator.push( + Navigator.push( context, MaterialPageRoute(builder: (context) => DelivryBookingData()), - );*/ + ); }, child: Container( padding: EdgeInsets.all(05), diff --git a/lib/model/biddingrequest_model.dart b/lib/model/biddingrequest_model.dart new file mode 100644 index 0000000..ad08803 --- /dev/null +++ b/lib/model/biddingrequest_model.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; + + +class demo { + String pharmacyName = ''; + String pharmacyPhone = ''; + String firstName = ''; + String contactNumber=''; + String address=''; + String ammount=''; + String delivery_agent=''; + + String orderStatus = ''; + double lat=0; + double lng=0; + + + + + + + + + Color cardColor=Colors.white; + + demo(); + + factory demo.fromJson(Map json){ + demo rtvm = new demo(); + + rtvm.pharmacyName = json['pharmacies'][0]["pharmacyname"].toString() ?? ''; + rtvm.pharmacyPhone =json['pharmacies'][0]["phone"].toString() ?? ''; + rtvm.firstName = json['user']['profile']["firstName"].toString() ?? ''; + rtvm.contactNumber = json['user']['profile']["contactNumber"].toString() ?? ''; + rtvm.address = json['user']['profile']["address1"].toString() ?? ''; + rtvm.delivery_agent = json['delivery_agent'] ??''; + rtvm.orderStatus = json['orderStatus'] ??''; + return rtvm; + } + +} \ No newline at end of file diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 64a0ece..7299b5c 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -7,9 +7,13 @@ #include "generated_plugin_registrant.h" #include +#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); file_selector_plugin_register_with_registrar(file_selector_linux_registrar); + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 2db3c22..786ff5c 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 90d7d0f..e6cd7c1 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -8,9 +8,11 @@ import Foundation import file_selector_macos import geolocator_apple import shared_preferences_foundation +import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index cc99da6..2020254 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -560,6 +560,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.11" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.38" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.4" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.5" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.6" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.18" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.7" uuid: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4bbf42f..4d3cd7c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: geolocator: ^9.0.2 image_picker: ^0.8.6+1 flutter_svg: ^1.0.1 - + url_launcher: ^6.1.9 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index f35b3a6..6514907 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -8,10 +8,13 @@ #include #include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); GeolocatorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("GeolocatorWindows")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 389222b..c193e6e 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -5,6 +5,7 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_windows geolocator_windows + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST