refactor: update data source and repository structure by removing unused files, enhancing model integration, and adjusting import paths for better organization

This commit is contained in:
2025-12-07 12:33:39 +03:30
parent c28a4a3177
commit 02686115cb
129 changed files with 5269 additions and 545 deletions

View File

@@ -0,0 +1,36 @@
import 'package:flutter/services.dart';
import 'package:rasadyar_core/core.dart';
class BuyLogic extends GetxController {
List<String> routesName = ['خرید'];
DateTime? _lastBackPressed;
@override
void onReady() {
fLog('BuyLogic onReady');
super.onReady();
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
void onPopScopTaped() async {
final now = DateTime.now();
if (_lastBackPressed == null || now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
_lastBackPressed = now;
Get.snackbar(
'خروج از برنامه',
'برای خروج دوباره بازگشت را بزنید',
snackPosition: SnackPosition.TOP,
duration: Duration(seconds: 2),
backgroundColor: AppColor.warning,
);
} else {
await SystemNavigator.pop();
}
}
}

View File

@@ -0,0 +1,55 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class BuyPage extends GetView<BuyLogic> {
const BuyPage({super.key});
@override
Widget build(BuildContext context) {
return ChickenBasePage(
routes: controller.routesName,
isBase: true,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 21.w,
children: [
GlassMorphismCardIcon(
title: 'خرید داخل استان',
vecIcon: Assets.vec.map1Svg.path,
gradient: LinearGradient(
colors: [Color(0xFF00E096), Color(0xFF007D5E)],
stops: [0.0, 0.95],
begin: AlignmentGeometry.topLeft,
end: AlignmentGeometry.bottomRight,
),
onTap: () {
Get.toNamed(ChickenRoutes.buysInProvinceSteward, id: stewardFirstKey);
},
),
GlassMorphismCardIcon(
title: 'خرید خارج استان',
vecIcon: Assets.vec.buyOutProvinceSvg.path,
gradient: LinearGradient(
colors: [Color(0xFF00E096), Color(0xFF007D5E)],
stops: [0.0, 0.95],
begin: AlignmentGeometry.topLeft,
end: AlignmentGeometry.bottomRight,
),
onTap: () {
Get.toNamed(ChickenRoutes.buysOutOfProvinceSteward, id: stewardFirstKey);
},
),
],
),
],
),
);
}
}