fix : ui fix after release 1.3.3

This commit is contained in:
2025-07-16 18:31:47 +03:30
parent 3566e5820d
commit c28a0e6630
22 changed files with 229 additions and 203 deletions

View File

@@ -18,12 +18,14 @@ class CustomNavigationObserver extends NavigatorObserver {
_isWorkDone = true;
await setupInjection();
}
iLog('message');
}
@override
void didReplace({Route? newRoute, Route? oldRoute}) {
super.didReplace(newRoute: newRoute, oldRoute: oldRoute);
iLog('didReplace');
}
@@ -31,10 +33,12 @@ class CustomNavigationObserver extends NavigatorObserver {
void didPop(Route route, Route? previousRoute) {
super.didPop(route, previousRoute);
iLog('didPop');
}
@override
void didRemove(Route route, Route? previousRoute) {
super.didRemove(route, previousRoute);
iLog('didRemove');
}
}

View File

@@ -13,8 +13,8 @@ Future<void> main() async {
await setupPreInjection();
Get.put(TokenStorageService());
var tokenService = Get.find<TokenStorageService>();
await tokenService.init();
await Get.find<TokenStorageService>().init();
Get.put(AuthMiddleware());
Get.put(AuthService());
runApp(MyApp());

View File

@@ -4,13 +4,12 @@ import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'
import 'package:rasadyar_core/core.dart';
class ChickenLocalDataSourceImp implements ChickenLocalDataSource {
HiveLocalStorage local =diCore.get<HiveLocalStorage>();
HiveLocalStorage local = diCore.get<HiveLocalStorage>();
final String boxName = 'Chicken_Widley_Box';
@override
Future<void> openBox() async {
await local.openBox(boxName);
await local.openBox<WidelyUsedLocalModel>(boxName);
}
@override
@@ -53,7 +52,6 @@ class ChickenLocalDataSourceImp implements ChickenLocalDataSource {
@override
WidelyUsedLocalModel? getAllWidely() {
var res = local.readBox<WidelyUsedLocalModel>(boxName: boxName);
fLog(res.toString());
return res;
return res?.first;
}
}

View File

@@ -44,7 +44,7 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
);
}, controller.waitingProduct),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
/* floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
floatingActionButton: ObxValue((data) {
if ((data.value.data?.results?.length ?? 0) > 1) {
return AnimatedFab(
@@ -58,7 +58,7 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
} else {
return SizedBox.shrink();
}
}, controller.waitingProduct),
}, controller.waitingProduct),*/
);
}

View File

@@ -17,6 +17,7 @@ class BuyOutOfProvinceLogic extends GetxController {
RxList<int> isExpandedList = <int>[].obs;
final RxInt currentPage = 1.obs;
final RxBool isLoadingMoreAllocationsMade = false.obs;
final RxBool isOnLoadingSubmitOrEdit = false.obs;
//TODO add this to Di
ImagePicker imagePicker = ImagePicker();
@@ -170,6 +171,7 @@ class BuyOutOfProvinceLogic extends GetxController {
Future<bool> createStewardPurchaseOutOfProvince() async {
bool res = false;
isOnLoadingSubmitOrEdit.value = true;
if (!(formKey.currentState?.validate() ?? false)) {
return res;
}
@@ -196,6 +198,7 @@ class BuyOutOfProvinceLogic extends GetxController {
res = true;
},
);
isOnLoadingSubmitOrEdit.value = false;
return res;
}
@@ -205,7 +208,6 @@ class BuyOutOfProvinceLogic extends GetxController {
carcassWeightController.clear();
selectedProvince.value = null;
selectedCity.value = null;
selectedProduct.value = null;
selectedImage.value = null;
_base64Image.value = null;
editImageUrl.value = null;

View File

@@ -379,12 +379,13 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
}
Widget submitButtonWidget(bool isOnEdit) {
return ObxValue((data) {
return Obx(() {
return RElevated(
text: isOnEdit ? 'ویرایش' : 'ثبت',
width: Get.width,
backgroundColor: AppColor.greenNormal,
onPressed: data.value
isLoading: controller.isOnLoadingSubmitOrEdit.value,
onPressed: controller.isSubmitButtonEnabled.value
? () async {
var res = await controller.createStewardPurchaseOutOfProvince();
if (res) {
@@ -394,7 +395,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
: null,
height: 40,
);
}, controller.isSubmitButtonEnabled);
});
}
Widget _productDropDown() {

View File

@@ -57,59 +57,32 @@ class ProfilePage extends GetView<ProfileLogic> {
),
),
ObxValue((data) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Wrap(
spacing: 20,
runSpacing: 10,
children: [
cardActionWidget(
title: 'اطلاعات کاربری',
onPressed: () {
data.value = 0;
},
icon: Assets.vec.profileUserSvg.path,
selected: data.value == 0,
),
Center(
child: Wrap(
alignment: WrapAlignment.center,
spacing: 20,
runSpacing: 10,
children: [
cardActionWidget(
title: 'تغییر رمز عبور',
selected: true,
onPressed: () {
Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true);
},
icon: Assets.vec.lockSvg.path,
),
cardActionWidget(
title: 'خروج',
selected: true,
onPressed: () {
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
},
icon: Assets.vec.logoutSvg.path,
),
],
),
),
cardActionWidget(
title: 'تغییر رمز عبور',
selected: true,
onPressed: () {
Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true);
},
icon: Assets.vec.lockSvg.path,
),
cardActionWidget(
title: 'خروج',
selected: true,
onPressed: () {
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
},
icon: Assets.vec.logoutSvg.path,
),
/*cardActionWidget(
title: 'اطلاعات بانکی',
onPressed: () {
data.value = 1;
},
icon: Assets.vec.informationSvg.path,
selected: data.value == 1,
),
cardActionWidget(
title: 'اطلاعات \nصدور فاکتور',
onPressed: () {
data.value = 2;
},
icon: Assets.vec.receiptDiscountSvg.path,
selected: data.value == 2,
),*/
],
),
);
}, controller.selectedInformationType),
SizedBox(height: 100),
],

