validation_isrequired

This commit is contained in:
poojakhatawate 2024-06-24 17:06:09 +05:30
parent 12542f3534
commit c6ade88f27
11 changed files with 761 additions and 854 deletions

View File

@ -73,6 +73,7 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
// This widget is the root of your application. // This widget is the root of your application.
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(

View File

@ -2,6 +2,7 @@ import 'package:discover_module/ui_screen/profile.dart';
import 'package:discover_module/ui_screen/ranking.dart'; import 'package:discover_module/ui_screen/ranking.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_profile_picture/flutter_profile_picture.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
@ -23,6 +24,8 @@ class _ContactsState extends State<Contacts> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132)));
print( print(
"newdata_is: ${_contactbox.values.toList()},${_contactbox.values.toList().length}"); "newdata_is: ${_contactbox.values.toList()},${_contactbox.values.toList().length}");

View File

@ -11,6 +11,7 @@ import 'package:discover_module/ui_screen/interactionform/widget/custombutton.da
import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart';
import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart';
import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -312,16 +313,31 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
.only( .only(
left: 8.0, left: 8.0,
right: 8.0), right: 8.0),
// child: Text(
// '${sectionItem.name}:*',
// style: TextStyle(
// color: Colors
// .orange
// .shade800,
// fontSize:
// isTablet
// ? 18
// : 12,
// ),
// ),
child: Text( child: Text(
'${sectionItem.name}:*', sectionItem
.isRequired
? '${sectionItem.name}:*'
: '${sectionItem.name}:',
style: TextStyle( style: TextStyle(
color: Colors color: Colors
.orange .orange
.shade800, .shade800,
fontSize: fontSize: 18.0,
isTablet // fontSize: isTablet
? 18 // ? 18
: 12, // : 12,
), ),
), ),
), ),
@ -518,7 +534,10 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
), ),
); );
case InteractionWidget.DROPDOWN: case InteractionWidget.DROPDOWN:
return customdropdown(sectionItem, provider, list, multiple); // return customdropdown(sectionItem, provider, list, multiple);
return customAutoCompletedropdown(
sectionItem, provider, list, multiple);
} }
} }
@ -1212,204 +1231,143 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
} }
print("ConvertedArrayEditMulti.leangth: $convertedArray"); print("ConvertedArrayEditMulti.leangth: $convertedArray");
print("ConvertedArray.leangth: ${convertedArray.length}"); print("ConvertedArray.leangth: ${convertedArray.length}");
return DecoratedBox( return Padding(
decoration: BoxDecoration( padding: isTablet
border: Border.all(color: Colors.black), ? const EdgeInsets.only(left: 0.0)
borderRadius: BorderRadius.circular(10.0), : const EdgeInsets.only(left: 12.0, right: 12.0),
), child: Column(
child: Padding( children: [
padding: isTablet for (var i = 0; i < convertedArray.length; i++)
? const EdgeInsets.only(left: 14.0) DecoratedBox(
: const EdgeInsets.only(left: 12.0, right: 12.0), decoration: BoxDecoration(
child: Column( color: i % 2 == 0
children: [ ? Color.fromARGB(133, 213, 241, 254)
for (var i = 0; i < convertedArray.length; i++) : Colors.white,
GridView.builder( ),
physics: const NeverScrollableScrollPhysics(), child: Wrap(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( children: [
// crossAxisCount: context.responsive<int>( GestureDetector(child: Text("data")),
// 1, // default GridView.builder(
// sm: 1, // small physics: const NeverScrollableScrollPhysics(),
// md: 1, // medium gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// lg: sectionList.length == 1 ? 1 : 4, // large crossAxisCount: context.responsive<int>(
// xl: 5, // extra large screen 1,
// ), sm: 1, // small
crossAxisCount: context.responsive<int>( md: 2, // medium
1, lg: sectionList.length == 1
sm: 1, // small ? 1
md: 2, // medium : (sectionList.length >= 1 ? 3 : 3), // large
lg: sectionList.length == 1 xl: 3, // extra large screen
? 1 ),
: (sectionList.length >= 1 ? 3 : 3), // large mainAxisSpacing:
xl: 3, // extra large screen sectionList.length == 1 || !isTablet ? 1 : 2,
), childAspectRatio: sectionList.length == 1
mainAxisSpacing: ? orientation == Orientation.landscape
sectionList.length == 1 || !isTablet ? 1 : 2, ? 10
// childAspectRatio: isTablet : 4.8
// ? MediaQuery.of(context).size.width / : isTablet
// (MediaQuery.of(context).size.height * 0.3) ? 2.8
// : MediaQuery.of(context).size.width / : 3.0,
// (MediaQuery.of(context).size.height * 0.1), ),
// childAspectRatio: isTablet shrinkWrap: true,
// ? MediaQuery.of(context).size.width / padding: EdgeInsets.zero,
// (MediaQuery.of(context).size.height / 3) itemCount: convertedArray[i].length,
// : MediaQuery.of(context).size.width / itemBuilder: (context, index) {
// (MediaQuery.of(context).size.height * 0.2), SectionList sectionItem = convertedArray[i][index];
dropdownvalue =
sectionItem.widget == InteractionWidget.DROPDOWN
? sectionItem.value ?? "Select"
: ' ';
List<InputClass> list =
sectionItem.widget == InteractionWidget.DROPDOWN ||
sectionItem.widget ==
InteractionWidget.AUTOCOMPLETE ||
sectionItem.widget ==
InteractionWidget.MULTISELECT
? provider.getData2(sectionItem)
: [];
provider.checkboxlist =
sectionItem.widget == InteractionWidget.CHECKBOX
? provider.getData2(sectionItem)
: [];
childAspectRatio: sectionList.length == 1 return SizedBox(
? orientation == Orientation.landscape height: MediaQuery.of(context).size.height,
? 10 child: Column(
: 4.8 crossAxisAlignment: CrossAxisAlignment.start,
: isTablet children: [
? 2.8 sectionItem.widget == InteractionWidget.BUTTON &&
: 3.0, sectionItem.param == 'add' ||
// mainAxisSpacing: sectionItem.param == 'deletebtn'
// sectionList.length == 1 || !isTablet ? 1 : 3.5, ? const SizedBox.shrink()
// childAspectRatio: sectionList.length == 1 : Padding(
// ? orientation == Orientation.landscape padding: const EdgeInsets.only(
// ? 10 left: 8.0, right: 8.0),
// : 4.8 child: Text(
// : isTablet sectionItem.isRequired
// ? 2.8 ? '${sectionItem.name}:*'
// : 3.0, : '${sectionItem.name}:',
), style: TextStyle(
shrinkWrap: true, color: Colors.orange.shade800,
padding: EdgeInsets.zero, fontSize: 18.0,
// fontSize: isTablet
// childAspectRatio: sectionList.length == 1 || !isTablet // ? 18
// ? orientation == Orientation.landscape // : 12,
// ? 10
// : 4.2
// : 1.8,
itemCount: convertedArray[i].length,
itemBuilder: (context, index) {
// children: List.generate(
// sectionList.length,
// (i) {
// // print(sectionList);
// SectionList sectionItem = sectionList[i];
// dropdownvalue = sectionItem.widget == InteractionWidget.DROPDOWN
// ? sectionItem.value ?? "Select"
// : ' ';
// List<InputClass> list =
// sectionItem.widget == InteractionWidget.DROPDOWN ||
// sectionItem.widget == InteractionWidget.AUTOCOMPLETE ||
// sectionItem.widget == InteractionWidget.MULTISELECT
// ? provider.getData2(sectionItem)
// : [];
// provider.checkboxlist =
// sectionItem.widget == InteractionWidget.CHECKBOX
// ? provider.getData2(sectionItem)
// : [];
SectionList sectionItem = convertedArray[i][index];
dropdownvalue =
sectionItem.widget == InteractionWidget.DROPDOWN
? sectionItem.value ?? "Select"
: ' ';
List<InputClass> list = sectionItem.widget ==
InteractionWidget.DROPDOWN ||
sectionItem.widget ==
InteractionWidget.AUTOCOMPLETE ||
sectionItem.widget == InteractionWidget.MULTISELECT
? provider.getData2(sectionItem)
: [];
provider.checkboxlist =
sectionItem.widget == InteractionWidget.CHECKBOX
? provider.getData2(sectionItem)
: [];
return SizedBox(
height: MediaQuery.of(context).size.height,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sectionItem.widget == InteractionWidget.BUTTON &&
sectionItem.param == 'add' ||
sectionItem.param == 'deletebtn'
? const SizedBox.shrink()
: Padding(
padding: const EdgeInsets.only(
left: 8.0, right: 8.0),
child: Text(
'${sectionItem.name}:*',
style: TextStyle(
color: Colors.orange.shade800,
fontSize: isTablet ? 18 : 14,
),
),
),
const SizedBox(
height: 15,
),
sectionItem.widget == InteractionWidget.BUTTON
? sectionItem.input == 'chooseFile'
? Row(
children: [
CustomButton(
backgroundColor:
const Color.fromARGB(
255, 233, 229, 229),
onPressed: () async {
if (sectionItem
.selectedValue!.isNotEmpty) {
showFilesAlertDialog(
context,
sectionItem.fileName!
.join(','),
sectionItem);
} else {
sectionItem.selectedValue = [];
sectionItem.extension = [];
sectionItem.fileName = [];
await getEncodedFile(
sectionItem);
}
setState(() {});
},
width: 120,
height: 40,
fontsize: 12,
textColor: Colors.black,
title: sectionItem.name),
const SizedBox(
width: 5,
), ),
Text( )),
sectionItem.selectedValue!.isNotEmpty const SizedBox(
? 'File uploaded' height: 15,
: 'No file uploaded', ),
style: TextStyle( sectionItem.widget == InteractionWidget.BUTTON
color: sectionItem ? sectionItem.input == 'chooseFile'
? Row(
children: [
CustomButton(
backgroundColor:
const Color.fromARGB(
255, 233, 229, 229),
onPressed: () async {
if (sectionItem.selectedValue!
.isNotEmpty) {
showFilesAlertDialog(
context,
sectionItem.fileName!
.join(','),
sectionItem);
} else {
sectionItem.selectedValue =
[];
sectionItem.extension = [];
sectionItem.fileName = [];
await getEncodedFile(
sectionItem);
}
setState(() {});
},
width: 120,
height: 40,
fontsize: 12,
textColor: Colors.black,
title: sectionItem.name),
const SizedBox(
width: 5,
),
Text(
sectionItem
.selectedValue!.isNotEmpty .selectedValue!.isNotEmpty
? Colors.green ? 'File uploaded'
: Colors.red), : 'No file uploaded',
), style: TextStyle(
], color: sectionItem
) .selectedValue!
: isTablet .isNotEmpty
? IconButton( ? Colors.green
onPressed: () { : Colors.red),
provider.deleteMultipleRows( ),
sectionItem.gid!, ],
sectionList[i],
sectionName);
setState(() {});
},
icon: const Icon(
Icons.cancel,
size: 30,
color:
Color.fromARGB(255, 8, 39, 92),
),
) )
: Padding( : isTablet
padding: const EdgeInsets.only( ? IconButton(
left: 3.0, top: 5),
child: CustomButton(
backgroundColor:
const Color.fromARGB(
255, 233, 75, 75),
onPressed: () { onPressed: () {
provider.deleteMultipleRows( provider.deleteMultipleRows(
sectionItem.gid!, sectionItem.gid!,
@ -1418,28 +1376,52 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
setState(() {}); setState(() {});
}, },
// width: 80, icon: const Icon(
// height: 30, Icons.cancel,
height: 40, size: 30,
fontsize: 12, color: Color.fromARGB(
textColor: Colors.white, 255, 8, 39, 92),
title: "Delete"), ),
) )
: returnWidget( : Padding(
sectionItem: sectionItem, padding: const EdgeInsets.only(
item: item, left: 3.0, top: 5),
provider: provider, child: CustomButton(
list: list, backgroundColor:
gridIndex: i, const Color.fromARGB(
listIndex: listIndex, 255, 233, 75, 75),
widgetData: sectionItem.widget!, onPressed: () {
multiple: true), provider.deleteMultipleRows(
], sectionItem.gid!,
), sectionList[i],
); sectionName);
}),
], setState(() {});
), },
// width: 80,
// height: 30,
height: 40,
fontsize: 12,
textColor: Colors.white,
title: "Delete"),
)
: returnWidget(
sectionItem: sectionItem,
item: item,
provider: provider,
list: list,
gridIndex: i,
listIndex: listIndex,
widgetData: sectionItem.widget!,
multiple: true),
],
),
);
}),
],
),
),
],
), ),
); );
} }

