Compare commits
No commits in common. "6415617f17fcc029102fe34c6b2e48cb66449e66" and "f51836649a9b8b980164cbec42b2101598a15971" have entirely different histories.
6415617f17
...
f51836649a
|
@ -97,6 +97,7 @@
|
|||
BA275946E6DD86B40F4D9856 /* Pods-RunnerTests.release.xcconfig */,
|
||||
B68D6BBDE2D7389DD16E4C35 /* Pods-RunnerTests.profile.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
|
@ -670,7 +671,6 @@
|
|||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = 69ERN967NS;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
import 'dart:ui';
|
||||
|
||||
class Constants {
|
||||
static Color k2color = Color.fromARGB(255, 0, 71, 132);
|
||||
}
|
|
@ -2,8 +2,7 @@ import 'package:discover_module/custom_widget/text.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class Alert extends StatefulWidget {
|
||||
Alert({super.key, required this.data});
|
||||
String? data;
|
||||
const Alert({super.key});
|
||||
|
||||
@override
|
||||
State<Alert> createState() => _AlertState();
|
||||
|
@ -18,7 +17,7 @@ class _AlertState extends State<Alert> {
|
|||
txtfont: 22.0,
|
||||
),
|
||||
content: Text1(
|
||||
title: widget.data!,
|
||||
title: "User Added Successfully",
|
||||
txtfont: 18.0,
|
||||
),
|
||||
actions: [
|
||||
|
|
|
@ -81,7 +81,7 @@ class _MyAppState extends State<MyApp> {
|
|||
backgroundColor: Color.fromARGB(255, 0, 71, 132),
|
||||
foregroundColor: Colors.white //here you can give the text color
|
||||
)),
|
||||
home: const MyHomePage(title: 'Discover Module'),
|
||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
colorFilter:
|
||||
const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
centerTitle: false,
|
||||
bottom: const TabBar(
|
||||
indicatorColor: Colors.white,
|
||||
labelColor: Colors.white,
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
import 'dart:math';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ScaleSize {
|
||||
static double textScaleFactor(BuildContext context,
|
||||
{double maxTextScaleFactor = 2}) {
|
||||
final width = MediaQuery.of(context).size.width;
|
||||
double val = (width / 1400) * maxTextScaleFactor;
|
||||
return max(1, min(val, maxTextScaleFactor));
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:discover_module/custom_widget/elevation_btn.dart';
|
||||
import 'package:discover_module/custom_widget/show_alert.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
|
@ -35,180 +34,179 @@ class _FiltersState extends State<Filters> {
|
|||
checkwidth = MediaQuery.of(context).size.width * 0.95;
|
||||
}
|
||||
|
||||
return ListView(
|
||||
children: <Widget>[
|
||||
// DrawerHeader removed
|
||||
ListTile(
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.filter_alt,
|
||||
size: 30.0,
|
||||
),
|
||||
const Text(
|
||||
"Filters",
|
||||
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
// print("hiii");
|
||||
},
|
||||
child: const Icon(Icons.cancel))
|
||||
],
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
// DrawerHeader removed
|
||||
ListTile(
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.filter_alt,
|
||||
size: 30.0,
|
||||
),
|
||||
const Text(
|
||||
"Filters",
|
||||
style:
|
||||
TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
// print("hiii");
|
||||
},
|
||||
child: const Icon(Icons.cancel))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
ListTile(
|
||||
title: Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: Colors.grey),
|
||||
),
|
||||
child: DropdownButtonFormField<String>(
|
||||
decoration: const InputDecoration.collapsed(hintText: ''),
|
||||
value: _selectedItem,
|
||||
onChanged: (String? value) {
|
||||
setState(() {
|
||||
_selectedItem = value;
|
||||
});
|
||||
},
|
||||
items: <String>[
|
||||
'Ivoclar EU Staging',
|
||||
'Cardiology',
|
||||
'CYTK_EU',
|
||||
'Otolaryngology'
|
||||
].map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value),
|
||||
);
|
||||
}).toList(),
|
||||
hint: const Text('Select an Project Scope'),
|
||||
isExpanded: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: TextField(
|
||||
controller: txt1,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
labelText: 'Keyword',
|
||||
isDense: false,
|
||||
contentPadding: const EdgeInsets.all(3),
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: TextField(
|
||||
controller: txt2,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
labelText: 'Drugs',
|
||||
isDense: false,
|
||||
contentPadding: const EdgeInsets.all(3), // Added this
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(9.0),
|
||||
ListTile(
|
||||
title: Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: Colors.grey),
|
||||
),
|
||||
child: DropdownButtonFormField<String>(
|
||||
decoration: const InputDecoration.collapsed(hintText: ''),
|
||||
value: _selectedItem1,
|
||||
value: _selectedItem,
|
||||
onChanged: (String? value) {
|
||||
setState(() {
|
||||
_selectedItem1 = value;
|
||||
_selectedItem = value;
|
||||
});
|
||||
},
|
||||
items: <String>['Tag', 'Specialities', 'Country', 'Region']
|
||||
.map<DropdownMenuItem<String>>((String value) {
|
||||
items: <String>[
|
||||
'Ivoclar EU Staging',
|
||||
'Cardiology',
|
||||
'CYTK_EU',
|
||||
'Otolaryngology'
|
||||
].map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value),
|
||||
);
|
||||
}).toList(),
|
||||
hint: const Text('Select an Filter'),
|
||||
hint: const Text('Select an Project Scope'),
|
||||
isExpanded: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: SizedBox(
|
||||
width: checkwidth,
|
||||
child: DropdownMenu(
|
||||
// width: MediaQuery.of(context).size.width * 0.95,
|
||||
// width: MediaQuery.of(context).size.width * 0.90,
|
||||
width: checkwidth,
|
||||
|
||||
// width: 340.0,
|
||||
requestFocusOnTap: true,
|
||||
hintText: "Select text",
|
||||
enableFilter: true,
|
||||
onSelected: (color) {
|
||||
if (color != null) {
|
||||
setState(() {
|
||||
// _themeColor =color;
|
||||
});
|
||||
}
|
||||
},
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
isDense: false,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
constraints: BoxConstraints.tight(const Size.fromHeight(45)),
|
||||
ListTile(
|
||||
title: TextField(
|
||||
controller: txt1,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
labelText: 'Keyword',
|
||||
isDense: false,
|
||||
contentPadding: const EdgeInsets.all(3),
|
||||
),
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
dropdownMenuEntries: <DropdownMenuEntry<Color>>[
|
||||
const DropdownMenuEntry(
|
||||
value: Colors.white, label: 'Cardiovascular Disease'),
|
||||
const DropdownMenuEntry(
|
||||
value: Colors.red, label: 'Interventional Cardiology'),
|
||||
const DropdownMenuEntry(
|
||||
value: Colors.pinkAccent, label: 'Oncology'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: TextField(
|
||||
controller: txt2,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
labelText: 'Drugs',
|
||||
isDense: false,
|
||||
contentPadding: const EdgeInsets.all(3), // Added this
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(9.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: Colors.grey),
|
||||
),
|
||||
child: DropdownButtonFormField<String>(
|
||||
decoration: const InputDecoration.collapsed(hintText: ''),
|
||||
value: _selectedItem1,
|
||||
onChanged: (String? value) {
|
||||
setState(() {
|
||||
_selectedItem1 = value;
|
||||
});
|
||||
},
|
||||
items: <String>['Tag', 'Specialities', 'Country', 'Region']
|
||||
.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value),
|
||||
);
|
||||
}).toList(),
|
||||
hint: const Text('Select an Filter'),
|
||||
isExpanded: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: SizedBox(
|
||||
width: checkwidth,
|
||||
child: DropdownMenu(
|
||||
// width: MediaQuery.of(context).size.width * 0.95,
|
||||
// width: MediaQuery.of(context).size.width * 0.90,
|
||||
width: checkwidth,
|
||||
|
||||
ListTile(
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(left: 40.0, right: 40.0),
|
||||
child: ElevationBtn(
|
||||
onPressed: () {
|
||||
print(_selectedItem);
|
||||
// width: 340.0,
|
||||
requestFocusOnTap: true,
|
||||
hintText: "Select text",
|
||||
enableFilter: true,
|
||||
onSelected: (color) {
|
||||
if (color != null) {
|
||||
setState(() {
|
||||
// _themeColor =color;
|
||||
});
|
||||
}
|
||||
},
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
isDense: false,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
constraints: BoxConstraints.tight(const Size.fromHeight(45)),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
dropdownMenuEntries: <DropdownMenuEntry<Color>>[
|
||||
const DropdownMenuEntry(
|
||||
value: Colors.white, label: 'Cardiovascular Disease'),
|
||||
const DropdownMenuEntry(
|
||||
value: Colors.red, label: 'Interventional Cardiology'),
|
||||
const DropdownMenuEntry(
|
||||
value: Colors.pinkAccent, label: 'Oncology'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
print(_selectedItem1);
|
||||
print(selectedColor);
|
||||
print("Txt1 : ${txt1.text}");
|
||||
print("Txt2 ${txt2.text}");
|
||||
// Respond to button press
|
||||
ListTile(
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(left: 40.0, right: 40.0),
|
||||
child: ElevationBtn(
|
||||
onPressed: () {
|
||||
print(_selectedItem);
|
||||
|
||||
print(_selectedItem1);
|
||||
print(selectedColor);
|
||||
print("Txt1 : ${txt1.text}");
|
||||
print("Txt2 ${txt2.text}");
|
||||
// Respond to button press
|
||||
|
||||
if (_selectedItem != null ||
|
||||
selectedColor != null ||
|
||||
txt1.text.isNotEmpty ||
|
||||
txt2.text.isNotEmpty) {
|
||||
HiveFunctions1.createUser({
|
||||
"name": _selectedItem,
|
||||
"name1": _selectedItem1,
|
||||
|
@ -220,56 +218,50 @@ class _FiltersState extends State<Filters> {
|
|||
setState(() {
|
||||
shouldDisplay = !shouldDisplay;
|
||||
});
|
||||
} else {
|
||||
print("Iam else");
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return Alert(data: "Please select the Filter");
|
||||
});
|
||||
}
|
||||
},
|
||||
text: "ADD",
|
||||
color: const Color.fromARGB(255, 0, 71, 132),
|
||||
textcolor: Colors.white,
|
||||
},
|
||||
text: "ADD",
|
||||
color: Color.fromARGB(255, 0, 71, 132),
|
||||
textcolor: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: HiveFunctions1.getAllUsers().length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var data = HiveFunctions1.getAllUsers()[index];
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: HiveFunctions1.getAllUsers().length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var data = HiveFunctions1.getAllUsers()[index];
|
||||
|
||||
// return Text("Data_isssss: ${data["name"]}");
|
||||
// return Text("Data_isssss: ${data["name"]}");
|
||||
|
||||
return ListTile(
|
||||
title: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(data["name"],
|
||||
style: const TextStyle(
|
||||
fontSize: 21.0, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
),
|
||||
subtitle: Column(
|
||||
children: [
|
||||
Text(data["name1"],
|
||||
style: const TextStyle(
|
||||
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||
Text(data["name2"],
|
||||
style: const TextStyle(
|
||||
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||
Text(data["name3"],
|
||||
style: const TextStyle(
|
||||
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
return ListTile(
|
||||
title: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(data["name"],
|
||||
style: const TextStyle(
|
||||
fontSize: 21.0, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
),
|
||||
subtitle: Column(
|
||||
children: [
|
||||
Text(data["name1"],
|
||||
style: const TextStyle(
|
||||
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||
Text(data["name2"],
|
||||
style: const TextStyle(
|
||||
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||
Text(data["name3"],
|
||||
style: const TextStyle(
|
||||
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:discover_module/constants.dart';
|
||||
import 'package:discover_module/textScalar.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';
|
||||
|
@ -112,7 +110,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
style: TextStyle(
|
||||
fontSize: isTablet ? 22 : 14, color: Colors.white),
|
||||
),
|
||||
// backgroundColor: const Color(0xFF2b9af3),
|
||||
backgroundColor: const Color(0xFF2b9af3),
|
||||
automaticallyImplyLeading: false,
|
||||
actions: [saveActions(provider)],
|
||||
leading: InkWell(
|
||||
|
@ -151,9 +149,9 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
// height: double.infinity,
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
// color: Color(0xFF2b9af3),
|
||||
color: Constants.k2color),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF2b9af3),
|
||||
),
|
||||
child: Text(
|
||||
item.sectionName,
|
||||
style: const TextStyle(
|
||||
|
@ -201,24 +199,14 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
child: GridView.count(
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
// crossAxisCount:
|
||||
// context.responsive<int>(
|
||||
// 1,
|
||||
// sm: 1, // small
|
||||
// md: 1, // medium
|
||||
// lg: sectionList.length == 1
|
||||
// ? 1
|
||||
// : 4, // large
|
||||
// xl: 3, // extra large screen
|
||||
// ),
|
||||
crossAxisCount:
|
||||
context.responsive<int>(
|
||||
1,
|
||||
sm: 1, // small
|
||||
md: 2, // medium
|
||||
md: 1, // medium
|
||||
lg: sectionList.length == 1
|
||||
? 1
|
||||
: 3, // large
|
||||
: 4, // large
|
||||
xl: 3, // extra large screen
|
||||
),
|
||||
mainAxisSpacing:
|
||||
|
@ -228,24 +216,14 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
: 3.5,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
// childAspectRatio:
|
||||
// sectionList.length == 1 ||
|
||||
// !isTablet
|
||||
// ? orientation ==
|
||||
// Orientation.landscape
|
||||
// ? 10
|
||||
// : 3.8
|
||||
// : 2.4,
|
||||
|
||||
childAspectRatio:
|
||||
sectionList.length == 1
|
||||
sectionList.length == 1 ||
|
||||
!isTablet
|
||||
? orientation ==
|
||||
Orientation.landscape
|
||||
? 10
|
||||
: 4.8
|
||||
: isTablet
|
||||
? 3.6
|
||||
: 3.0,
|
||||
: 3.8
|
||||
: 2.4,
|
||||
children: List.generate(
|
||||
sectionList.length,
|
||||
(i) {
|
||||
|
@ -465,27 +443,20 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
},
|
||||
),
|
||||
)
|
||||
: Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||||
child: SizedBox(
|
||||
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
||||
height: isTablet ? 50 : 40,
|
||||
child: InteractionTextField(
|
||||
maxchars: int.parse(sectionItem.chars ?? "0"),
|
||||
controller: sectionItem.controller!,
|
||||
inputType: sectionItem.input == "number"
|
||||
? TextInputType.number
|
||||
: TextInputType.name,
|
||||
labelText: sectionItem.name,
|
||||
onChanged: (val) {
|
||||
sectionItem.selectedValue = [];
|
||||
provider.setTextValue(val, sectionItem, multiple);
|
||||
},
|
||||
),
|
||||
),
|
||||
: SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
height: isTablet ? 50 : 40,
|
||||
child: InteractionTextField(
|
||||
maxchars: int.parse(sectionItem.chars ?? "0"),
|
||||
controller: sectionItem.controller!,
|
||||
inputType: sectionItem.input == "number"
|
||||
? TextInputType.number
|
||||
: TextInputType.name,
|
||||
labelText: sectionItem.name,
|
||||
onChanged: (val) {
|
||||
sectionItem.selectedValue = [];
|
||||
provider.setTextValue(val, sectionItem, multiple);
|
||||
},
|
||||
),
|
||||
);
|
||||
case InteractionWidget.DROPDOWN:
|
||||
|
@ -495,9 +466,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
|
||||
Widget buildDateWidget(SectionList sectionItem) {
|
||||
return SizedBox(
|
||||
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
height: isTablet ? 50 : 40,
|
||||
child: TextField(
|
||||
controller:
|
||||
|
@ -577,69 +546,59 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
List<InputClass> list = provider.getData2(sectionItem);
|
||||
// .map((itemWord) => InputClass.fromJson(itemWord))
|
||||
// .toList();
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||||
child: SizedBox(
|
||||
// width: isTablet ? 250 : MediaQuery.of(context).size.width,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
for (InputClass value in list)
|
||||
Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: value.name,
|
||||
activeColor: Colors.black,
|
||||
groupValue: provider.radioValue,
|
||||
onChanged: (String? value) {
|
||||
setState(() {
|
||||
// print(value);
|
||||
provider.radioValue = value!;
|
||||
int index =
|
||||
list.indexWhere((element) => element.name == value);
|
||||
sectionItem.selectedValue!.add(list[index].id);
|
||||
});
|
||||
},
|
||||
),
|
||||
Text(value.name),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
return SizedBox(
|
||||
width: isTablet ? 250 : MediaQuery.of(context).size.width,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
for (InputClass value in list)
|
||||
Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: value.name,
|
||||
activeColor: Colors.black,
|
||||
groupValue: provider.radioValue,
|
||||
onChanged: (String? value) {
|
||||
setState(() {
|
||||
// print(value);
|
||||
provider.radioValue = value!;
|
||||
int index =
|
||||
list.indexWhere((element) => element.name == value);
|
||||
sectionItem.selectedValue!.add(list[index].id);
|
||||
});
|
||||
},
|
||||
),
|
||||
Text(value.name),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildCheckbox(SectionList sectionItem, String sectionName,
|
||||
ViewInteractionProvider provider, bool multiple) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||||
child: SizedBox(
|
||||
// width: 250,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
for (var value in provider.checkboxlist)
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: value.ischecked ?? false,
|
||||
activeColor: Colors.black,
|
||||
checkColor: Colors.white,
|
||||
onChanged: (bool? newvalue) {
|
||||
value.ischecked = newvalue!;
|
||||
provider.setcheckBoxValue(sectionItem, sectionName,
|
||||
newvalue, value.id, multiple);
|
||||
//setState(() {});
|
||||
},
|
||||
),
|
||||
Text(value.name),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
return SizedBox(
|
||||
width: 250,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
for (var value in provider.checkboxlist)
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: value.ischecked ?? false,
|
||||
activeColor: Colors.black,
|
||||
checkColor: Colors.white,
|
||||
onChanged: (bool? newvalue) {
|
||||
value.ischecked = newvalue!;
|
||||
provider.setcheckBoxValue(
|
||||
sectionItem, sectionName, newvalue, value.id, multiple);
|
||||
//setState(() {});
|
||||
},
|
||||
),
|
||||
Text(value.name),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -657,85 +616,80 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
sectionItem.selectedObject = list[0];
|
||||
}
|
||||
// InputClass selectedObj = list[0];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||||
child: SizedBox(
|
||||
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
// height: isTablet ? 60 : 40,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
||||
child: DropdownButtonFormField2<InputClass>(
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
// Add Horizontal padding using menuItemStyleData.padding so it matches
|
||||
// the menu padding when button's width is not specified.
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 5),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
// Add more decoration..
|
||||
return SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
height: isTablet ? 60 : 40,
|
||||
child: DropdownButtonFormField2<InputClass>(
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
// Add Horizontal padding using menuItemStyleData.padding so it matches
|
||||
// the menu padding when button's width is not specified.
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 5),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
hint: Text(
|
||||
'Select ${sectionItem.name}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
items: list
|
||||
.map((item) => DropdownMenuItem<InputClass>(
|
||||
value: item,
|
||||
child: Text(
|
||||
item.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
// Add more decoration..
|
||||
),
|
||||
hint: Text(
|
||||
'Select ${sectionItem.name}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
items: list
|
||||
.map((item) => DropdownMenuItem<InputClass>(
|
||||
value: item,
|
||||
child: Text(
|
||||
item.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
value: sectionItem.selectedValue!.isNotEmpty
|
||||
? list[list.indexWhere(
|
||||
(element) => element.id == sectionItem.selectedValue!.last,
|
||||
)]
|
||||
: list[0],
|
||||
// // provider.getDropDownValue(sectionItem.value!, sectionItem, list)
|
||||
// sectionItem.value ?? list[0].name,
|
||||
validator: (value) {
|
||||
if (value == null) {
|
||||
return 'Please select ${sectionItem.name}';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onChanged: (value) {
|
||||
//Do something when selected item is changed.
|
||||
sectionItem.selectedObject = value!;
|
||||
sectionItem.value = value.id;
|
||||
provider.setDropDownValue(value.id, sectionItem, multiple, value);
|
||||
print("selected ${sectionItem.value}");
|
||||
// setState(() {});
|
||||
},
|
||||
onSaved: (value) {
|
||||
sectionItem.selectedObject = value!;
|
||||
sectionItem.value = value.id;
|
||||
provider.setDropDownValue(value.id, sectionItem, multiple, value);
|
||||
// setState(() {});
|
||||
},
|
||||
buttonStyleData: const ButtonStyleData(
|
||||
padding: EdgeInsets.only(right: 8),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
value: sectionItem.selectedValue!.isNotEmpty
|
||||
? list[list.indexWhere(
|
||||
(element) => element.id == sectionItem.selectedValue!.last,
|
||||
)]
|
||||
: list[0],
|
||||
// // provider.getDropDownValue(sectionItem.value!, sectionItem, list)
|
||||
// sectionItem.value ?? list[0].name,
|
||||
validator: (value) {
|
||||
if (value == null) {
|
||||
return 'Please select ${sectionItem.name}';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onChanged: (value) {
|
||||
//Do something when selected item is changed.
|
||||
sectionItem.selectedObject = value!;
|
||||
sectionItem.value = value.id;
|
||||
provider.setDropDownValue(value.id, sectionItem, multiple, value);
|
||||
print("selected ${sectionItem.value}");
|
||||
// setState(() {});
|
||||
},
|
||||
onSaved: (value) {
|
||||
sectionItem.selectedObject = value!;
|
||||
sectionItem.value = value.id;
|
||||
provider.setDropDownValue(value.id, sectionItem, multiple, value);
|
||||
// setState(() {});
|
||||
},
|
||||
buttonStyleData: const ButtonStyleData(
|
||||
padding: EdgeInsets.only(right: 8),
|
||||
),
|
||||
iconStyleData: const IconStyleData(
|
||||
icon: Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: Colors.black45,
|
||||
),
|
||||
iconStyleData: const IconStyleData(
|
||||
icon: Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: Colors.black45,
|
||||
),
|
||||
iconSize: 24,
|
||||
),
|
||||
dropdownStyleData: DropdownStyleData(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
),
|
||||
menuItemStyleData: const MenuItemStyleData(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
iconSize: 24,
|
||||
),
|
||||
dropdownStyleData: DropdownStyleData(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
),
|
||||
menuItemStyleData: const MenuItemStyleData(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -747,109 +701,104 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
list = sectionItem.inputList!;
|
||||
}
|
||||
//InputClass selectedObj = list[0];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||||
child: SizedBox(
|
||||
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
// height: isTablet ? 60 : 40,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButtonFormField2<InputClass>(
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
// Add Horizontal padding using menuItemStyleData.padding so it matches
|
||||
// the menu padding when button's width is not specified.
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 5),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
// Add more decoration..
|
||||
return SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
height: isTablet ? 60 : 40,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButtonFormField2<InputClass>(
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
// Add Horizontal padding using menuItemStyleData.padding so it matches
|
||||
// the menu padding when button's width is not specified.
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 5),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
hint: Text(
|
||||
'Select Item',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).hintColor,
|
||||
),
|
||||
// Add more decoration..
|
||||
),
|
||||
hint: Text(
|
||||
'Select Item',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).hintColor,
|
||||
),
|
||||
items: list
|
||||
.map((item) => DropdownMenuItem(
|
||||
value: item,
|
||||
child: Text(
|
||||
item.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
items: list
|
||||
.map((item) => DropdownMenuItem(
|
||||
value: item,
|
||||
child: Text(
|
||||
item.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
value: sectionItem.selectedObject,
|
||||
onSaved: (value) {
|
||||
sectionItem.selectedObject = value!;
|
||||
provider.setAutoCompleteValue(value.id, sectionItem, multiple);
|
||||
sectionItem.value = value.name;
|
||||
},
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
sectionItem.selectedObject = value!;
|
||||
provider.setAutoCompleteValue(value.id, sectionItem, multiple);
|
||||
sectionItem.value = value.name;
|
||||
// setState(() {});
|
||||
//});
|
||||
},
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
value: sectionItem.selectedObject,
|
||||
onSaved: (value) {
|
||||
sectionItem.selectedObject = value!;
|
||||
provider.setAutoCompleteValue(value.id, sectionItem, multiple);
|
||||
sectionItem.value = value.name;
|
||||
},
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
sectionItem.selectedObject = value!;
|
||||
provider.setAutoCompleteValue(value.id, sectionItem, multiple);
|
||||
sectionItem.value = value.name;
|
||||
// setState(() {});
|
||||
//});
|
||||
},
|
||||
|
||||
buttonStyleData: const ButtonStyleData(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
height: 40,
|
||||
width: 200,
|
||||
),
|
||||
dropdownStyleData: const DropdownStyleData(
|
||||
maxHeight: 200,
|
||||
),
|
||||
menuItemStyleData: const MenuItemStyleData(
|
||||
height: 40,
|
||||
),
|
||||
dropdownSearchData: DropdownSearchData(
|
||||
searchController: textEditingController,
|
||||
searchInnerWidgetHeight: 50,
|
||||
searchInnerWidget: Container(
|
||||
height: 50,
|
||||
padding: const EdgeInsets.only(
|
||||
top: 8,
|
||||
bottom: 4,
|
||||
right: 8,
|
||||
left: 8,
|
||||
),
|
||||
child: TextFormField(
|
||||
expands: true,
|
||||
maxLines: null,
|
||||
controller: textEditingController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 8,
|
||||
),
|
||||
hintText: 'Search for an item...',
|
||||
hintStyle: const TextStyle(fontSize: 12),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
buttonStyleData: const ButtonStyleData(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
height: 40,
|
||||
width: 200,
|
||||
),
|
||||
dropdownStyleData: const DropdownStyleData(
|
||||
maxHeight: 200,
|
||||
),
|
||||
menuItemStyleData: const MenuItemStyleData(
|
||||
height: 40,
|
||||
),
|
||||
dropdownSearchData: DropdownSearchData(
|
||||
searchController: textEditingController,
|
||||
searchInnerWidgetHeight: 50,
|
||||
searchInnerWidget: Container(
|
||||
height: 50,
|
||||
padding: const EdgeInsets.only(
|
||||
top: 8,
|
||||
bottom: 4,
|
||||
right: 8,
|
||||
left: 8,
|
||||
),
|
||||
child: TextFormField(
|
||||
expands: true,
|
||||
maxLines: null,
|
||||
controller: textEditingController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 8,
|
||||
),
|
||||
hintText: 'Search for an item...',
|
||||
hintStyle: const TextStyle(fontSize: 12),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
),
|
||||
searchMatchFn: (item, searchValue) {
|
||||
return item.value!.name.toString().contains(searchValue);
|
||||
},
|
||||
),
|
||||
//This to clear the search value when you close the menu
|
||||
onMenuStateChange: (isOpen) {
|
||||
if (!isOpen) {
|
||||
textEditingController.clear();
|
||||
}
|
||||
searchMatchFn: (item, searchValue) {
|
||||
return item.value!.name.toString().contains(searchValue);
|
||||
},
|
||||
),
|
||||
//This to clear the search value when you close the menu
|
||||
onMenuStateChange: (isOpen) {
|
||||
if (!isOpen) {
|
||||
textEditingController.clear();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -862,117 +811,112 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
}
|
||||
InputClass selectedObj = list[0];
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||||
child: SizedBox(
|
||||
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
// height: isTablet ? 60 : 40,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButtonFormField2<InputClass>(
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
// Add Horizontal padding using menuItemStyleData.padding so it matches
|
||||
// the menu padding when button's width is not specified.
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 5),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
// Add more decoration..
|
||||
return SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
height: isTablet ? 60 : 40,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButtonFormField2<InputClass>(
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
// Add Horizontal padding using menuItemStyleData.padding so it matches
|
||||
// the menu padding when button's width is not specified.
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 5),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
hint: Text(
|
||||
'Select Items',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).hintColor,
|
||||
),
|
||||
// Add more decoration..
|
||||
),
|
||||
hint: Text(
|
||||
'Select Items',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).hintColor,
|
||||
),
|
||||
items: list.map((item) {
|
||||
return DropdownMenuItem(
|
||||
value: item,
|
||||
//disable default onTap to avoid closing menu when selecting an item
|
||||
enabled: false,
|
||||
child: StatefulBuilder(
|
||||
builder: (context, menuSetState) {
|
||||
final isSelected =
|
||||
sectionItem.selectedValue!.contains(item.name);
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
isSelected
|
||||
? sectionItem.selectedValue!.remove(item.name)
|
||||
: sectionItem.selectedValue!.add(item.name);
|
||||
//This rebuilds the StatefulWidget to update the button's text
|
||||
setState(() {});
|
||||
//This rebuilds the dropdownMenu Widget to update the check mark
|
||||
menuSetState(() {});
|
||||
},
|
||||
child: Container(
|
||||
height: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Row(
|
||||
children: [
|
||||
if (isSelected)
|
||||
const Icon(Icons.check_box_outlined)
|
||||
else
|
||||
const Icon(Icons.check_box_outline_blank),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
items: list.map((item) {
|
||||
return DropdownMenuItem(
|
||||
value: item,
|
||||
//disable default onTap to avoid closing menu when selecting an item
|
||||
enabled: false,
|
||||
child: StatefulBuilder(
|
||||
builder: (context, menuSetState) {
|
||||
final isSelected =
|
||||
sectionItem.selectedValue!.contains(item.name);
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
isSelected
|
||||
? sectionItem.selectedValue!.remove(item.name)
|
||||
: sectionItem.selectedValue!.add(item.name);
|
||||
//This rebuilds the StatefulWidget to update the button's text
|
||||
setState(() {});
|
||||
//This rebuilds the dropdownMenu Widget to update the check mark
|
||||
menuSetState(() {});
|
||||
},
|
||||
child: Container(
|
||||
height: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Row(
|
||||
children: [
|
||||
if (isSelected)
|
||||
const Icon(Icons.check_box_outlined)
|
||||
else
|
||||
const Icon(Icons.check_box_outline_blank),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
//Use last selected item as the current value so if we've limited menu height, it scroll to last item.
|
||||
value: selectedObj,
|
||||
// ? null
|
||||
// : provider.selectedItems.last,
|
||||
onChanged: (value) {
|
||||
selectedObj = value!;
|
||||
provider.setAutoCompleteValue(value.id, sectionItem, multiple);
|
||||
sectionItem.value = value.name;
|
||||
},
|
||||
onSaved: (value) {
|
||||
selectedObj = value!;
|
||||
provider.setAutoCompleteValue(value.id, sectionItem, multiple);
|
||||
sectionItem.value = value.name;
|
||||
},
|
||||
selectedItemBuilder: (context) {
|
||||
return list.map(
|
||||
(item) {
|
||||
return Container(
|
||||
alignment: AlignmentDirectional.center,
|
||||
child: Text(
|
||||
sectionItem.selectedValue!.join(', '),
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
maxLines: 1,
|
||||
),
|
||||
);
|
||||
},
|
||||
).toList();
|
||||
},
|
||||
buttonStyleData: const ButtonStyleData(
|
||||
padding: EdgeInsets.only(left: 16, right: 8),
|
||||
height: 40,
|
||||
width: 140,
|
||||
),
|
||||
menuItemStyleData: const MenuItemStyleData(
|
||||
height: 40,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
//Use last selected item as the current value so if we've limited menu height, it scroll to last item.
|
||||
value: selectedObj,
|
||||
// ? null
|
||||
// : provider.selectedItems.last,
|
||||
onChanged: (value) {
|
||||
selectedObj = value!;
|
||||
provider.setAutoCompleteValue(value.id, sectionItem, multiple);
|
||||
sectionItem.value = value.name;
|
||||
},
|
||||
onSaved: (value) {
|
||||
selectedObj = value!;
|
||||
provider.setAutoCompleteValue(value.id, sectionItem, multiple);
|
||||
sectionItem.value = value.name;
|
||||
},
|
||||
selectedItemBuilder: (context) {
|
||||
return list.map(
|
||||
(item) {
|
||||
return Container(
|
||||
alignment: AlignmentDirectional.center,
|
||||
child: Text(
|
||||
sectionItem.selectedValue!.join(', '),
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
maxLines: 1,
|
||||
),
|
||||
);
|
||||
},
|
||||
).toList();
|
||||
},
|
||||
buttonStyleData: const ButtonStyleData(
|
||||
padding: EdgeInsets.only(left: 16, right: 8),
|
||||
height: 40,
|
||||
width: 140,
|
||||
),
|
||||
menuItemStyleData: const MenuItemStyleData(
|
||||
height: 40,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:discover_module/constants.dart';
|
||||
import 'package:discover_module/ui_screen/add_event/add_hcp.dart';
|
||||
import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart';
|
||||
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||
|
@ -80,7 +79,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
// backgroundColor: const Color(0xFF2b9af3),
|
||||
backgroundColor: const Color(0xFF2b9af3),
|
||||
automaticallyImplyLeading: false,
|
||||
actions: [saveActions(provider)],
|
||||
leading: InkWell(
|
||||
|
@ -116,9 +115,8 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
// height: double.infinity,
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
// color: Color(0xFF2b9af3),
|
||||
color: Constants.k2color,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF2b9af3),
|
||||
),
|
||||
child: Text(
|
||||
item.sectionName,
|
||||
|
@ -580,55 +578,43 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: CustomButton(
|
||||
backgroundColor: Colors.red.shade800,
|
||||
onPressed: () {
|
||||
//showDeleteProfileAlertDialog(context);
|
||||
for (var textcontrollers
|
||||
in provider.textEditingControllerList) {
|
||||
textcontrollers.text = '';
|
||||
}
|
||||
CustomButton(
|
||||
backgroundColor: Colors.red.shade800,
|
||||
onPressed: () {
|
||||
//showDeleteProfileAlertDialog(context);
|
||||
for (var textcontrollers in provider.textEditingControllerList) {
|
||||
textcontrollers.text = '';
|
||||
}
|
||||
|
||||
// setState(() {
|
||||
// provider.resetAllWidgetsData();
|
||||
// });
|
||||
},
|
||||
textColor: Colors.white,
|
||||
title: "Reset",
|
||||
// height: 40,
|
||||
// width: isTablet ? 100 : 80,
|
||||
height: MediaQuery.of(context).size.height * 0.2,
|
||||
|
||||
fontsize: isTablet ? 15 : 10.2,
|
||||
),
|
||||
// setState(() {
|
||||
// provider.resetAllWidgetsData();
|
||||
// });
|
||||
},
|
||||
textColor: Colors.white,
|
||||
title: "Reset",
|
||||
height: 40,
|
||||
width: isTablet ? 100 : 80,
|
||||
fontsize: isTablet ? 15 : 10.2,
|
||||
),
|
||||
SizedBox(
|
||||
width: isTablet ? 20 : 4,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: CustomButton(
|
||||
backgroundColor: Colors.green.shade500,
|
||||
onPressed: () async {
|
||||
if (textFieldsValidation(provider).isEmpty) {
|
||||
String record =
|
||||
await provider.saveJsonObject(context, widget.form);
|
||||
showAlertDialog(context, record);
|
||||
} else {
|
||||
_displaySnackBar(textFieldsValidation(provider));
|
||||
}
|
||||
},
|
||||
textColor: Colors.white,
|
||||
title: "Save",
|
||||
// height: 40,
|
||||
// width: isTablet ? 100 : 80,
|
||||
height: MediaQuery.of(context).size.height * 0.2,
|
||||
|
||||
// width: MediaQuery.of(context).size.width * 0.1,
|
||||
fontsize: isTablet ? 16 : 12,
|
||||
),
|
||||
CustomButton(
|
||||
backgroundColor: Colors.green.shade900,
|
||||
onPressed: () async {
|
||||
if (textFieldsValidation(provider).isEmpty) {
|
||||
String record =
|
||||
await provider.saveJsonObject(context, widget.form);
|
||||
showAlertDialog(context, record);
|
||||
} else {
|
||||
_displaySnackBar(textFieldsValidation(provider));
|
||||
}
|
||||
},
|
||||
textColor: Colors.white,
|
||||
title: "Save",
|
||||
height: 40,
|
||||
width: isTablet ? 100 : 80,
|
||||
fontsize: isTablet ? 16 : 12,
|
||||
),
|
||||
SizedBox(
|
||||
width: isTablet ? 20 : 2,
|
||||
|
@ -1176,14 +1162,8 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
|
||||
setState(() {});
|
||||
},
|
||||
// width: 80,
|
||||
// height: 30,
|
||||
|
||||
height: 40,
|
||||
|
||||
// height:
|
||||
// MediaQuery.of(context).size.height *
|
||||
// 0.2,
|
||||
width: 80,
|
||||
height: 30,
|
||||
fontsize: 12,
|
||||
textColor: Colors.white,
|
||||
title: "Delete"),
|
||||
|
|
|
@ -54,16 +54,7 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
|
|||
//style: TextStyle(fontSize: isTablet ? 22 : 14, color: Colors.white),
|
||||
),
|
||||
automaticallyImplyLeading: false,
|
||||
// backgroundColor: const Color(0xFF2b9af3),
|
||||
leading: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.arrow_back_ios,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: const Color(0xFF2b9af3),
|
||||
),
|
||||
body: Container(
|
||||
child: Center(
|
||||
|
|
|
@ -46,7 +46,7 @@ class _SavedFormListScreenState extends State<SavedFormListScreen> {
|
|||
style: TextStyle(fontSize: isTablet ? 22 : 14, color: Colors.white),
|
||||
),
|
||||
automaticallyImplyLeading: false,
|
||||
// backgroundColor: const Color(0xFF2b9af3),
|
||||
backgroundColor: const Color(0xFF2b9af3),
|
||||
leading: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
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';
|
||||
|
@ -59,7 +58,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
|
|||
style: TextStyle(
|
||||
fontSize: isTablet ? 22 : 14, color: Colors.white),
|
||||
),
|
||||
// backgroundColor: const Color(0xFF2b9af3),
|
||||
backgroundColor: const Color(0xFF2b9af3),
|
||||
automaticallyImplyLeading: false,
|
||||
leading: InkWell(
|
||||
onTap: () {
|
||||
|
@ -90,9 +89,8 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
|
|||
// height: double.infinity,
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
// color: Color(0xFF2b9af3),
|
||||
color: Constants.k2color,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF2b9af3),
|
||||
),
|
||||
child: Text(
|
||||
item.sectionName,
|
||||
|
@ -120,52 +118,28 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
|
|||
child: GridView.count(
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
// crossAxisCount: context.responsive<int>(
|
||||
// 1,
|
||||
// sm: 1, // small
|
||||
// md: 1, // medium
|
||||
// lg: sectionList.length == 1
|
||||
// ? 1
|
||||
// : 4, // large
|
||||
// xl: 3, // extra large screen
|
||||
// ),
|
||||
// mainAxisSpacing:
|
||||
// sectionList.length == 1 || !isTablet
|
||||
// ? 1
|
||||
// : 3.5,
|
||||
// shrinkWrap: true,
|
||||
// padding: EdgeInsets.zero,
|
||||
// childAspectRatio:
|
||||
// sectionList.length == 1 || !isTablet
|
||||
// ? orientation ==
|
||||
// Orientation.landscape
|
||||
// ? 10
|
||||
// : 3.8
|
||||
// : 2.8,
|
||||
crossAxisCount: context.responsive<int>(
|
||||
1,
|
||||
sm: 1, // small
|
||||
md: 2, // medium
|
||||
md: 1, // medium
|
||||
lg: sectionList.length == 1
|
||||
? 1
|
||||
: 3, // large
|
||||
: 4, // large
|
||||
xl: 3, // extra large screen
|
||||
),
|
||||
mainAxisSpacing:
|
||||
sectionList.length == 1 || !isTablet
|
||||
? 1
|
||||
: 3.5,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
childAspectRatio:
|
||||
sectionList.length == 1
|
||||
sectionList.length == 1 || !isTablet
|
||||
? orientation ==
|
||||
Orientation.landscape
|
||||
? 10
|
||||
: 4.8
|
||||
: isTablet
|
||||
? 2.8
|
||||
: 3.0,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
: 3.8
|
||||
: 2.8,
|
||||
children: List.generate(
|
||||
sectionList.length,
|
||||
(i) {
|
||||
|
|
|
@ -26,18 +26,10 @@ class CustomButton extends StatelessWidget {
|
|||
width: width,
|
||||
child: ElevatedButton(
|
||||
onPressed: onPressed,
|
||||
// style: ButtonStyle(
|
||||
// backgroundColor:
|
||||
// MaterialStateColor.resolveWith((states) => backgroundColor),
|
||||
// ),
|
||||
style: ElevatedButton.styleFrom(
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateColor.resolveWith((states) => backgroundColor),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10), // <-- Radius
|
||||
),
|
||||
),
|
||||
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(color: textColor, fontSize: fontsize ?? 24.0),
|
||||
|
|
|
@ -57,77 +57,53 @@ class _RankingState extends State<Ranking> {
|
|||
rowsPerPage: 5,
|
||||
columns: const [
|
||||
DataColumn(
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Name',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
label: Text('Name',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
DataColumn(
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Tier',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
label: Text('Tier',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
DataColumn(
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Rank',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
label: Text('Rank',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
DataColumn(
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Score',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
label: Text('Score',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
DataColumn(
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Event',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
label: Text('Event',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
DataColumn(
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Affliations',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
label: Text('Affliations',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
DataColumn(
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Publications',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
label: Text('Publications',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
DataColumn(
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Trails',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
label: Text('Trails',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
],
|
||||
source: _dataSource,
|
||||
),
|
||||
|
@ -164,7 +140,7 @@ class _RankingState extends State<Ranking> {
|
|||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return Alert(data: "User Added Successfully");
|
||||
return Alert();
|
||||
});
|
||||
},
|
||||
)),
|
||||
|
@ -182,47 +158,27 @@ class _RankingState extends State<Ranking> {
|
|||
// sheet.getRangeByName('A1').setText('pooja');
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
sheet.getRangeByName('A1').setText('Name');
|
||||
sheet.getRangeByName('A2').setText('Gerosa, Gino');
|
||||
sheet.getRangeByName('A3').setText('Gerosa, Gino');
|
||||
sheet.getRangeByName('A4').setText('Gerosa, Gino');
|
||||
sheet.getRangeByName('A1').setText('Name 1122334455');
|
||||
sheet.getRangeByName('A2').setText('John');
|
||||
sheet.getRangeByName('A3').setText('Ashok');
|
||||
sheet.getRangeByName('A4').setText('Vicki');
|
||||
|
||||
final Style headingStyle = workbook.styles.add('HeadingStyle');
|
||||
headingStyle.bold = true;
|
||||
headingStyle.hAlign = HAlignType.center;
|
||||
headingStyle.wrapText = true;
|
||||
sheet.getRangeByName('B1').setText('Tier');
|
||||
sheet.getRangeByName('B2').setText("Tier1");
|
||||
sheet.getRangeByName('B3').setText("Tier1");
|
||||
sheet.getRangeByName('B4').setText("Tier1");
|
||||
sheet.getRangeByName('C1').setText('Rank');
|
||||
sheet.getRangeByName('C2').setNumber(1);
|
||||
sheet.getRangeByName('C3').setNumber(1);
|
||||
sheet.getRangeByName('C4').setNumber(1);
|
||||
sheet.getRangeByName('D1').setText('Score');
|
||||
sheet.getRangeByName('D2').setNumber(0);
|
||||
sheet.getRangeByName('D3').setNumber(0);
|
||||
sheet.getRangeByName('D4').setNumber(0);
|
||||
|
||||
sheet.getRangeByName('E1').setText('Event');
|
||||
sheet.getRangeByName('E2').setNumber(0);
|
||||
sheet.getRangeByName('E3').setNumber(0);
|
||||
sheet.getRangeByName('E4').setNumber(0);
|
||||
|
||||
sheet.getRangeByName('F1').setText('Affiliations');
|
||||
sheet.getRangeByName('F2').setNumber(0);
|
||||
sheet.getRangeByName('F3').setNumber(0);
|
||||
sheet.getRangeByName('F4').setNumber(0);
|
||||
|
||||
sheet.getRangeByName('G1').setText('Publications');
|
||||
sheet.getRangeByName('G2').setNumber(0);
|
||||
sheet.getRangeByName('G3').setNumber(0);
|
||||
sheet.getRangeByName('G4').setNumber(0);
|
||||
|
||||
sheet.getRangeByName('H1').setText('Trails');
|
||||
sheet.getRangeByName('H2').setNumber(0);
|
||||
sheet.getRangeByName('H3').setNumber(0);
|
||||
sheet.getRangeByName('H4').setNumber(0);
|
||||
sheet.getRangeByName('B1').setText('Mark1');
|
||||
sheet.getRangeByName('B2').setNumber(10);
|
||||
sheet.getRangeByName('B3').setNumber(39);
|
||||
sheet.getRangeByName('B4').setNumber(25);
|
||||
sheet.getRangeByName('C1').setText('Mark2');
|
||||
sheet.getRangeByName('C2').setNumber(49);
|
||||
sheet.getRangeByName('C3').setNumber(23);
|
||||
sheet.getRangeByName('C4').setNumber(13);
|
||||
sheet.getRangeByName('D1').setText('Mark3');
|
||||
sheet.getRangeByName('D2').setNumber(24);
|
||||
sheet.getRangeByName('D3').setNumber(30);
|
||||
sheet.getRangeByName('D4').setNumber(10);
|
||||
|
||||
//Defining a global style with properties.
|
||||
final Style globalStyle = workbook.styles.add('globalStyle');
|
||||
|
@ -251,10 +207,10 @@ class _RankingState extends State<Ranking> {
|
|||
globalStyle1.numberFormat = '0.00';
|
||||
|
||||
//Apply GlobalStyle
|
||||
// sheet.getRangeByName('A1:D1').cellStyle = globalStyle;
|
||||
sheet.getRangeByName('A1:D1').cellStyle = globalStyle;
|
||||
|
||||
// //Apply GlobalStyle1
|
||||
// sheet.getRangeByName('B2:D4').cellStyle = globalStyle1;
|
||||
//Apply GlobalStyle1
|
||||
sheet.getRangeByName('B2:D4').cellStyle = globalStyle1;
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
final List<int> bytes = workbook.saveSync();
|
||||
|
|
|
@ -125,9 +125,7 @@ class RisingStarState extends State<RisingStar> {
|
|||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return Alert(
|
||||
data: "User Added Successfully",
|
||||
);
|
||||
return Alert();
|
||||
});
|
||||
},
|
||||
)),
|
||||
|
|
|
@ -100,7 +100,7 @@ class _TrendsState extends State<Trends> {
|
|||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return Alert(data: "User Added Successfully");
|
||||
return Alert();
|
||||
});
|
||||
},
|
||||
)),
|
||||
|
|
Loading…
Reference in New Issue