refactor: remove the unused submitUserInfo method and enhance the searchable dropdown functionality
- Removed `submitUserInfo` from auth services and integrations. - Refined dropdown with new multi-select and searchable options. - Added `PersianFormatter` for better input handling. - Updated `local.properties` to set flutter build mode to debug.
This commit is contained in:
@@ -131,12 +131,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
);
|
||||
}
|
||||
|
||||
authRepository.submitUserInfo(
|
||||
phone: usernameController.value.text,
|
||||
deviceName: deviceName.value,
|
||||
);
|
||||
|
||||
authRepository.stewardAppLogin(
|
||||
authTmp.stewardAppLogin(
|
||||
token: result?.accessToken ?? '',
|
||||
queryParameters: {
|
||||
"mobile": usernameController.value.text,
|
||||
|
||||
@@ -133,6 +133,7 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
maxLines: 1,
|
||||
controller: controller.usernameController.value,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [PersianFormatter()],
|
||||
initText: controller.usernameController.value.text,
|
||||
autofillHints: [AutofillHints.username],
|
||||
focusedBorder: OutlineInputBorder(
|
||||
@@ -187,6 +188,7 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
autofillHints: [AutofillHints.password],
|
||||
variant: RTextFieldVariant.password,
|
||||
initText: passwordController.value.text,
|
||||
inputFormatters: [PersianFormatter()],
|
||||
onChanged: (value) {
|
||||
passwordController.refresh();
|
||||
},
|
||||
|
||||
@@ -436,7 +436,6 @@ class HomePage extends GetView<HomeLogic> {
|
||||
Expanded(
|
||||
child: _informationLabelCard(
|
||||
title: 'مانده دولتی',
|
||||
titleColor: AppColor.blueNormal,
|
||||
isLoading: data.value == null,
|
||||
description: data.value?.totalGovernmentalRemainWeight?.separatedByCommaFa ?? '0',
|
||||
iconPath: Assets.vec.cubeCardGovermentSvg.path,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.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/pages/steward/sales_in_province/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
@@ -288,23 +287,49 @@ Widget addOrEditBottomSheet(SalesInProvinceLogic controller, {bool isEditMode =
|
||||
Widget guildsDropDown(SalesInProvinceLogic controller) {
|
||||
return Obx(() {
|
||||
final item = controller.selectedGuildModel.value;
|
||||
return OverlayDropdownWidget<GuildModel>(
|
||||
key: ValueKey(item?.user?.fullname ?? ''),
|
||||
items: controller.guildsModel,
|
||||
|
||||
return SearchableDropdown(
|
||||
onChanged: (value) {
|
||||
controller.selectedGuildModel.value = value;
|
||||
},
|
||||
selectedItem: item,
|
||||
selectedItem: [?item],
|
||||
singleSelect: false,
|
||||
items: controller.guildsModel,
|
||||
hintText: 'انتخاب مباشر/صنف',
|
||||
itemBuilder: (item) => Text(
|
||||
item.user != null
|
||||
? '${item.steward == true ? 'مباشر' : 'صنف'} ${item.user!.fullname} (${item.user!.mobile})'
|
||||
: 'بدون نام',
|
||||
),
|
||||
labelBuilder: (item) => Text(
|
||||
item?.user != null
|
||||
? '${item?.steward == true ? 'مباشر' : 'صنف'} ${item?.user!.fullname} (${item?.user!.mobile})'
|
||||
: 'انتخاب مباشر/صنف',
|
||||
multiLabelBuilder: (item) => Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.bgLight,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight),
|
||||
),
|
||||
padding: EdgeInsets.all(4),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
item?.user != null
|
||||
? '${item?.steward == true ? 'مباشر' : 'صنف'} ${item?.user!.fullname}'
|
||||
: 'بدون نام',
|
||||
style: AppFonts.yekan14,
|
||||
),
|
||||
SizedBox(width: 4.w),
|
||||
Icon(Icons.close, size: 16, color: AppColor.labelTextColor),
|
||||
],
|
||||
),
|
||||
),
|
||||
onSearch: (query) async {
|
||||
return Future.microtask(() {
|
||||
return RxList(
|
||||
controller.guildsModel
|
||||
.where((element) => element.user?.fullname?.contains(query) ?? false)
|
||||
.toList(),
|
||||
);
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user