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:
2025-12-28 16:05:37 +03:30
parent 71952bef5a
commit fc0161e261
4 changed files with 1343 additions and 113 deletions

View File

@@ -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),