feat: enhance kill house - submit request module with submit request functionality, including new models, repository updates, and UI integration
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../data/models/response/user_profile/user_profile.dart';
|
||||
|
||||
class ChickenBaseLogic extends BasePageLogic {
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
ChickenRepository chickenRepository = diChicken.get<ChickenRepository>();
|
||||
|
||||
Rx<Resource<UserProfile>> userProfile = Rx<Resource<UserProfile>>(Resource.loading());
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
getUserProfile();
|
||||
}
|
||||
|
||||
Future<void> getUserProfile() async {
|
||||
userProfile.value = Resource.loading();
|
||||
await safeCall<UserProfile?>(
|
||||
call: () async =>
|
||||
await chickenRepository.getUserProfile(token: tokenService.accessToken.value!),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
userProfile.value = Resource.success(result);
|
||||
}
|
||||
},
|
||||
onError: (error, stackTrace) {},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ import 'package:rasadyar_chicken/presentation/widget/app_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/back_ground.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ChickenBasePage extends GetView<BaseLogic> {
|
||||
import 'logic.dart';
|
||||
|
||||
class ChickenBasePage extends GetView<ChickenBaseLogic> {
|
||||
const ChickenBasePage({
|
||||
super.key,
|
||||
this.hasBack = true,
|
||||
|
||||
@@ -62,7 +62,7 @@ Widget _itemList({required String title, required String? value, String? unit,Co
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
value!,
|
||||
value,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(color: const Color(0xFF5B5B5B)),
|
||||
),
|
||||
|
||||
@@ -9,10 +9,6 @@ class WidelyUsedLogic extends GetxController {
|
||||
StewardRootLogic rootLogic = Get.find<StewardRootLogic>();
|
||||
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
|
||||
Reference in New Issue
Block a user