bottom bar

This commit is contained in:
poojakhatawate 2024-07-26 12:47:34 +05:30
parent 10f4e04004
commit b440d6ac10
15 changed files with 2488 additions and 630 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -7,3 +7,240 @@ class Constants {
static const url = 'http://192.168.2.143:8085/api'; static const url = 'http://192.168.2.143:8085/api';
//static const url = 'http://192.168.153.50:8082/api'; //static const url = 'http://192.168.153.50:8082/api';
} }
// adds spacing between the text and image
// Flexible(
// flex: 1,
// child: Padding(
// padding: const EdgeInsets.only(
// left: 1.0, right: 1.0),
// child: Card(
// elevation: 5,
// shape: RoundedRectangleBorder(
// borderRadius:
// BorderRadius.circular(0.0),
// ),
// color: const Color.fromARGB(
// 255, 0, 71, 137),
// child: ExpansionTile(
// maintainState: true,
// onExpansionChanged:
// (bool expanded) {
// setState(() {
// _isExpanded = expanded;
// });
// },
// backgroundColor:
// const Color.fromARGB(
// 255, 0, 71, 137),
// trailing: Icon(
// _isExpanded
// ? Icons.keyboard_arrow_up
// : Icons
// .keyboard_arrow_down,
// color: Colors.white),
// // collapsedBackgroundColor: Color(0xFF2b9af3),
// initiallyExpanded: true,
// title: Row(
// //mainAxisSize: MainAxisSize.min,
// children: [
// // GestureDetector(
// Text1(
// title:
// "Medical Insight",
// txtcolor: Colors.white,
// fontweight:
// FontWeight.normal,
// txtfont: 17.0),
// // ),
// const SizedBox(
// width: 8.0,
// ),
// Text1(
// title: "4",
// txtfont: 18.0,
// txtcolor:
// const Color.fromARGB(
// 255, 60, 82, 102),
// )
// ],
// ),
// children: [
// Container(
// height: MediaQuery.of(context)
// .size
// .height /
// 5,
// color: Colors.white,
// child: Consumer<
// MediacalInsightProvider>(
// builder: (context, value,
// child) {
// return Column(
// children: [
// Expanded(
// child:
// ListView.builder(
// physics:
// const ScrollPhysics(),
// // scrollDirection: Axis.vertical,
// shrinkWrap:
// true,
// itemCount: value
// .med
// .length,
// itemBuilder:
// (context,
// index) {
// item = value
// .med[
// index];
// print(
// "Item_Medical_insight ${item['Therapeutic Area']}");
// return Padding(
// padding: const EdgeInsets
// .all(
// 8.0),
// child:
// Card(
// margin:
// EdgeInsets.zero,
// elevation:
// 4,
// surfaceTintColor:
// Colors.white,
// shape:
// RoundedRectangleBorder(
// borderRadius:
// BorderRadius.zero,
// ),
// // shape: RoundedRectangleBorder(
// // side: BorderSide(color: Colors.black, width: 1),
// // borderRadius: BorderRadius.only(
// // bottomRight: Radius.circular(30)),
// // ),
// child:
// SizedBox(
// width:
// MediaQuery.sizeOf(context).width,
// child:
// ListTile(
// dense:
// true,
// title:
// Column(
// // crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// // Text(
// // "Acute neurology is the <b> therapeutic </b> area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."),
// RichText(
// text: TextSpan(
// text: '',
// style: DefaultTextStyle.of(context).style,
// children: const <TextSpan>[
// TextSpan(text: 'Acute neurology ', style: TextStyle(fontWeight: FontWeight.bold)),
// // TextSpan(
// // text: ' therapeutic area ',
// // style: TextStyle(
// // fontWeight:
// // FontWeight.bold)),
// TextSpan(text: 'is the therapeutic area of the medical insight for '),
// TextSpan(text: 'Product A. The age of treatment', style: TextStyle(fontWeight: FontWeight.bold)),
// TextSpan(text: ' is the topic of interest for this source type'),
// TextSpan(text: ' publication.', style: TextStyle(fontWeight: FontWeight.bold)),
// ],
// ),
// ),
// const Padding(
// padding: EdgeInsets.all(8.0),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Row(
// children: [
// Icon(
// Icons.person,
// size: 20,
// ),
// Text(
// "pooja",
// style: TextStyle(fontSize: 14.0),
// )
// ],
// ),
// Row(
// children: [
// Icon(
// Icons.calendar_today,
// size: 20,
// ),
// Text(
// "11/11/2022 ",
// style: TextStyle(fontSize: 14.0),
// )
// ],
// )
// ],
// ),
// ),
// ],
// ),
// ),
// ),
// // shape: BorderRadius.only(bottomRight: Radius.circular(50)),
// ),
// );
// }),
// )
// ],
// );
// }),
// ),
// Container(
// color: Colors.white,
// child: Align(
// alignment: Alignment.center,
// child: Padding(
// padding:
// const EdgeInsets.all(
// 8.0),
// child: OutlinedButton(
// onPressed: () {
// },
// child: Text(
// 'Show More',
// style: TextStyle(
// color: Constants
// .k2color),
// ),
// style: OutlinedButton
// .styleFrom(
// shape:
// RoundedRectangleBorder(
// borderRadius:
// BorderRadius
// .circular(
// 12),
// ),
// ),
// ),
// ),
// ),
// )
// ]),
// ),
// ),
// ),
// SizedBox(
// height: 10.0,
// ),

