Compare commits

...

3 Commits

Author SHA1 Message Date
Mirza.Shafique@cloudsolutions.com.sa 689460a78d merge fix's 2 years ago
Mirza.Shafique@cloudsolutions.com.sa 20125d81ae Merge branch 'master' into mirza_development
# Conflicts:
#	pubspec.lock
2 years ago
Mirza.Shafique@cloudsolutions.com.sa 9e38eee149 Fix 1.0 2 years ago

@ -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;
}
}

@ -45,8 +45,8 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
void initState() {
super.initState();
if (AppState().currentAppType == AppType.provider) {
phoneNum = "966598646795";
password = "Zahoor@123";
phoneNum = "966580816976";
password = "123@Shf";
}
scheduleMicrotask(() {
userVM = Provider.of(context, listen: false);

@ -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(),

File diff suppressed because it is too large Load Diff

@ -49,6 +49,7 @@ dependencies:
google_maps_flutter: ^2.1.1
geolocator: any
# geocoding: ^2.1.0
geocoding: ^2.1.1
dev_dependencies:

Loading…
Cancel
Save