File diff suppressed because it is too large Load Diff

View File

@ -1148,6 +1148,7 @@ class InteractionProvider extends ChangeNotifier {
.where((element) => element.pid == obj.sectionList[i].value) .where((element) => element.pid == obj.sectionList[i].value)
.toList(); .toList();
// sectionItem.selectedObject = list[0];
sectionItem.selectedObject = list[0]; sectionItem.selectedObject = list[0];
} else { } else {
// InputClass obj = InputClass( // InputClass obj = InputClass(
@ -1382,6 +1383,7 @@ class InteractionProvider extends ChangeNotifier {
inputList: e.inputList, inputList: e.inputList,
isRequired: e.isRequired, isRequired: e.isRequired,
name: e.name, name: e.name,
validation: e.validation,
param: e.param, param: e.param,
selectedValue: [], selectedValue: [],
widget: e.widget, widget: e.widget,
@ -1392,13 +1394,14 @@ class InteractionProvider extends ChangeNotifier {
value: e.value)) value: e.value))
.toList(); .toList();
SectionList delItem = SectionList( SectionList delItem = SectionList(
name: "delete", name: " ",
param: "deletebtn", param: "deletebtn",
id: "deletebtn", id: "deletebtn",
selectedValue: [], selectedValue: [],
depid: "", depid: "",
widget: InteractionWidget.BUTTON, widget: InteractionWidget.BUTTON,
inputList: [], inputList: [],
validation: Validation(isRequired: false),
isRequired: true); isRequired: true);
addList.add(delItem); addList.add(delItem);
@ -1502,9 +1505,11 @@ class InteractionProvider extends ChangeNotifier {
: e.multipleList! : e.multipleList!
.map((mobj) => SectionList( .map((mobj) => SectionList(
depid: mobj.depid, depid: mobj.depid,
validation:
Validation(isRequired: mobj.validation!.isRequired),
id: mobj.id, id: mobj.id,
inputList: mobj.inputList, inputList: mobj.inputList,
isRequired: mobj.isRequired, isRequired: mobj.validation!.isRequired,
name: mobj.name, name: mobj.name,
param: mobj.param, param: mobj.param,
selectedValue: mobj.selectedValue, selectedValue: mobj.selectedValue,
@ -1521,8 +1526,10 @@ class InteractionProvider extends ChangeNotifier {
.map((obj) => SectionList( .map((obj) => SectionList(
depid: obj.depid, depid: obj.depid,
id: obj.id, id: obj.id,
validation:
Validation(isRequired: obj.validation!.isRequired),
inputList: obj.inputList, inputList: obj.inputList,
isRequired: obj.isRequired, isRequired: obj.validation!.isRequired,
name: obj.name, name: obj.name,
param: obj.param, param: obj.param,
selectedValue: obj.selectedValue, selectedValue: obj.selectedValue,
@ -1675,30 +1682,32 @@ class InteractionProvider extends ChangeNotifier {
print("Section_isssss: $section"); print("Section_isssss: $section");
print("Section_isssss: ${section.widget}"); print("Section_isssss: ${section.widget}");
print("Section_isssss: ${section.selectedId}"); print("Section_isssss: ${section.selectedId}");
print("Section_isssss1111: ${section.isRequired},${section.name}");
if (section.widget == InteractionWidget.TEXT) { if (section.widget == InteractionWidget.TEXT) {
if (section.controller!.text.isEmpty) { // if (section.controller!.text.isEmpty) {
if (section.isRequired == true && section.controller!.text.isEmpty) {
debugPrint("Iam text and empty"); debugPrint("Iam text and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (section.widget == InteractionWidget.AUTOCOMPLETE) { } else if (section.widget == InteractionWidget.AUTOCOMPLETE) {
if (section.selectedValue!.isEmpty) { if (section.isRequired == true && section.selectedValue!.isEmpty) {
debugPrint("Iam AUTOCOMPLETE and empty"); debugPrint("Iam AUTOCOMPLETE and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (section.widget == InteractionWidget.DROPDOWN) { } else if (section.widget == InteractionWidget.DROPDOWN) {
if (section.selectedValue!.isEmpty) { if (section.isRequired == true && section.selectedValue!.isEmpty) {
debugPrint("Iam dropdown and empty"); debugPrint("Iam dropdown and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (section.widget == InteractionWidget.CHECKBOX) { } else if (section.widget == InteractionWidget.CHECKBOX) {
if (section.selectedValue!.isEmpty) { if (section.isRequired == true && section.selectedValue!.isEmpty) {
debugPrint("Iam CHECKBOX and empty"); debugPrint("Iam CHECKBOX and empty");
notifyListeners(); notifyListeners();
@ -1712,35 +1721,36 @@ class InteractionProvider extends ChangeNotifier {
print("Multilist Enterwidget: ${msection.widget}"); print("Multilist Enterwidget: ${msection.widget}");
if (msection.widget == InteractionWidget.TEXT) { if (msection.isRequired == true &&
msection.widget == InteractionWidget.TEXT) {
print("Checkinggg: ${msection.id}"); print("Checkinggg: ${msection.id}");
print("Checkinggg: ${msection.depid}"); print("Checkinggg: ${msection.depid}");
print("Checkinggg: ${msection.chars}"); print("Checkinggg: ${msection.chars}");
print("Checkinggg: ${msection.selectedId}"); print("Checkinggg: ${msection.selectedId}");
print("Checkinggg: ${msection.selectedValue!}"); print("Checkinggg: ${msection.selectedValue!}");
if (msection.selectedValue!.isEmpty) { if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
debugPrint("Iam multi text and empty"); debugPrint("Iam multi text and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (msection.widget == InteractionWidget.AUTOCOMPLETE) { } else if (msection.widget == InteractionWidget.AUTOCOMPLETE) {
if (msection.selectedValue!.isEmpty) { if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
debugPrint("Iam AUTOCOMPLETE and empty"); debugPrint("Iam AUTOCOMPLETE and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (msection.widget == InteractionWidget.DROPDOWN) { } else if (msection.widget == InteractionWidget.DROPDOWN) {
if (msection.selectedValue!.isEmpty) { if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
debugPrint("Iam dropdown and empty"); debugPrint("Iam dropdown and empty ${msection.widget}");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (msection.widget == InteractionWidget.CHECKBOX) { } else if (msection.widget == InteractionWidget.CHECKBOX) {
if (msection.selectedValue!.isEmpty) { if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
debugPrint("Iam CHECKBOX and empty"); debugPrint("Iam CHECKBOX and empty");
notifyListeners(); notifyListeners();

View File

@ -126,7 +126,7 @@ class SectionList {
@HiveField(8) @HiveField(8)
List<InputClass>? inputList; List<InputClass>? inputList;
@HiveField(9) @HiveField(9)
bool? isRequired; bool isRequired;
TextEditingController? controller; TextEditingController? controller;
@HiveField(10) @HiveField(10)
@ -160,7 +160,7 @@ class SectionList {
this.input, this.input,
this.gid, this.gid,
this.inputList, this.inputList,
this.isRequired, this.isRequired = false,
this.controller, this.controller,
this.selectedObject, this.selectedObject,
this.selectedId, this.selectedId,

View File

@ -109,7 +109,7 @@ class SectionListAdapter extends TypeAdapter<SectionList> {
input: fields[7] as String?, input: fields[7] as String?,
gid: fields[3] as int?, gid: fields[3] as int?,
inputList: (fields[8] as List?)?.cast<InputClass>(), inputList: (fields[8] as List?)?.cast<InputClass>(),
isRequired: fields[9] as bool?, isRequired: fields[9] as bool,
selectedObject: fields[12] as InputClass?, selectedObject: fields[12] as InputClass?,
selectedId: fields[11] as String?, selectedId: fields[11] as String?,
validation: fields[13] as Validation?, validation: fields[13] as Validation?,

View File

@ -501,19 +501,21 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
print("ConvertedArrayEdit.leangth: $convertedArray"); print("ConvertedArrayEdit.leangth: $convertedArray");
print("ConvertedArray.leangth2323: ${convertedArray.length}"); print("ConvertedArray.leangth2323: ${convertedArray.length}");
return DecoratedBox( return Padding(
decoration: BoxDecoration( padding: isTablet
border: Border.all(color: Colors.black), ? const EdgeInsets.only(left: 0.0, right: 0.0)
borderRadius: BorderRadius.circular(10), : const EdgeInsets.only(left: 12.0, right: 12.0),
), child: Column(
child: Padding( children: [
padding: isTablet for (var i = 0; i < convertedArray.length; i++)
? const EdgeInsets.only(left: 14.0) DecoratedBox(
: const EdgeInsets.only(left: 12.0, right: 12.0), decoration: BoxDecoration(
child: Column( // borderRadius: BorderRadius.circular(10.0),
children: [ color: i % 2 == 0
for (var i = 0; i < convertedArray.length; i++) ? Color.fromARGB(133, 213, 241, 254)
GridView.builder( : Colors.white,
),
child: GridView.builder(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: context.responsive<int>( crossAxisCount: context.responsive<int>(
@ -617,9 +619,9 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
); );
}, },
), ),
//), ),
], //),
), ],
), ),
); );
} }

View File

@ -597,6 +597,7 @@ class ViewInteractionProvider extends ChangeNotifier {
inputList: e.inputList, inputList: e.inputList,
isRequired: e.isRequired, isRequired: e.isRequired,
name: e.name, name: e.name,
validation: e.validation,
param: e.param, param: e.param,
selectedValue: [], selectedValue: [],
widget: e.widget, widget: e.widget,
@ -607,13 +608,14 @@ class ViewInteractionProvider extends ChangeNotifier {
value: e.value)) value: e.value))
.toList(); .toList();
SectionList delItem = SectionList( SectionList delItem = SectionList(
name: "delete", name: " ",
param: "deletebtn", param: "deletebtn",
id: "deletebtn", id: "deletebtn",
selectedValue: [], selectedValue: [],
depid: "", depid: "",
widget: InteractionWidget.BUTTON, widget: InteractionWidget.BUTTON,
inputList: [], inputList: [],
validation: Validation(isRequired: false),
isRequired: true); isRequired: true);
addList.add(delItem); addList.add(delItem);
@ -775,6 +777,7 @@ class ViewInteractionProvider extends ChangeNotifier {
depid: mobj.depid, depid: mobj.depid,
id: mobj.id, id: mobj.id,
inputList: mobj.inputList, inputList: mobj.inputList,
validation: mobj.validation,
isRequired: mobj.isRequired, isRequired: mobj.isRequired,
extension: mobj.extension, extension: mobj.extension,
fileName: mobj.fileName, fileName: mobj.fileName,
@ -793,9 +796,10 @@ class ViewInteractionProvider extends ChangeNotifier {
depid: obj.depid, depid: obj.depid,
id: obj.id, id: obj.id,
inputList: obj.inputList, inputList: obj.inputList,
validation: obj.validation,
isRequired: obj.isRequired,
extension: obj.extension, extension: obj.extension,
fileName: obj.fileName, fileName: obj.fileName,
isRequired: obj.isRequired,
name: obj.name, name: obj.name,
param: obj.param, param: obj.param,
selectedValue: obj.tempselectedValue ?? obj.selectedValue, selectedValue: obj.tempselectedValue ?? obj.selectedValue,
@ -930,28 +934,28 @@ class ViewInteractionProvider extends ChangeNotifier {
print("Section_isssss: ${section.selectedId}"); print("Section_isssss: ${section.selectedId}");
if (section.widget == InteractionWidget.TEXT) { if (section.widget == InteractionWidget.TEXT) {
if (section.controller!.text.isEmpty) { if (section.isRequired == true && section.controller!.text.isEmpty) {
debugPrint("Iam text and empty"); debugPrint("Iam text and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (section.widget == InteractionWidget.AUTOCOMPLETE) { } else if (section.widget == InteractionWidget.AUTOCOMPLETE) {
if (section.selectedValue!.isEmpty) { if (section.isRequired == true && section.selectedValue!.isEmpty) {
debugPrint("Iam AUTOCOMPLETE and empty"); debugPrint("Iam AUTOCOMPLETE and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (section.widget == InteractionWidget.DROPDOWN) { } else if (section.widget == InteractionWidget.DROPDOWN) {
if (section.selectedValue!.isEmpty) { if (section.isRequired == true && section.selectedValue!.isEmpty) {
debugPrint("Iam dropdown and empty"); debugPrint("Iam dropdown and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (section.widget == InteractionWidget.CHECKBOX) { } else if (section.widget == InteractionWidget.CHECKBOX) {
if (section.selectedValue!.isEmpty) { if (section.isRequired == true && section.selectedValue!.isEmpty) {
debugPrint("Iam CHECKBOX and empty"); debugPrint("Iam CHECKBOX and empty");
notifyListeners(); notifyListeners();
@ -972,28 +976,28 @@ class ViewInteractionProvider extends ChangeNotifier {
print("Checkinggg: ${msection.selectedId}"); print("Checkinggg: ${msection.selectedId}");
print("Checkinggg: ${msection.selectedValue!}"); print("Checkinggg: ${msection.selectedValue!}");
if (msection.selectedValue!.isEmpty) { if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
debugPrint("Iam multi text and empty"); debugPrint("Iam multi text and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (msection.widget == InteractionWidget.AUTOCOMPLETE) { } else if (msection.widget == InteractionWidget.AUTOCOMPLETE) {
if (msection.selectedValue!.isEmpty) { if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
debugPrint("Iam AUTOCOMPLETE and empty"); debugPrint("Iam AUTOCOMPLETE and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (msection.widget == InteractionWidget.DROPDOWN) { } else if (msection.widget == InteractionWidget.DROPDOWN) {
if (msection.selectedValue!.isEmpty) { if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
debugPrint("Iam dropdown and empty"); debugPrint("Iam dropdown and empty");
notifyListeners(); notifyListeners();
return false; return false;
} }
} else if (msection.widget == InteractionWidget.CHECKBOX) { } else if (msection.widget == InteractionWidget.CHECKBOX) {
if (msection.selectedValue!.isEmpty) { if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
debugPrint("Iam CHECKBOX and empty"); debugPrint("Iam CHECKBOX and empty");
notifyListeners(); notifyListeners();

View File

@ -776,6 +776,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.5.1" version: "1.5.1"
popover:
dependency: "direct main"
description:
name: popover
sha256: "5cba40e04115cbbf15c35e00767b91e8bf3f769763a34beb2f8a1b9e8b5fc876"
url: "https://pub.dev"
source: hosted
version: "0.3.0+1"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -58,6 +58,7 @@ dependencies:
rfw: ^1.0.26 rfw: ^1.0.26
hive_generator: ^2.0.1 hive_generator: ^2.0.1
responsive_grid: ^2.4.4 responsive_grid: ^2.4.4
popover: ^0.3.0+1
dev_dependencies: dev_dependencies: