chore: remove unused assets and data source files related to the kill house module, and update import paths for better organization
This commit is contained in:
@@ -12,4 +12,6 @@ abstract class VetFarmRemoteDataSource {
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
});
|
||||
|
||||
Future<DioResponse<Map<String, dynamic>>> getSDUIForm({String? token});
|
||||
}
|
||||
|
||||
@@ -36,4 +36,20 @@ class VetFarmRemoteDataSourceImpl implements VetFarmRemoteDataSource {
|
||||
data: request.toJson(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<DioResponse<Map<String, dynamic>>> getSDUIForm({String? token}) async {
|
||||
DioRemote dio = DioRemote(baseUrl: "http://testbackend.rasadyaar.ir/");
|
||||
await dio.init();
|
||||
|
||||
|
||||
var res = await dio.get(
|
||||
'inspection_form_sd_ui/',
|
||||
|
||||
fromJson: (json) {
|
||||
return json;
|
||||
},
|
||||
);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,7 @@ abstract class VetFarmRepository {
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
});
|
||||
|
||||
|
||||
Future<DioResponse<Map<String, dynamic>>> getSDUIForm({String? token});
|
||||
}
|
||||
|
||||
@@ -27,4 +27,8 @@ class VetFarmRepositoryImpl implements VetFarmRepository {
|
||||
}) async {
|
||||
return await _remote.submitInspection(token: token, request: request);
|
||||
}
|
||||
@override
|
||||
Future<DioResponse<Map<String, dynamic>>> getSDUIForm({String? token}) async {
|
||||
return await _remote.getSDUIForm(token: token);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,10 @@ class VetFarmHomeLogic extends GetxController {
|
||||
route: VetFarmRoutes.newInspectionVetFarm,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
),
|
||||
VetFarmHomeItem(
|
||||
title: "صفحه جدید",
|
||||
route: VetFarmRoutes.newPageVetFarm,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import 'package:rasadyar_chicken/features/vet_farm/data/repositories/vet_farm_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/sdui/widgets/text_form_filed/model/text_form_field_sdui_model.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class NewPageLogic extends GetxController {
|
||||
VetFarmRootLogic rootLogic = Get.find<VetFarmRootLogic>();
|
||||
|
||||
Rxn<TextFormFieldSDUIModel> textFormFieldSDUIModel =
|
||||
Rxn<TextFormFieldSDUIModel>();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
getSDUIForm();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
// Ready logic here
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
// Cleanup logic here
|
||||
}
|
||||
|
||||
Future<void> getSDUIForm() async {
|
||||
await safeCall(
|
||||
call: () async => await rootLogic.vetFarmRepository.getSDUIForm(),
|
||||
onSuccess: (result) {
|
||||
textFormFieldSDUIModel.value = TextFormFieldSDUIModel.fromJson(
|
||||
result.data ?? {},
|
||||
);
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
print(error);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void onButtonPressed() {}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/sdui/widgets/text_form_filed/text_form_filed_sdui.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class NewPage extends GetView<NewPageLogic> {
|
||||
const NewPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
hasBack: true,
|
||||
backId: vetFarmActionKey,
|
||||
child: contentWidget(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget contentWidget() {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ObxValue((data) {
|
||||
if (data.value == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return textFormFiledSDUI(model: data.value!);
|
||||
}, controller.textFormFieldSDUIModel),
|
||||
|
||||
SizedBox(height: 24.h),
|
||||
RElevated(
|
||||
text: 'دکمه نمونه',
|
||||
onPressed: () {
|
||||
controller.onButtonPressed();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/active_hat
|
||||
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/active_hatching/view.dart';
|
||||
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/new_inspection/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/new_inspection/view.dart';
|
||||
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/new_page/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/new_page/view.dart';
|
||||
import 'package:rasadyar_chicken/features/vet_farm/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/global_binding.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
|
||||
@@ -72,5 +74,18 @@ class VetFarmPages {
|
||||
}),
|
||||
],
|
||||
),
|
||||
GetPage(
|
||||
name: VetFarmRoutes.newPageVetFarm,
|
||||
page: () => NewPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
bindings: [
|
||||
GlobalBinding(),
|
||||
|
||||
BindingsBuilder(() {
|
||||
Get.lazyPut(() => NewPageLogic());
|
||||
}),
|
||||
|
||||
],
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -7,4 +7,5 @@ sealed class VetFarmRoutes {
|
||||
static const actionVetFarm = '$_base/action';
|
||||
static const activeHatchingVetFarm = '$_base/activeHatching';
|
||||
static const newInspectionVetFarm = '$_base/newInspection';
|
||||
static const newPageVetFarm = '$_base/newPage';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user