扫码无权限优化,司机预约多弹窗
This commit is contained in:
@@ -13,7 +13,7 @@ import 'reservation_list_bottomsheet.dart';
|
||||
class ReservationPage extends GetView<C_ReservationController> {
|
||||
ReservationPage({super.key});
|
||||
|
||||
bool init = false;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -21,10 +21,7 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
init: C_ReservationController(),
|
||||
id: 'reservation',
|
||||
builder: (_) {
|
||||
if (!init) {
|
||||
_setupListener(context);
|
||||
init = true;
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[100],
|
||||
body: GestureDetector(
|
||||
@@ -335,20 +332,7 @@ class ReservationPage extends GetView<C_ReservationController> {
|
||||
);
|
||||
}
|
||||
|
||||
void _setupListener(BuildContext context) {
|
||||
ever(controller.shouldShowReservationList, (bool shouldShow) {
|
||||
if (shouldShow) {
|
||||
Get.bottomSheet(
|
||||
const ReservationListBottomSheet(),
|
||||
isScrollControlled: true, // 允许弹窗使用更多屏幕高度
|
||||
backgroundColor: Colors.transparent,
|
||||
);
|
||||
|
||||
// 重要:显示后立即将信号重置为 false,防止不必要的重复弹出
|
||||
controller.shouldShowReservationList.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 表单中的可点击行 (用于日期和时间选择)
|
||||
Widget _buildPickerRow({
|
||||
|
||||
Reference in New Issue
Block a user