validation_isrequired
This commit is contained in:
parent
12542f3534
commit
c6ade88f27
|
@ -73,6 +73,7 @@ class MyApp extends StatefulWidget {
|
|||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
// This widget is the root of your application.
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:discover_module/ui_screen/profile.dart';
|
|||
import 'package:discover_module/ui_screen/ranking.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_profile_picture/flutter_profile_picture.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
|
@ -23,6 +24,8 @@ class _ContactsState extends State<Contacts> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132)));
|
||||
print(
|
||||
"newdata_is: ${_contactbox.values.toList()},${_contactbox.values.toList().length}");
|
||||
|
||||
|
|
|
@ -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/interatciontextfield.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/services.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
@ -312,16 +313,31 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
.only(
|
||||
left: 8.0,
|
||||
right: 8.0),
|
||||
// child: Text(
|
||||
// '${sectionItem.name}:*',
|
||||
// style: TextStyle(
|
||||
// color: Colors
|
||||
// .orange
|
||||
// .shade800,
|
||||
// fontSize:
|
||||
// isTablet
|
||||
// ? 18
|
||||
// : 12,
|
||||
// ),
|
||||
// ),
|
||||
child: Text(
|
||||
'${sectionItem.name}:*',
|
||||
sectionItem
|
||||
.isRequired
|
||||
? '${sectionItem.name}:*'
|
||||
: '${sectionItem.name}:',
|
||||
style: TextStyle(
|
||||
color: Colors
|
||||
.orange
|
||||
.shade800,
|
||||
fontSize:
|
||||
isTablet
|
||||
? 18
|
||||
: 12,
|
||||
fontSize: 18.0,
|
||||
// fontSize: isTablet
|
||||
// ? 18
|
||||
// : 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -518,7 +534,10 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
),
|
||||
);
|
||||
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("ConvertedArray.leangth: ${convertedArray.length}");
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: isTablet
|
||||
? const EdgeInsets.only(left: 14.0)
|
||||
: const EdgeInsets.only(left: 12.0, right: 12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
for (var i = 0; i < convertedArray.length; i++)
|
||||
GridView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
// crossAxisCount: context.responsive<int>(
|
||||
// 1, // default
|
||||
// sm: 1, // small
|
||||
// md: 1, // medium
|
||||
// lg: sectionList.length == 1 ? 1 : 4, // large
|
||||
// xl: 5, // extra large screen
|
||||
// ),
|
||||
crossAxisCount: context.responsive<int>(
|
||||
1,
|
||||
sm: 1, // small
|
||||
md: 2, // medium
|
||||
lg: sectionList.length == 1
|
||||
? 1
|
||||
: (sectionList.length >= 1 ? 3 : 3), // large
|
||||
xl: 3, // extra large screen
|
||||
),
|
||||
mainAxisSpacing:
|
||||
sectionList.length == 1 || !isTablet ? 1 : 2,
|
||||
// childAspectRatio: isTablet
|
||||
// ? MediaQuery.of(context).size.width /
|
||||
// (MediaQuery.of(context).size.height * 0.3)
|
||||
// : MediaQuery.of(context).size.width /
|
||||
// (MediaQuery.of(context).size.height * 0.1),
|
||||
// childAspectRatio: isTablet
|
||||
// ? MediaQuery.of(context).size.width /
|
||||
// (MediaQuery.of(context).size.height / 3)
|
||||
// : MediaQuery.of(context).size.width /
|
||||
// (MediaQuery.of(context).size.height * 0.2),
|
||||
return Padding(
|
||||
padding: isTablet
|
||||
? const EdgeInsets.only(left: 0.0)
|
||||
: const EdgeInsets.only(left: 12.0, right: 12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
for (var i = 0; i < convertedArray.length; i++)
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: i % 2 == 0
|
||||
? Color.fromARGB(133, 213, 241, 254)
|
||||
: Colors.white,
|
||||
),
|
||||
child: Wrap(
|
||||
children: [
|
||||
GestureDetector(child: Text("data")),
|
||||
GridView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: context.responsive<int>(
|
||||
1,
|
||||
sm: 1, // small
|
||||
md: 2, // medium
|
||||
lg: sectionList.length == 1
|
||||
? 1
|
||||
: (sectionList.length >= 1 ? 3 : 3), // large
|
||||
xl: 3, // extra large screen
|
||||
),
|
||||
mainAxisSpacing:
|
||||
sectionList.length == 1 || !isTablet ? 1 : 2,
|
||||
childAspectRatio: sectionList.length == 1
|
||||
? orientation == Orientation.landscape
|
||||
? 10
|
||||
: 4.8
|
||||
: isTablet
|
||||
? 2.8
|
||||
: 3.0,
|
||||
),
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
itemCount: convertedArray[i].length,
|
||||
itemBuilder: (context, index) {
|
||||
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
|
||||
? orientation == Orientation.landscape
|
||||
? 10
|
||||
: 4.8
|
||||
: isTablet
|
||||
? 2.8
|
||||
: 3.0,
|
||||
// mainAxisSpacing:
|
||||
// sectionList.length == 1 || !isTablet ? 1 : 3.5,
|
||||
// childAspectRatio: sectionList.length == 1
|
||||
// ? orientation == Orientation.landscape
|
||||
// ? 10
|
||||
// : 4.8
|
||||
// : isTablet
|
||||
// ? 2.8
|
||||
// : 3.0,
|
||||
),
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
|
||||
// childAspectRatio: sectionList.length == 1 || !isTablet
|
||||
// ? orientation == Orientation.landscape
|
||||
// ? 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,
|
||||
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.isRequired
|
||||
? '${sectionItem.name}:*'
|
||||
: '${sectionItem.name}:',
|
||||
style: TextStyle(
|
||||
color: Colors.orange.shade800,
|
||||
fontSize: 18.0,
|
||||
// fontSize: isTablet
|
||||
// ? 18
|
||||
// : 12,
|
||||
),
|
||||
Text(
|
||||
sectionItem.selectedValue!.isNotEmpty
|
||||
? 'File uploaded'
|
||||
: 'No file uploaded',
|
||||
style: TextStyle(
|
||||
color: sectionItem
|
||||
)),
|
||||
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
|
||||
? Colors.green
|
||||
: Colors.red),
|
||||
),
|
||||
],
|
||||
)
|
||||
: isTablet
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
provider.deleteMultipleRows(
|
||||
sectionItem.gid!,
|
||||
sectionList[i],
|
||||
sectionName);
|
||||
|
||||
setState(() {});
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.cancel,
|
||||
size: 30,
|
||||
color:
|
||||
Color.fromARGB(255, 8, 39, 92),
|
||||
),
|
||||
? 'File uploaded'
|
||||
: 'No file uploaded',
|
||||
style: TextStyle(
|
||||
color: sectionItem
|
||||
.selectedValue!
|
||||
.isNotEmpty
|
||||
? Colors.green
|
||||
: Colors.red),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 3.0, top: 5),
|
||||
child: CustomButton(
|
||||
backgroundColor:
|
||||
const Color.fromARGB(
|
||||
255, 233, 75, 75),
|
||||
: isTablet
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
provider.deleteMultipleRows(
|
||||
sectionItem.gid!,
|
||||
|
@ -1418,28 +1376,52 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
|
||||
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),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
icon: const Icon(
|
||||
Icons.cancel,
|
||||
size: 30,
|
||||
color: Color.fromARGB(
|
||||
255, 8, 39, 92),
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 3.0, top: 5),
|
||||
child: CustomButton(
|
||||
backgroundColor:
|
||||
const Color.fromARGB(
|
||||
255, 233, 75, 75),
|
||||
onPressed: () {
|
||||
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
|
@ -1148,6 +1148,7 @@ class InteractionProvider extends ChangeNotifier {
|
|||
.where((element) => element.pid == obj.sectionList[i].value)
|
||||
.toList();
|
||||
|
||||
// sectionItem.selectedObject = list[0];
|
||||
sectionItem.selectedObject = list[0];
|
||||
} else {
|
||||
// InputClass obj = InputClass(
|
||||
|
@ -1382,6 +1383,7 @@ class InteractionProvider extends ChangeNotifier {
|
|||
inputList: e.inputList,
|
||||
isRequired: e.isRequired,
|
||||
name: e.name,
|
||||
validation: e.validation,
|
||||
param: e.param,
|
||||
selectedValue: [],
|
||||
widget: e.widget,
|
||||
|
@ -1392,13 +1394,14 @@ class InteractionProvider extends ChangeNotifier {
|
|||
value: e.value))
|
||||
.toList();
|
||||
SectionList delItem = SectionList(
|
||||
name: "delete",
|
||||
name: " ",
|
||||
param: "deletebtn",
|
||||
id: "deletebtn",
|
||||
selectedValue: [],
|
||||
depid: "",
|
||||
widget: InteractionWidget.BUTTON,
|
||||
inputList: [],
|
||||
validation: Validation(isRequired: false),
|
||||
isRequired: true);
|
||||
|
||||
addList.add(delItem);
|
||||
|
@ -1502,9 +1505,11 @@ class InteractionProvider extends ChangeNotifier {
|
|||
: e.multipleList!
|
||||
.map((mobj) => SectionList(
|
||||
depid: mobj.depid,
|
||||
validation:
|
||||
Validation(isRequired: mobj.validation!.isRequired),
|
||||
id: mobj.id,
|
||||
inputList: mobj.inputList,
|
||||
isRequired: mobj.isRequired,
|
||||
isRequired: mobj.validation!.isRequired,
|
||||
name: mobj.name,
|
||||
param: mobj.param,
|
||||
selectedValue: mobj.selectedValue,
|
||||
|
@ -1521,8 +1526,10 @@ class InteractionProvider extends ChangeNotifier {
|
|||
.map((obj) => SectionList(
|
||||
depid: obj.depid,
|
||||
id: obj.id,
|
||||
validation:
|
||||
Validation(isRequired: obj.validation!.isRequired),
|
||||
inputList: obj.inputList,
|
||||
isRequired: obj.isRequired,
|
||||
isRequired: obj.validation!.isRequired,
|
||||
name: obj.name,
|
||||
param: obj.param,
|
||||
selectedValue: obj.selectedValue,
|
||||
|
@ -1675,30 +1682,32 @@ class InteractionProvider extends ChangeNotifier {
|
|||
print("Section_isssss: $section");
|
||||
print("Section_isssss: ${section.widget}");
|
||||
print("Section_isssss: ${section.selectedId}");
|
||||
print("Section_isssss1111: ${section.isRequired},${section.name}");
|
||||
|
||||
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");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (section.widget == InteractionWidget.AUTOCOMPLETE) {
|
||||
if (section.selectedValue!.isEmpty) {
|
||||
if (section.isRequired == true && section.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam AUTOCOMPLETE and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (section.widget == InteractionWidget.DROPDOWN) {
|
||||
if (section.selectedValue!.isEmpty) {
|
||||
if (section.isRequired == true && section.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam dropdown and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (section.widget == InteractionWidget.CHECKBOX) {
|
||||
if (section.selectedValue!.isEmpty) {
|
||||
if (section.isRequired == true && section.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam CHECKBOX and empty");
|
||||
notifyListeners();
|
||||
|
||||
|
@ -1712,35 +1721,36 @@ class InteractionProvider extends ChangeNotifier {
|
|||
|
||||
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.depid}");
|
||||
print("Checkinggg: ${msection.chars}");
|
||||
print("Checkinggg: ${msection.selectedId}");
|
||||
print("Checkinggg: ${msection.selectedValue!}");
|
||||
|
||||
if (msection.selectedValue!.isEmpty) {
|
||||
if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam multi text and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (msection.widget == InteractionWidget.AUTOCOMPLETE) {
|
||||
if (msection.selectedValue!.isEmpty) {
|
||||
if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam AUTOCOMPLETE and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (msection.widget == InteractionWidget.DROPDOWN) {
|
||||
if (msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam dropdown and empty");
|
||||
if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam dropdown and empty ${msection.widget}");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (msection.widget == InteractionWidget.CHECKBOX) {
|
||||
if (msection.selectedValue!.isEmpty) {
|
||||
if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam CHECKBOX and empty");
|
||||
notifyListeners();
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ class SectionList {
|
|||
@HiveField(8)
|
||||
List<InputClass>? inputList;
|
||||
@HiveField(9)
|
||||
bool? isRequired;
|
||||
bool isRequired;
|
||||
|
||||
TextEditingController? controller;
|
||||
@HiveField(10)
|
||||
|
@ -160,7 +160,7 @@ class SectionList {
|
|||
this.input,
|
||||
this.gid,
|
||||
this.inputList,
|
||||
this.isRequired,
|
||||
this.isRequired = false,
|
||||
this.controller,
|
||||
this.selectedObject,
|
||||
this.selectedId,
|
||||
|
|
|
@ -109,7 +109,7 @@ class SectionListAdapter extends TypeAdapter<SectionList> {
|
|||
input: fields[7] as String?,
|
||||
gid: fields[3] as int?,
|
||||
inputList: (fields[8] as List?)?.cast<InputClass>(),
|
||||
isRequired: fields[9] as bool?,
|
||||
isRequired: fields[9] as bool,
|
||||
selectedObject: fields[12] as InputClass?,
|
||||
selectedId: fields[11] as String?,
|
||||
validation: fields[13] as Validation?,
|
||||
|
|
|
@ -501,19 +501,21 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
|
|||
print("ConvertedArrayEdit.leangth: $convertedArray");
|
||||
print("ConvertedArray.leangth2323: ${convertedArray.length}");
|
||||
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Padding(
|
||||
padding: isTablet
|
||||
? const EdgeInsets.only(left: 14.0)
|
||||
: const EdgeInsets.only(left: 12.0, right: 12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
for (var i = 0; i < convertedArray.length; i++)
|
||||
GridView.builder(
|
||||
return Padding(
|
||||
padding: isTablet
|
||||
? const EdgeInsets.only(left: 0.0, right: 0.0)
|
||||
: const EdgeInsets.only(left: 12.0, right: 12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
for (var i = 0; i < convertedArray.length; i++)
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(10.0),
|
||||
color: i % 2 == 0
|
||||
? Color.fromARGB(133, 213, 241, 254)
|
||||
: Colors.white,
|
||||
),
|
||||
child: GridView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: context.responsive<int>(
|
||||
|
@ -617,9 +619,9 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
|
|||
);
|
||||
},
|
||||
),
|
||||
//),
|
||||
],
|
||||
),
|
||||
),
|
||||
//),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -597,6 +597,7 @@ class ViewInteractionProvider extends ChangeNotifier {
|
|||
inputList: e.inputList,
|
||||
isRequired: e.isRequired,
|
||||
name: e.name,
|
||||
validation: e.validation,
|
||||
param: e.param,
|
||||
selectedValue: [],
|
||||
widget: e.widget,
|
||||
|
@ -607,13 +608,14 @@ class ViewInteractionProvider extends ChangeNotifier {
|
|||
value: e.value))
|
||||
.toList();
|
||||
SectionList delItem = SectionList(
|
||||
name: "delete",
|
||||
name: " ",
|
||||
param: "deletebtn",
|
||||
id: "deletebtn",
|
||||
selectedValue: [],
|
||||
depid: "",
|
||||
widget: InteractionWidget.BUTTON,
|
||||
inputList: [],
|
||||
validation: Validation(isRequired: false),
|
||||
isRequired: true);
|
||||
|
||||
addList.add(delItem);
|
||||
|
@ -775,6 +777,7 @@ class ViewInteractionProvider extends ChangeNotifier {
|
|||
depid: mobj.depid,
|
||||
id: mobj.id,
|
||||
inputList: mobj.inputList,
|
||||
validation: mobj.validation,
|
||||
isRequired: mobj.isRequired,
|
||||
extension: mobj.extension,
|
||||
fileName: mobj.fileName,
|
||||
|
@ -793,9 +796,10 @@ class ViewInteractionProvider extends ChangeNotifier {
|
|||
depid: obj.depid,
|
||||
id: obj.id,
|
||||
inputList: obj.inputList,
|
||||
validation: obj.validation,
|
||||
isRequired: obj.isRequired,
|
||||
extension: obj.extension,
|
||||
fileName: obj.fileName,
|
||||
isRequired: obj.isRequired,
|
||||
name: obj.name,
|
||||
param: obj.param,
|
||||
selectedValue: obj.tempselectedValue ?? obj.selectedValue,
|
||||
|
@ -930,28 +934,28 @@ class ViewInteractionProvider extends ChangeNotifier {
|
|||
print("Section_isssss: ${section.selectedId}");
|
||||
|
||||
if (section.widget == InteractionWidget.TEXT) {
|
||||
if (section.controller!.text.isEmpty) {
|
||||
if (section.isRequired == true && section.controller!.text.isEmpty) {
|
||||
debugPrint("Iam text and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (section.widget == InteractionWidget.AUTOCOMPLETE) {
|
||||
if (section.selectedValue!.isEmpty) {
|
||||
if (section.isRequired == true && section.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam AUTOCOMPLETE and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (section.widget == InteractionWidget.DROPDOWN) {
|
||||
if (section.selectedValue!.isEmpty) {
|
||||
if (section.isRequired == true && section.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam dropdown and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (section.widget == InteractionWidget.CHECKBOX) {
|
||||
if (section.selectedValue!.isEmpty) {
|
||||
if (section.isRequired == true && section.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam CHECKBOX and empty");
|
||||
notifyListeners();
|
||||
|
||||
|
@ -972,28 +976,28 @@ class ViewInteractionProvider extends ChangeNotifier {
|
|||
print("Checkinggg: ${msection.selectedId}");
|
||||
print("Checkinggg: ${msection.selectedValue!}");
|
||||
|
||||
if (msection.selectedValue!.isEmpty) {
|
||||
if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam multi text and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (msection.widget == InteractionWidget.AUTOCOMPLETE) {
|
||||
if (msection.selectedValue!.isEmpty) {
|
||||
if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam AUTOCOMPLETE and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (msection.widget == InteractionWidget.DROPDOWN) {
|
||||
if (msection.selectedValue!.isEmpty) {
|
||||
if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam dropdown and empty");
|
||||
notifyListeners();
|
||||
|
||||
return false;
|
||||
}
|
||||
} else if (msection.widget == InteractionWidget.CHECKBOX) {
|
||||
if (msection.selectedValue!.isEmpty) {
|
||||
if (msection.isRequired == true && msection.selectedValue!.isEmpty) {
|
||||
debugPrint("Iam CHECKBOX and empty");
|
||||
notifyListeners();
|
||||
|
||||
|
|
|
@ -776,6 +776,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
@ -58,6 +58,7 @@ dependencies:
|
|||
rfw: ^1.0.26
|
||||
hive_generator: ^2.0.1
|
||||
responsive_grid: ^2.4.4
|
||||
popover: ^0.3.0+1
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
|
|
Loading…
Reference in New Issue