View File

@@ -49,10 +49,11 @@ class RootLogic extends GetxController {
super.onInit();
localDatasource = diChicken.get<ChickenLocalDataSourceImp>();
chickenRepository = diChicken.get<ChickenRepositoryImp>();
localDatasource.openBox().then((value) async {
widelyUsedList.value = localDatasource.getAllWidely();
});
widelyUsedList.value = localDatasource.getAllWidely();
//getKillHouseDistributionInfo();
}
@override
@@ -70,9 +71,7 @@ class RootLogic extends GetxController {
}
if (widelyUsedList.value?.hasInit != true) {
localDatasource.initWidleyUsed().then(
(value) => localDatasource.getAllWidely(),
);
localDatasource.initWidleyUsed().then((value) => localDatasource.getAllWidely());
}
}

View File

@@ -86,13 +86,20 @@ class RootPage extends GetView<RootLogic> {
label: 'خرید',
icon: Assets.vec.buySvg.path,
isSelected: controller.currentPage.value == 0,
onTap: () => controller.changePage(0),
onTap: () {
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
controller.changePage(0);
},
),
RBottomNavigationItem(
label: 'فروش',
icon: Assets.vec.saleSvg.path,
isSelected: controller.currentPage.value == 1,
onTap: () => controller.changePage(1),
onTap: () {
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
controller.changePage(1);
},
),
RBottomNavigationItem(
label: 'خانه',

View File

@@ -3,7 +3,6 @@ import 'package:flutter/services.dart';
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_chicken/presentation/widget/inventory_widget.dart';
@@ -743,7 +742,7 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
Widget show2StepAddBottomSheet() {
return BaseBottomSheet(
height: Get.height * .35,
height: Get.height * .39,
child: Column(
spacing: 8,
children: [
@@ -808,7 +807,9 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
text: ' بازگشت',
textStyle: AppFonts.yekan18.copyWith(color: AppColor.error),
onPressed: () {
Get.until((route) => route.settings.name == ChickenRoutes.salesInProvince);
Get
..back()
..back();
},
),
),

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_buyers/view.dart';
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_sales_list/view.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
@@ -21,14 +20,8 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
filteringWidget: filterBottomSheet(),
widgets: [
inventoryWidget(controller.rootLogic),
segmentWidget(),
Expanded(
child: ObxValue((index) {
return index.value == 0
? SalesOutOfProvinceSalesListPage()
: SalesOutOfProvinceBuyersPage();
}, controller.selectedSegmentIndex),
),
Expanded(child: SalesOutOfProvinceSalesListPage()),
],
);
}
@@ -61,5 +54,4 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
onChangedToDate: (jalali) => controller.toDateFilter.value = jalali,
onSubmit: () => controller.submitFilter(),
);
}

View File

