feat: enhance NewPage UI with dynamic bottom sheet for form input and restructure SDUI JSON schema for improved data handling
This commit is contained in:
@@ -25,30 +25,39 @@ class NewPage extends GetView<NewPageLogic> {
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 24.h),
|
||||
ObxValue((data) {
|
||||
if (data.value == null) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}
|
||||
return Obx(
|
||||
() => SDUIFormWidget(
|
||||
model: data.value!,
|
||||
controllers: controller.controllers,
|
||||
state: controller.formState,
|
||||
onStateChanged: (key, value) {
|
||||
controller.formState[key] = value;
|
||||
},
|
||||
images: controller.images,
|
||||
onImagesChanged: (key, imageList) {
|
||||
controller.images[key] = imageList;
|
||||
},
|
||||
),
|
||||
);
|
||||
}, controller.sduiModel),
|
||||
Row(children: []),
|
||||
SizedBox(height: 24.h),
|
||||
RElevated(
|
||||
text: 'دکمه نمونه',
|
||||
onPressed: () {
|
||||
controller.onButtonPressed();
|
||||
Get.bottomSheet(
|
||||
isScrollControlled: true,
|
||||
enableDrag: true,
|
||||
|
||||
|
||||
BaseBottomSheet(
|
||||
height: Get.height * 0.8,
|
||||
child: ObxValue((data) {
|
||||
if (data.value == null) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}
|
||||
return Obx(
|
||||
() => SDUIFormWidget(
|
||||
model: data.value!,
|
||||
controllers: controller.controllers,
|
||||
state: controller.formState,
|
||||
onStateChanged: (key, value) {
|
||||
controller.formState[key] = value;
|
||||
},
|
||||
images: controller.images,
|
||||
onImagesChanged: (key, imageList) {
|
||||
controller.images[key] = imageList;
|
||||
},
|
||||
),
|
||||
);
|
||||
}, controller.sduiModel),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 24.h),
|
||||
|
||||
Reference in New Issue
Block a user