feat : sale out of Province
This commit is contained in:
@@ -39,9 +39,13 @@ export 'infrastructure/remote/dio_form_data.dart';
|
||||
export 'infrastructure/remote/dio_remote.dart';
|
||||
export 'infrastructure/remote/dio_response.dart';
|
||||
export 'injection/di.dart';
|
||||
|
||||
///image picker
|
||||
export 'package:image_picker/image_picker.dart';
|
||||
|
||||
//utils
|
||||
export 'utils/logger_utils.dart';
|
||||
export 'utils/safe_call_utils.dart';
|
||||
export 'utils/network/network.dart';
|
||||
export 'utils/date_time_utils.dart';
|
||||
export 'utils/num_utils.dart';
|
||||
export 'utils/map_utils.dart';
|
||||
|
||||
8
packages/core/lib/presentation/utils/image_utils.dart
Normal file
8
packages/core/lib/presentation/utils/image_utils.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
Future<String> convertImageToBase64(String imagePath) async {
|
||||
final bytes = await File(imagePath).readAsBytes();
|
||||
String base64String = base64Encode(bytes);
|
||||
return base64String;
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export 'color_utils.dart';
|
||||
export 'color_utils.dart';
|
||||
export 'data_time_utils.dart';
|
||||
export 'image_utils.dart';
|
||||
export 'list_extensions.dart';
|
||||
export 'data_time_utils.dart';
|
||||
@@ -20,7 +20,6 @@ class DraggableBottomSheet2 extends GetView<DraggableBottomSheetController> {
|
||||
return ObxValue((data) {
|
||||
return Stack(
|
||||
children: [
|
||||
// پسزمینه تیره
|
||||
Positioned.fill(
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
|
||||
@@ -26,6 +26,7 @@ class RTextField extends StatefulWidget {
|
||||
final RTextFieldVariant variant;
|
||||
final bool filled;
|
||||
final Color? filledColor;
|
||||
final Color? borderColor;
|
||||
final bool showCounter;
|
||||
final bool isDense;
|
||||
final TextInputType? keyboardType;
|
||||
@@ -67,6 +68,7 @@ class RTextField extends StatefulWidget {
|
||||
this.validator,
|
||||
this.onChanged,
|
||||
this.onSubmitted,
|
||||
this.borderColor,
|
||||
});
|
||||
|
||||
|
||||
@@ -82,7 +84,7 @@ class RTextField extends StatefulWidget {
|
||||
_noBorder || _passwordNoBorder ? InputBorder.none : OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.lightGreyDarkActive,
|
||||
color: borderColor ?? AppColor.lightGreyDarkActive,
|
||||
width: 1,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -134,6 +134,7 @@ class _OverlayDropdownState<T> extends State<OverlayDropdownWidget<T>> {
|
||||
_isOpen.value
|
||||
? CupertinoIcons.chevron_up
|
||||
: CupertinoIcons.chevron_down,
|
||||
size: 14,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,10 +1,38 @@
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:persian_datetime_picker/persian_datetime_picker.dart';
|
||||
|
||||
extension xDateTime on String{
|
||||
extension XDateTime on String{
|
||||
get toDateTime => DateTime.parse(this);
|
||||
|
||||
get formattedJalaliDate{
|
||||
final dateTime = DateTime.parse(this);
|
||||
final jalaliDate = Jalali.fromDateTime(dateTime);
|
||||
return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
||||
}
|
||||
}
|
||||
|
||||
get formattedJalaliDateYHMS {
|
||||
final dateTime = DateTime.parse(this);
|
||||
final jalaliDate = Jalali.fromDateTime(dateTime);
|
||||
return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')} - ${jalaliDate.hour.toString().padLeft(2, '0')}:${jalaliDate.minute.toString().padLeft(2, '0')}";
|
||||
}
|
||||
|
||||
|
||||
get formattedYHMS{
|
||||
return DateFormat('yyyy-MM-dd HH:mm:ss').format(toDateTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
extension XDateTime2 on DateTime{
|
||||
|
||||
|
||||
get formattedJalaliDate{
|
||||
final jalaliDate = Jalali.fromDateTime(this);
|
||||
return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
||||
}
|
||||
|
||||
get formattedYHMS{
|
||||
return DateFormat('yyyy-MM-dd HH:mm:ss').format(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ Map<String, dynamic> buildQueryParams({
|
||||
int? pageSize,
|
||||
DateTime? fromDate,
|
||||
DateTime? toDate,
|
||||
String? role,
|
||||
|
||||
}) {
|
||||
final params = <String, dynamic>{};
|
||||
@@ -40,5 +41,9 @@ Map<String, dynamic> buildQueryParams({
|
||||
params['page_size'] = pageSize;
|
||||
}
|
||||
|
||||
if(role != null && role.isNotEmpty) {
|
||||
params['role'] = role;
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
2
packages/core/lib/utils/network/network.dart
Normal file
2
packages/core/lib/utils/network/network.dart
Normal file
@@ -0,0 +1,2 @@
|
||||
export 'resource.dart';
|
||||
export 'safe_call_utils.dart';
|
||||
46
packages/core/lib/utils/network/resource.dart
Normal file
46
packages/core/lib/utils/network/resource.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
enum Status {
|
||||
initial,
|
||||
loading,
|
||||
success,
|
||||
error,
|
||||
empty,
|
||||
}
|
||||
|
||||
|
||||
class Resource<T> {
|
||||
final Status status;
|
||||
final T? data;
|
||||
final String? message;
|
||||
|
||||
const Resource._({
|
||||
required this.status,
|
||||
this.data,
|
||||
this.message,
|
||||
});
|
||||
|
||||
const Resource.initial() : this._(status: Status.initial);
|
||||
|
||||
const Resource.loading() : this._(status: Status.loading);
|
||||
|
||||
const Resource.success(T data) : this._(status: Status.success, data: data);
|
||||
|
||||
const Resource.error(String message) : this._(status: Status.error, message: message);
|
||||
|
||||
const Resource.empty() : this._(status: Status.empty);
|
||||
|
||||
|
||||
bool get isInitial => status == Status.initial;
|
||||
|
||||
bool get isLoading => status == Status.loading;
|
||||
|
||||
bool get isSuccess => status == Status.success;
|
||||
|
||||
bool get isError => status == Status.error;
|
||||
|
||||
bool get isEmpty => status == Status.empty;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Resource{status: $status, data: $data, message: $message}';
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import '../core.dart';
|
||||
import '../../core.dart';
|
||||
|
||||
typedef AppAsyncCallback<T> = Future<T> Function();
|
||||
typedef ErrorCallback = void Function(dynamic error, StackTrace? stackTrace);
|
||||
@@ -177,6 +177,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
cross_file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cross_file
|
||||
sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.4+2"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -281,6 +289,38 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.1"
|
||||
file_selector_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file_selector_linux
|
||||
sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.3+2"
|
||||
file_selector_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file_selector_macos
|
||||
sha256: "8c9250b2bd2d8d4268e39c82543bacbaca0fda7d29e0728c3c4bbb7c820fd711"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.4+3"
|
||||
file_selector_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file_selector_platform_interface
|
||||
sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.6.2"
|
||||
file_selector_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file_selector_windows
|
||||
sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.3+4"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -339,6 +379,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.0"
|
||||
flutter_plugin_android_lifecycle:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_plugin_android_lifecycle
|
||||
sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.28"
|
||||
flutter_rating_bar:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -597,6 +645,70 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.2"
|
||||
image_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: image_picker
|
||||
sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
image_picker_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_android
|
||||
sha256: "317a5d961cec5b34e777b9252393f2afbd23084aa6e60fcf601dcf6341b9ebeb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.12+23"
|
||||
image_picker_for_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_for_web
|
||||
sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.6"
|
||||
image_picker_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_ios
|
||||
sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.12+2"
|
||||
image_picker_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_linux
|
||||
sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.1+2"
|
||||
image_picker_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_macos
|
||||
sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.1+2"
|
||||
image_picker_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_platform_interface
|
||||
sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.10.1"
|
||||
image_picker_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_windows
|
||||
sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.1+1"
|
||||
image_size_getter:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -15,6 +15,9 @@ dependencies:
|
||||
#utils
|
||||
device_info_plus: ^11.4.0
|
||||
|
||||
##image_picker
|
||||
image_picker: ^1.1.2
|
||||
|
||||
|
||||
#UI
|
||||
cupertino_icons: ^1.0.8
|
||||
|
||||
Reference in New Issue
Block a user