@@ -1,8 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart';
import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart';
import 'package:rasadyar_core/core.dart';
@@ -44,10 +46,23 @@ class SalesOutOfProvinceSalesListPage extends GetView<SalesOutOfProvinceSalesLis
separatorBuilder: (context, index) => SizedBox(height: 8.h),
);
}, controller.salesList),
floatingActionButton: RFab.add(
onPressed: () {
Get.bottomSheet(addOrEditSaleBottomSheet(), isScrollControlled: true);
},
floatingActionButton: Row(
children: [
RFab.add(
onPressed: () {
Get.bottomSheet(addOrEditSaleBottomSheet(), isScrollControlled: true);
},
),
Spacer(),
RFab(
icon: Icon(CupertinoIcons.person_add_solid, color: Colors.white, size: 35.w),
backgroundColor: AppColor.blueNormal,
onPressed: () {
Get.toNamed(ChickenRoutes.salesOutOfProvinceBuyer, id: 1);
},
),
SizedBox(width: 25),
],
),
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
);

View File

@@ -77,17 +77,15 @@ class SegmentationLogic extends GetxController {
void clearForm() {
weightController.text = '0';
selectedSegment.value = null;
}
void validateForm() {
isSubmitButtonEnabled = RxBool(
var weight = int.tryParse(weightController.text.clearComma.trim());
isSubmitButtonEnabled.value =
selectedProduct.value != null &&
selectedSegment.value != null &&
weightController.text.isNotEmpty &&
int.tryParse(weightController.text) != null &&
int.tryParse(weightController.text)! > 0,
);
weight! > 0
;
}
Future<void> getAllSegmentation([bool isLoadingMore = false]) async {

View File

@@ -19,6 +19,7 @@ import 'package:rasadyar_chicken/presentation/pages/sales_in_province/view.dart'
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province/view.dart';
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_buyers/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_buyers/view.dart';
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_sales_list/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/segmentation/logic.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
@@ -79,6 +80,17 @@ sealed class ChickenPages {
Get.lazyPut(() => SalesOutOfProvinceSalesListLogic());
}),
),
GetPage(
name: ChickenRoutes.salesOutOfProvinceBuyer,
page: () => SalesOutOfProvinceBuyersPage(),
middlewares: [AuthMiddleware()],
binding: BindingsBuilder(() {
Get.lazyPut(() => SearchLogic());
Get.lazyPut(() => SalesOutOfProvinceLogic());
Get.lazyPut(() => SalesOutOfProvinceBuyersLogic());
Get.lazyPut(() => SalesOutOfProvinceSalesListLogic());
}),
),
GetPage(
name: ChickenRoutes.salesInProvince,
page: () => SalesInProvincePage(),

View File

@@ -15,6 +15,7 @@ sealed class ChickenRoutes {
//sales
static const salesInProvince = '$sale/SalesInProvince';
static const salesOutOfProvince = '$sale/saleOutOfProvince';
static const salesOutOfProvinceBuyer = '$sale/saleOutOfProvinceBuyer ';
}

View File

@@ -20,7 +20,7 @@ class WidelyUsedWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('پر کاربرد ها', textAlign: TextAlign.right, style: AppFonts.yekan16),
ObxValue((data) {
/* ObxValue((data) {
return GestureDetector(
onTap: () {
controller.toggleType();
@@ -37,32 +37,73 @@ class WidelyUsedWidget extends StatelessWidget {
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
),
);
}, controller.type),
}, controller.type)*/
],
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.0, vertical: 2),
child: ObxValue((data) {
return Wrap(
spacing: 4,
runSpacing: 18,
children: [
widelyUsed(
title: 'خرید خارج استان',
isOnEdit: controller.type.value == WidelyUsedType.edit,
iconPath: Assets.vec.truckFastSvg.path,
onTap: () async {
controller.rootLogic.currentPage.value = 0;
controller.rootLogic.currentPage.refresh();
await Future.delayed(Duration(milliseconds: 100));
Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 0);
},
),
],
);
}, controller.type),
child: Wrap(
spacing: 15,
runSpacing: 8,
children: [
widelyUsed(
title: 'خرید خارج استان',
iconPath: Assets.vec.truckFastSvg.path,
isOnEdit: false,
cardColor: AppColor.greenLightActive,
labelColor: AppColor.greenNormal,
textColor: AppColor.greenDarkHover,
onTap: () async {
controller.rootLogic.currentPage.value = 0;
controller.rootLogic.currentPage.refresh();
await Future.delayed(Duration(milliseconds: 100));
Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 0);
},
),
widelyUsed(
title: 'خرید داخل استان',
iconPath: Assets.vec.cubeSvg.path,
cardColor: AppColor.greenLightActive,
labelColor: AppColor.greenNormal,
textColor: AppColor.greenDarkHover,
onTap: () async {
controller.rootLogic.currentPage.value = 0;
controller.rootLogic.currentPage.refresh();
await Future.delayed(Duration(milliseconds: 100));
Get.toNamed(ChickenRoutes.buysInProvince, id: 0);
},
isOnEdit: false,
),
widelyUsed(
title: 'فروش خارج استان',
iconPath: Assets.vec.truckFastSvg.path,
isOnEdit: false,
onTap: () async {
controller.rootLogic.currentPage.value = 1;
controller.rootLogic.currentPage.refresh();
await Future.delayed(Duration(milliseconds: 100));
Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1);
},
),
widelyUsed(
title: 'فروش داخل استان',
iconPath: Assets.vec.cubeSvg.path,
isOnEdit: false,
onTap: () async {
controller.rootLogic.currentPage.value = 1;
controller.rootLogic.currentPage.refresh();
await Future.delayed(Duration(milliseconds: 100));
Get.toNamed(ChickenRoutes.salesInProvince, id: 1);
},
),
],
),
),
],
);
@@ -73,6 +114,9 @@ class WidelyUsedWidget extends StatelessWidget {
required String iconPath,
required VoidCallback onTap,
required bool isOnEdit,
Color? cardColor,
Color? labelColor,
Color? textColor,
}) {
return GestureDetector(
onTap: !isOnEdit ? onTap : null,
@@ -89,14 +133,14 @@ class WidelyUsedWidget extends StatelessWidget {
height: 48,
padding: EdgeInsets.all(4),
decoration: ShapeDecoration(
color: Color(0xFFBECDFF),
color: cardColor ?? Color(0xFFBECDFF),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
child: Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
color: AppColor.blueNormal,
color: labelColor ?? AppColor.blueNormal,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
child: SvgGenImage.vec(iconPath).svg(
@@ -146,7 +190,7 @@ class WidelyUsedWidget extends StatelessWidget {
),
],
),
Text(title, style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
Text(title, style: AppFonts.yekan10.copyWith(color: textColor ?? AppColor.blueNormal)),
],
),
);

View File

@@ -2,14 +2,14 @@ import 'package:flutter/foundation.dart';
import 'package:rasadyar_core/core.dart';
class HiveLocalStorage implements ILocalStorage {
HiveLocalStorage() {
Hive.initFlutter();
}
final Map<String, Box> _boxes = {};
@override
Future init() async => await Hive.initFlutter();
Future init() async {
if (kIsWeb) {
Hive.init('hive_storage_rasadyar');
} else {
await Hive.initFlutter();
}
}
@override
Future<void> openBox<T>(
@@ -20,13 +20,13 @@ class HiveLocalStorage implements ILocalStorage {
Uint8List? bytes,
String? collection,
}) async {
if (!_boxes.containsKey(boxName)) {
final box = await Hive.openBox<T>(
var exist = await Hive.boxExists(boxName);
if (!exist || !Hive.isBoxOpen(boxName)) {
await Hive.openBox<T>(
boxName,
encryptionCipher: encryptionCipher,
crashRecovery: crashRecovery,
);
_boxes[boxName] = box;
}
}
@@ -42,10 +42,10 @@ class HiveLocalStorage implements ILocalStorage {
}
@override
T? readBox<T>({required String boxName}) {
List<T>? readBox<T>({required String boxName}) {
try {
Box? box = getBox(boxName);
return box?.values as T?;
Box? box = getBox<T>(boxName);
return box?.values.cast<T>().toList();
} on Exception catch (e) {
eLog(e);
return null;
@@ -53,55 +53,51 @@ class HiveLocalStorage implements ILocalStorage {
}
@override
Future<void> add({required String boxName, required dynamic value}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> add<T>({required String boxName, required dynamic value}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.add(value);
}
@override
Future<void> addAll({required String boxName, required Iterable values}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> addAll<T>({required String boxName, required Iterable values}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.addAll(values);
}
Box<T>? getBox<T>(String boxName) {
final box = _boxes[boxName];
if (box is Box<T>) {
return box;
} else {
throw Exception('Box $boxName is not of exist');
}
final box = Hive.box<T>(boxName);
return box;
}
@override
Future<void> clear(String boxName) async {
await _boxes[boxName]?.clear();
await Hive.box(boxName).clear();
}
@override
Future<void> close(String boxName) async => await _boxes[boxName]?.close();
Future<void> close(String boxName) async => await Hive.box(boxName).close();
@override
Future<void> deleteValue({required String boxName, required String key}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> deleteValue<T>({required String boxName, required String key}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.delete(key);
}
@override
Future<void> save({required String boxName, required String key, required value}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> save<T>({required String boxName, required String key, required value}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.put(key, value);
}
@override
Future<void> saveAll({required String boxName, required Map entries}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> saveAll<T>({required String boxName, required Map entries}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.putAll(entries);
}
@override
Future<void> saveAt({required String boxName, required int index, required value}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> saveAt<T>({required String boxName, required int index, required value}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.putAt(index, value);
}
}

View File

@@ -15,32 +15,21 @@ abstract class ILocalStorage<E> {
T? read<T>({required String boxName, required String key});
T? readBox<T>({required String boxName});
List<T>? readBox<T>({required String boxName});
Future<void> deleteValue({required String boxName, required String key});
Future<void> deleteValue<T>({required String boxName, required String key});
Future<void> add({required String boxName, required E value});
Future<void> add<T>({required String boxName, required E value});
Future<void> addAll({required String boxName, required Iterable<E> values});
Future<void> addAll<T>({required String boxName, required Iterable<E> values});
Future<void> clear(String boxName);
Future<void> close(String boxName);
Future<void> save({
required String boxName,
required String key,
required dynamic value,
});
Future<void> save<T>({required String boxName, required String key, required dynamic value});
Future<void> saveAt({
required String boxName,
required int index,
required dynamic value,
});
Future<void> saveAt<T>({required String boxName, required int index, required dynamic value});
Future<void> saveAll({
required String boxName,
required Map<dynamic, E> entries,
});
Future<void> saveAll<T>({required String boxName, required Map<dynamic, E> entries});
}

View File

@@ -15,10 +15,12 @@ class DioRemote implements IHttpClient {
if (kDebugMode) {
dio.interceptors.add(
PrettyDioLogger(
requestHeader: true,
responseHeader: true,
requestBody: true,
responseBody: true,
request: false,
enabled: false,
requestHeader: false,
responseHeader: false,
requestBody: false,
responseBody: false,
),
);
}

View File

@@ -100,11 +100,11 @@ class AppFonts {
);
static const TextStyle yekan10 = TextStyle(
static TextStyle yekan10 = TextStyle(
// Rounded from 10.24
fontFamily: yekan,
fontWeight: regular,
fontSize: 10,
fontSize: 10.sp,
height: _height,
);

View File

@@ -1,7 +1,7 @@
import 'package:flutter/foundation.dart';
import 'package:rasadyar_core/core.dart';
class HiveLocalStorage implements ILocalStorage {
class HiveLocalStorage implements ILocalStorage {
HiveLocalStorage() {
Hive.initFlutter();
}
@@ -42,16 +42,13 @@ import 'package:rasadyar_core/core.dart';
}
@override
Future<void> add({required String boxName, required dynamic value}) async {
Future<void> add<T>({required String boxName, required dynamic value}) async {
Box<dynamic>? box = getBox(boxName);
await box?.add(value);
}
@override
Future<void> addAll({
required String boxName,
required Iterable values,
}) async {
Future<void> addAll<T>({required String boxName, required Iterable values}) async {
Box<dynamic>? box = getBox(boxName);
await box?.addAll(values);
}
@@ -67,44 +64,39 @@ import 'package:rasadyar_core/core.dart';
@override
Future<void> clear(String boxName) async {
await _boxes[boxName]?.clear();
await Hive.box(boxName).clear();
}
@override
Future<void> close(String boxName) async => await _boxes[boxName]?.close();
@override
Future<void> deleteValue({
required String boxName,
required String key,
}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> deleteValue<T>({required String boxName, required String key}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.delete(key);
}
@override
Future<void> save({
required String boxName,
required String key,
required value,
}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> save<T>({required String boxName, required String key, required value}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.put(key, value);
}
@override
Future<void> saveAll({required String boxName, required Map entries}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> saveAll<T>({required String boxName, required Map entries}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.putAll(entries);
}
@override
Future<void> saveAt({
required String boxName,
required int index,
required value,
}) async {
Box<dynamic>? box = getBox(boxName);
Future<void> saveAt<T>({required String boxName, required int index, required value}) async {
Box<dynamic>? box = getBox<T>(boxName);
await box?.putAt(index, value);
}
@override
T? readBox<T>({required String boxName}) {
// TODO: implement readBox
throw UnimplementedError();
}
}

View File

@@ -1,7 +1,7 @@
name: rasadyar_app
description: "A new Flutter project."
publish_to: 'none'
version: 1.3.0+2
version: 1.3.2+3
environment:
sdk: ^3.8.1