merge fix's

mirza_development
Mirza.Shafique@cloudsolutions.com.sa 8 months ago
parent 20125d81ae
commit 689460a78d

@ -10,6 +10,7 @@ class BranchDetailModel {
final String? branchName;
final String? branchDescription;
final int? cityId;
final String? cityName;
final String? address;
final String? latitude;
final String? longitude;
@ -32,6 +33,7 @@ class BranchDetailModel {
this.branchName,
this.branchDescription,
this.cityId,
this.cityName,
this.address,
this.latitude,
this.longitude,
@ -48,13 +50,15 @@ class BranchDetailModel {
required this.isExpanded,
});
factory BranchDetailModel.fromJson(Map<String, dynamic> json) => BranchDetailModel(
factory BranchDetailModel.fromJson(Map<String, dynamic> json) =>
BranchDetailModel(
id: json["id"],
serviceProviderId: json["serviceProviderID"],
serviceProviderName: json["serviceProviderName"],
branchName: json["branchName"],
branchDescription: json["branchDescription"],
cityId: json["cityID"],
cityName: json["cityName"],
address: json["address"],
latitude: json["latitude"],
longitude: json["longitude"],
@ -64,12 +68,15 @@ class BranchDetailModel {
branchStatus: (json['branchStatus'] as int).toBranchStatusEnum(),
statusId: json["branchStatus"],
statusText: json["statusText"],
branchServices: json["serviceProviderServices"] == null ? [] : List<ServiceModel>.from(json["serviceProviderServices"]!.map((x) => ServiceModel.fromJson(x))),
branchServices: json["serviceProviderServices"] == null ? [] : List<
ServiceModel>.from(json["serviceProviderServices"]!.map((x) =>
ServiceModel.fromJson(x))),
categories: [],
isExpanded: false,
);
Map<String, dynamic> toJson() => {
Map<String, dynamic> toJson() =>
{
"id": id,
"serviceProviderID": serviceProviderId,
"serviceProviderName": serviceProviderName,
@ -84,6 +91,7 @@ class BranchDetailModel {
"closeTime": closeTime,
"status": statusId,
"statusText": statusText,
"serviceProviderServices": branchServices == null ? [] : List<dynamic>.from(branchServices!.map((x) => x.toJson())),
"serviceProviderServices": branchServices == null ? [] : List<
dynamic>.from(branchServices!.map((x) => x.toJson())),
};
}

@ -1,12 +1,9 @@
import 'dart:developer';
import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:mc_common_app/utils/app_permission_handler.dart';
import 'package:mc_common_app/utils/utils.dart';
import 'package:permission_handler/permission_handler.dart';
abstract class CommonAppServices {
Future<List<File>> pickMultipleImages();
@ -14,6 +11,9 @@ abstract class CommonAppServices {
Future<File?> pickImageFromPhone(int sourceFlag);
Future<List<File>?> pickMultipleFiles(BuildContext context);
Future<File?> pickFile(BuildContext context,
{required FileType fileType, List<String>? allowedExtensions});
}
class CommonServicesImp implements CommonAppServices {
@ -64,4 +64,28 @@ class CommonServicesImp implements CommonAppServices {
}
return pickedImages;
}
@override
Future<File?> pickFile(BuildContext context,
{required FileType fileType, List<String>? allowedExtensions}) async {
FilePickerResult? result;
final status = await AppPermissions.checkStoragePermissions(context);
if (status) {
result = await FilePicker.platform.pickFiles(
allowMultiple: true,
type: fileType,
allowedExtensions: allowedExtensions);
}
List<File> pickedFiles = [];
if (result != null) {
for (var element in result.files) {
if (element.path != null) {
pickedFiles.add(File(element.path!));
}
}
}
return pickedFiles.length > 0 ? pickedFiles.first : null;
}
}

@ -28,8 +28,11 @@ class DropdownField extends StatefulWidget {
final Function(DropValue) onSelect;
final bool showAppointmentPickerVariant;
final TextStyle? textStyle;
final bool isSelectAble;
const DropdownField(this.onSelect, {Key? key, this.hint, this.list, this.dropdownValue, this.errorValue = "", this.showAppointmentPickerVariant = false, this.textStyle}) : super(key: key);
const DropdownField(this.onSelect,
{Key? key, this.hint, this.list, this.dropdownValue, this.errorValue = "", this.showAppointmentPickerVariant = false, this.textStyle, this.isSelectAble = true})
: super(key: key);
@override
State<DropdownField> createState() => _DropdownFieldState();
@ -53,7 +56,9 @@ class _DropdownFieldState extends State<DropdownField> {
return Column(
children: [
Container(
decoration: widget.showAppointmentPickerVariant ? null : Utils.containerColorRadiusBorderWidth(MyColors.white, 0, MyColors.darkPrimaryColor, 2),
decoration: widget.showAppointmentPickerVariant ? null : Utils
.containerColorRadiusBorderWidth(
MyColors.white, 0, MyColors.darkPrimaryColor, 2),
margin: const EdgeInsets.all(0),
padding: const EdgeInsets.only(left: 8, right: 8),
width: widget.showAppointmentPickerVariant ? 170 : null,
@ -65,8 +70,15 @@ class _DropdownFieldState extends State<DropdownField> {
iconEnabledColor: borderColor,
iconDisabledColor: borderColor,
isExpanded: true,
style: widget.showAppointmentPickerVariant ? widget.textStyle : const TextStyle(color: Colors.black, fontWeight: FontWeight.w600, fontSize: 15),
hint: (widget.hint ?? "").toText(color: widget.showAppointmentPickerVariant ? Colors.black : borderColor, fontSize: widget.showAppointmentPickerVariant ? 18 : 15),
style: widget.showAppointmentPickerVariant
? widget.textStyle
: const TextStyle(
color: Colors.black, fontWeight: FontWeight.w600, fontSize: 15),
hint: (widget.hint ?? "").toText(
color: widget.showAppointmentPickerVariant
? Colors.black
: borderColor,
fontSize: widget.showAppointmentPickerVariant ? 18 : 15),
underline: Container(height: 0),
onChanged: (DropValue? newValue) {
setState(() {
@ -75,11 +87,12 @@ class _DropdownFieldState extends State<DropdownField> {
});
},
items: (widget.list ?? defaultV).map<DropdownMenuItem<DropValue>>(
(DropValue value) {
(DropValue value) {
return DropdownMenuItem<DropValue>(
value: value,
enabled: value.isEnabled ?? true,
child: value.value.toText(fontSize: 15, color: value.isEnabled == false ? Colors.black38 : null),
child: value.value.toText(fontSize: 15,
color: value.isEnabled == false ? Colors.black38 : null),
);
},
).toList(),

@ -137,6 +137,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.6"
device_info_plus:
dependency: "direct main"
description:
name: device_info_plus
sha256: "77f757b789ff68e4eaf9c56d1752309bd9f7ad557cb105b938a7f8eb89e59110"
url: "https://pub.dev"
source: hosted
version: "9.1.2"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64
url: "https://pub.dev"
source: hosted
version: "7.0.0"
dropdown_button2:
dependency: "direct main"
description:
@ -181,10 +197,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "13a6ccf6a459a125b3fcdb6ec73bd5ff90822e071207c663bfd1f70062d51d18"
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "2.1.0"
file:
dependency: transitive
description:
@ -197,10 +213,10 @@ packages:
dependency: "direct main"
description:
name: file_picker
sha256: "704259669b5e9cb24e15c11cfcf02caf5f20d30901b3916d60b6d1c2d647035f"
sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6"
url: "https://pub.dev"
source: hosted
version: "4.6.1"
version: "6.1.1"
file_selector_linux:
dependency: transitive
description:
@ -745,10 +761,10 @@ packages:
dependency: transitive
description:
name: path_provider_windows
sha256: a34ecd7fb548f8e57321fd8e50d865d266941b54e6c3b7758cf8f37c24116905
sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
url: "https://pub.dev"
source: hosted
version: "2.0.7"
version: "2.2.1"
percent_indicator:
dependency: "direct main"
description:
@ -1158,10 +1174,18 @@ packages:
dependency: transitive
description:
name: win32
sha256: c0e3a4f7be7dae51d8f152230b86627e3397c1ba8c3fa58e63d44a9f3edc9cef
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
url: "https://pub.dev"
source: hosted
version: "2.6.1"
version: "5.2.0"
win32_registry:
dependency: transitive
description:
name: win32_registry
sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
xdg_directories:
dependency: transitive
description:
@ -1179,5 +1203,5 @@ packages:
source: hosted
version: "6.3.0"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.10.0"

Loading…
Cancel
Save