View File

@ -99,11 +99,13 @@ class _MyAppState extends State<MyApp> {
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'Flutter Demo', title: 'Flutter Demo',
theme: ThemeData( theme: ThemeData(
fontFamily: 'SourceSerif',
appBarTheme: const AppBarTheme( appBarTheme: const AppBarTheme(
backgroundColor: Color.fromARGB(255, 0, 71, 132), backgroundColor: Color.fromARGB(255, 0, 71, 132),
foregroundColor: Colors.white //here you can give the text color foregroundColor: Colors.white //here you can give the text color
)), )),
home: const MyHomePage(title: 'Discover Module'), home: Contacts1(),
// home: const MyHomePage(title: 'Discover Module'),
// home: const MedicalInsight(), // home: const MedicalInsight(),
); );
} }

View File

@ -107,6 +107,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
child: OrientationBuilder(builder: (context, orientation) { child: OrientationBuilder(builder: (context, orientation) {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
backgroundColor: Colors.white,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
widget.saveInteraction.id, widget.saveInteraction.id,

View File

@ -4,6 +4,7 @@ import 'package:discover_module/ui_screen/interactionform/util.dart';
import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart';
import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart';
import 'package:discover_module/ui_screen/new_editinteraction.dart'; import 'package:discover_module/ui_screen/new_editinteraction.dart';
import 'package:discover_module/ui_screen/new_viewinteraction.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -86,7 +87,7 @@ class _SavedFormListScreenState extends State<SavedFormListScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>
ViewInteractionScreen( ViewInteractionScreen1(
saveInteraction: saveInteraction:
provider.savedList[index], provider.savedList[index],
))); )));
@ -144,7 +145,7 @@ class _SavedFormListScreenState extends State<SavedFormListScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>
ViewInteractionScreen( ViewInteractionScreen1(
saveInteraction: saveInteraction:
provider.savedList[index], provider.savedList[index],
))); )));

View File

@ -433,14 +433,14 @@ import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:adoptive_calendar/adoptive_calendar.dart'; import 'package:adoptive_calendar/adoptive_calendar.dart';
class MedicalInsight extends StatefulWidget { class MedicalInsight1 extends StatefulWidget {
const MedicalInsight({super.key}); const MedicalInsight1({super.key});
@override @override
State<MedicalInsight> createState() => _MedicalInsightState(); State<MedicalInsight1> createState() => _MedicalInsightState();
} }
class _MedicalInsightState extends State<MedicalInsight> { class _MedicalInsightState extends State<MedicalInsight1> {
final List<Map<String, dynamic>> cardData = [ final List<Map<String, dynamic>> cardData = [
{'id': 'ID ', 'number': 'MI1688128025', 'id1': "jjj", 'number1': '265'}, {'id': 'ID ', 'number': 'MI1688128025', 'id1': "jjj", 'number1': '265'},
{'id': 'ID ', 'number': 20}, {'id': 'ID ', 'number': 20},
@ -459,6 +459,10 @@ class _MedicalInsightState extends State<MedicalInsight> {
bool calview = false; bool calview = false;
String? start, end; String? start, end;
final TextEditingController startController = TextEditingController();
final TextEditingController endController = TextEditingController();
@override @override
void initState() { void initState() {
actionKey = GlobalKey(); actionKey = GlobalKey();
@ -484,7 +488,9 @@ class _MedicalInsightState extends State<MedicalInsight> {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: SafeArea( child: SafeArea(
child: Scaffold( child: Scaffold(
backgroundColor: const Color.fromARGB(255, 222, 237, 247), // backgroundColor: const Color.fromARGB(255, 222, 237, 247),
backgroundColor: const Color.fromARGB(255, 246, 248, 252),
appBar: AppBar( appBar: AppBar(
title: const Text('Medical Insight'), title: const Text('Medical Insight'),
actions: [ actions: [
@ -526,18 +532,40 @@ class _MedicalInsightState extends State<MedicalInsight> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
OutlinedButton( // OutlinedButton(
onPressed: () { // onPressed: () {
_selectDate(context); // _selectDate(context);
}, // },
child: // child:
start == null ? Text('Start Date') : Text(start!), // start == null ? Text('Start Date') : Text(start!),
// ),
Expanded(
flex: 1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: TextFormField(
controller: startController,
decoration: InputDecoration(
isDense: true,
border: OutlineInputBorder(),
hintText: "ff",
labelText:
startController.text ?? 'Start Date'),
// focusNode: AlwaysDisabledFocusNode(),
onTap: () {
_selectDate(context);
},
),
),
), ),
OutlinedButton( Expanded(
onPressed: () { flex: 1,
_selectDate1(context); child: OutlinedButton(
}, onPressed: () {
child: end == null ? Text('Start Date') : Text(end!), _selectDate1(context);
},
child: end == null ? Text('Start Date') : Text(end!),
),
), ),
], ],
), ),
@ -566,12 +594,12 @@ class _MedicalInsightState extends State<MedicalInsight> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
OutlinedButton( // OutlinedButton(
style: OutlinedButton.styleFrom( // style: OutlinedButton.styleFrom(
backgroundColor: Constants.k2color, // backgroundColor: Constants.k2color,
foregroundColor: Colors.white), // foregroundColor: Colors.white),
onPressed: () {}, // onPressed: () {},
child: Text("Create Medical Insight")) // child: Text("Create Medical Insight"))
], ],
), ),
Expanded( Expanded(
@ -592,7 +620,14 @@ class _MedicalInsightState extends State<MedicalInsight> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Card( child: Card(
margin: EdgeInsets.zero,
elevation: 4,
surfaceTintColor: Colors.white, surfaceTintColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
// shape: RoundedRectangleBorder( // shape: RoundedRectangleBorder(
// side: BorderSide(color: Colors.black, width: 1), // side: BorderSide(color: Colors.black, width: 1),
// borderRadius: BorderRadius.only( // borderRadius: BorderRadius.only(
@ -601,6 +636,7 @@ class _MedicalInsightState extends State<MedicalInsight> {
child: SizedBox( child: SizedBox(
width: MediaQuery.sizeOf(context).width, width: MediaQuery.sizeOf(context).width,
child: ListTile( child: ListTile(
dense: true,
title: Column( title: Column(
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -609,20 +645,26 @@ class _MedicalInsightState extends State<MedicalInsight> {
RichText( RichText(
text: TextSpan( text: TextSpan(
text: 'Acute neurology is the', text: '',
style: DefaultTextStyle.of(context) style: DefaultTextStyle.of(context)
.style, .style,
children: const <TextSpan>[ children: const <TextSpan>[
TextSpan( TextSpan(
text: ' therapeutic area ', text: 'Acute neurology ',
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.bold)), FontWeight.bold)),
// TextSpan(
// text: ' therapeutic area ',
// style: TextStyle(
// fontWeight:
// FontWeight.bold)),
TextSpan( TextSpan(
text: text:
'of the medical insight for Product A.'), 'is the therapeutic area of the medical insight for '),
TextSpan( TextSpan(
text: 'The age of treatment', text:
'Product A. The age of treatment',
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.bold)), FontWeight.bold)),
@ -638,11 +680,11 @@ class _MedicalInsightState extends State<MedicalInsight> {
), ),
), ),
Padding( const Padding(
padding: const EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceAround, MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
@ -898,7 +940,7 @@ class _MedicalInsightState extends State<MedicalInsight> {
String convertedDateTime = String convertedDateTime =
"${picked.year.toString()}-${picked.month.toString().padLeft(2, '0')}-${picked.day.toString().padLeft(2, '0')}"; "${picked.year.toString()}-${picked.month.toString().padLeft(2, '0')}-${picked.day.toString().padLeft(2, '0')}";
// widget.textController.value = TextEditingValue(text: picked.toString()); // widget.textController.value = TextEditingValue(text: picked.toString());
textController.value = TextEditingValue(text: convertedDateTime); startController.value = TextEditingValue(text: convertedDateTime);
start = convertedDateTime; start = convertedDateTime;
; ;

View File

@ -595,6 +595,7 @@ import 'package:discover_module/constants.dart';
import 'package:discover_module/provider_class/hcp%20_provider.dart'; import 'package:discover_module/provider_class/hcp%20_provider.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_profile_picture/flutter_profile_picture.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart';
@ -635,6 +636,16 @@ class _Contacts1State extends State<Contacts1> {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
backgroundColor: const Color.fromARGB(255, 246, 248, 252),
appBar: AppBar(
automaticallyImplyLeading: false,
title: SvgPicture.asset(
'assets/konectar_white_logo.svg',
width: 100.0,
// color: Colors.white,
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
),
body: Consumer<hcpProvider>( body: Consumer<hcpProvider>(
builder: (context, hcpProvider, child) { builder: (context, hcpProvider, child) {
List<dynamic> displayedHCPList = List<dynamic> displayedHCPList =

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,532 @@
import 'package:discover_module/constants.dart';
import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart';
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart';
import 'package:discover_module/ui_screen/interactionform/util.dart';
import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart';
import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable
class ViewInteractionScreen1 extends StatefulWidget {
SaveInteraction saveInteraction;
ViewInteractionScreen1({super.key, required this.saveInteraction});
@override
State<ViewInteractionScreen1> createState() => _ViewInteractionScreenState();
}
class _ViewInteractionScreenState extends State<ViewInteractionScreen1> {
List<dynamic> interactionReponseList = [];
List<SectionList> sectionList = [];
List<TextEditingController> textEditingControllerList = [];
int textfieldIndex = 0;
String dropdownvalue = 'Select value';
String? fileName;
final TextEditingController textEditingController = TextEditingController();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
init();
});
super.initState();
}
init() async {
await Provider.of<InteractionProvider>(context, listen: false)
.initSavedForm(widget.saveInteraction);
setState(() {});
}
@override
Widget build(BuildContext context) {
return Consumer<InteractionProvider>(
builder: (BuildContext context, provider, Widget? child) {
print("build context");
print("${provider.interactionReponseList}");
return GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: OrientationBuilder(builder: (context, orientation) {
return SafeArea(
child: Scaffold(
backgroundColor: Colors.white,
//resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text(
widget.saveInteraction.id,
style: TextStyle(
fontSize: isTablet ? 22 : 14, color: Colors.white),
),
// backgroundColor: const Color(0xFF2b9af3),
automaticallyImplyLeading: false,
leading: InkWell(
onTap: () {
Navigator.pop(context);
},
child: const Icon(
Icons.arrow_back_ios,
color: Colors.white,
),
),
),
body: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: ListView.builder(
itemCount: provider.interactionReponseList.length,
cacheExtent: double.parse(
provider.interactionReponseList.length.toString()),
itemBuilder: (context, index) {
var item = provider.interactionReponseList[index];
sectionList = item.sectionList;
return Card(
elevation: 4,
// color: Constants.k2color,
child: Container(
color: Color.fromARGB(255, 246, 248, 252),
child: ExpansionTile(
dense: true,
initiallyExpanded: true,
title: Stack(
alignment: AlignmentDirectional.center,
children: [
Container(
// height: double.infinity,
width: double.infinity,
padding: const EdgeInsets.all(0.0),
decoration: BoxDecoration(
// color: Color(0xFF2b9af3),
// color: Constants.k2color,
),
child: Text(
item.sectionName,
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize: 18.0),
)),
]),
children: [
Container(
color: Colors.white,
child: Padding(
padding:
const EdgeInsets.only(top: 0.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(
left: 18.0),
child: GridView.count(
physics:
const NeverScrollableScrollPhysics(),
crossAxisCount:
context.responsive<int>(
1,
sm: 1, // small
md: 2, // medium
lg: sectionList.length == 1
? 1
: 3, // large
xl: 3, // extra large screen
),
mainAxisSpacing:
sectionList.length == 1 ||
!isTablet
? 1
: 3.5,
childAspectRatio:
sectionList.length == 1
? orientation ==
Orientation
.landscape
? 10
: 4.8
: isTablet
? 2.8
: 5.5,
shrinkWrap: true,
padding: EdgeInsets.zero,
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)
: [];
return Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
sectionItem.widget ==
InteractionWidget
.BUTTON &&
sectionItem
.param ==
'add'
? const SizedBox
.shrink()
: Text(
'${sectionItem.name}:*',
style: TextStyle(
color: Constants
.k2color,
fontSize:
isTablet
? 18
: 12,
fontWeight:
FontWeight
.normal),
),
returnWidget(
sectionItem:
sectionItem,
item: item,
provider: provider,
list: list,
gridIndex: i,
listIndex: index,
widgetData:
sectionItem
.widget!),
],
);
},
),
),
),
item.multiple
? gridViewWidget(
provider,
item.sectionName,
item.multipleList ?? [],
orientation,
item,
index)
: const SizedBox.shrink(),
provider.interactionReponseList
.length ==
index - 1
? saveActions(provider)
: const SizedBox.shrink()
//const Spacer(),
],
),
),
),
]),
),
);
},
),
),
// const Spacer(),
// saveActions(provider),
],
)),
);
}),
);
});
}
Widget returnWidget({
required SectionList sectionItem,
required FormFieldData item,
required InteractionProvider provider,
required List<InputClass> list,
required int gridIndex,
required int listIndex,
required InteractionWidget widgetData,
}) {
switch (widgetData) {
case InteractionWidget.CHECKBOX:
return (sectionItem.inputList!.length >= 5)
? Text(sectionItem.selectedValue.toString())
: Text(provider.getDataValue(
sectionItem.id, sectionItem.selectedValue!.last));
case InteractionWidget.AUTOCOMPLETE:
return Text(provider.getDataValue(
sectionItem.id, sectionItem.selectedValue!.last));
case InteractionWidget.MULTISELECT:
return Text(sectionItem.selectedValue.toString());
case InteractionWidget.RADIO:
return (sectionItem.inputList!.length >= 5)
? Text(
sectionItem.selectedValue!.isNotEmpty
? provider.getDataValue(
sectionItem.id, sectionItem.selectedValue!.last)
: " ",
style: TextStyle(fontSize: 18.0),
)
: Text(
provider.getDataValue(
sectionItem.id,
sectionItem.selectedValue!.last,
),
style: TextStyle(fontSize: 18.0),
);
case InteractionWidget.LABEL:
return Text(
sectionItem.input!,
style: TextStyle(fontSize: 18.0),
);
case InteractionWidget.RANGESLIDER:
return Text(sectionItem.selectedValue!.isNotEmpty
? sectionItem.selectedValue!.last.toString()
: " ");
case InteractionWidget.TEXT:
return Text(
sectionItem.selectedValue!.isNotEmpty
? sectionItem.selectedValue!.last.toString()
: " ",
style: TextStyle(fontSize: 18.0),
);
case InteractionWidget.BUTTON:
return sectionItem.input == "chooseFile"
? sectionItem.selectedValue!.isNotEmpty
? const Text("File Uploaded")
: const Text(" ")
: const Text(" ");
default:
return Text(sectionItem.selectedValue!.isNotEmpty
? provider.getDataValue(
sectionItem.id, sectionItem.selectedValue!.last)
: " ");
}
}
Widget saveActions(InteractionProvider provider) {
return Align(
alignment: Alignment.centerRight,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
CustomButton(
backgroundColor: Colors.red.shade800,
onPressed: () {
//showDeleteProfileAlertDialog(context);
for (var textcontrollers in provider.textEditingControllerList) {
textcontrollers.text = '';
}
},
textColor: Colors.white,
title: "Reset",
height: 40,
width: isTablet ? 100 : 60,
fontsize: isTablet ? 15 : 10.2,
),
SizedBox(
width: isTablet ? 20 : 4,
),
CustomButton(
backgroundColor: Colors.green.shade900,
onPressed: () async {
if (textFieldsValidation(provider).isEmpty) {
// await provider.saveJsonObject(context, widget.form);
_displaySnackBar('Form Saved Sucessfully!');
} else {
_displaySnackBar(textFieldsValidation(provider));
}
},
textColor: Colors.white,
title: "Save",
height: 40,
width: isTablet ? 100 : 60,
fontsize: isTablet ? 16 : 12,
),
SizedBox(
width: isTablet ? 20 : 2,
),
],
),
);
}
Widget gridViewWidget(
InteractionProvider provider,
String sectionName,
List<SectionList> sectionList,
Orientation orientation,
FormFieldData item,
int listIndex) {
List<SectionList> pooja = sectionList;
print("Pooja: $pooja");
List<List<SectionList>> convertedArray = [];
print("Provider Length: ${item.sectionList.length}");
for (int i = 0; i < sectionList.length; i += item.sectionList.length + 1) {
print("Section List11111: $sectionList");
print("item.sectionList.length List11111: ${item.sectionList.length}");
convertedArray
.add(sectionList.sublist(i, i + item.sectionList.length + 1));
}
print("ConvertedArrayEdit.leangth: $convertedArray");
print("ConvertedArray.leangth2323: ${convertedArray.length}");
return 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>(
1, // default
sm: 1, // small
md: 2, // medium
lg: sectionList.length == 1
? 1
: (sectionList.length >= 1 ? 3 : 3),
// lg: sectionList.length == 1 ? 1 : 3, // large
xl: 3, // extra large screen
),
childAspectRatio: sectionList.length == 1
? orientation == Orientation.landscape
? 10
: 4.8
: isTablet
? 2.8
: 5.5,
mainAxisSpacing: sectionList.length == 1 || !isTablet ? 1 : 3.5,
// mainAxisSpacing: sectionList.length == 1 || !isTablet ? 1 : 2,
),
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)
: [];
return SizedBox(
height: MediaQuery.of(context).size.height,
child: Padding(
padding: const EdgeInsets.only(left: 18.0, top: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sectionItem.widget == InteractionWidget.BUTTON &&
sectionItem.param == 'add' ||
sectionItem.param == 'deletebtn'
? const SizedBox.shrink()
// ? const SizedBox.shrink()
: Text(
'${sectionItem.name}:*',
style: TextStyle(
color: Constants.k2color,
fontSize: isTablet ? 18 : 12,
),
),
// const SizedBox(
// height: 15,
// ),
returnWidget(
sectionItem: sectionItem,
item: item,
provider: provider,
list: list,
gridIndex: i,
listIndex: listIndex,
widgetData: sectionItem.widget!),
],
),
),
);
},
),
),
//),
],
);
}
String textFieldsValidation(InteractionProvider provider) {
if (provider.sectionList
.any((element) => element.controller!.text.isEmpty)) {
return 'Fields cannot be empty';
}
return '';
}
_displaySnackBar(String msg) {
final snackBar = SnackBar(
content: Text(
msg,
style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar);
}
}

View File

@ -193,11 +193,11 @@ class _FormListState extends State<FormList> {
ConfigDataProvider(); ConfigDataProvider();
await configDataProvider.initConfigUIDataMedical(); await configDataProvider.initConfigUIDataMedical();
Navigator.push( // Navigator.push(
context, // context,
MaterialPageRoute( // MaterialPageRoute(
builder: (context) => // builder: (context) =>
const MedicalInsight())); // const MedicalInsight1()));
}, },
trailing: Icon(Icons.arrow_forward_ios), trailing: Icon(Icons.arrow_forward_ios),
), ),
@ -298,7 +298,7 @@ class _FormListState extends State<FormList> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const MedicalInsight())); builder: (context) => const MedicalInsight1()));
}, },
trailing: const Icon(Icons.arrow_forward_ios), trailing: const Icon(Icons.arrow_forward_ios),
), ),

View File

@ -107,10 +107,12 @@ flutter:
# "family" key with the font family name, and a "fonts" key with a # "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For # list giving the asset and other descriptors for the font. For
# example: # example:
# fonts: fonts:
# - family: Schyler - family: SourceSerif
# fonts: fonts:
# - asset: fonts/Schyler-Regular.ttf - asset: fonts/SourceSerif4-Regular.ttf
- asset: fonts/SourceSerif4-Italic.ttf
style: italic
# - asset: fonts/Schyler-Italic.ttf # - asset: fonts/Schyler-Italic.ttf
# style: italic # style: italic
# - family: Trajan Pro # - family: Trajan Pro