Suggested changes S
This commit is contained in:
parent
1dc802b0cb
commit
2d3dcfa022
|
@ -0,0 +1,5 @@
|
|||
import 'dart:ui';
|
||||
|
||||
class Constants {
|
||||
static Color k2color = Color.fromARGB(255, 0, 71, 132);
|
||||
}
|
|
@ -2,7 +2,8 @@ import 'package:discover_module/custom_widget/text.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class Alert extends StatefulWidget {
|
||||
const Alert({super.key});
|
||||
Alert({super.key, required this.data});
|
||||
String? data;
|
||||
|
||||
@override
|
||||
State<Alert> createState() => _AlertState();
|
||||
|
@ -17,7 +18,7 @@ class _AlertState extends State<Alert> {
|
|||
txtfont: 22.0,
|
||||
),
|
||||
content: Text1(
|
||||
title: "User Added Successfully",
|
||||
title: widget.data!,
|
||||
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: 'Flutter Demo Home Page'),
|
||||
home: const MyHomePage(title: 'Discover Module'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -136,6 +136,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
colorFilter:
|
||||
const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
centerTitle: false,
|
||||
bottom: const TabBar(
|
||||
indicatorColor: Colors.white,
|
||||
labelColor: Colors.white,
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
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,4 +1,5 @@
|
|||
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';
|
||||
|
@ -34,9 +35,7 @@ class _FiltersState extends State<Filters> {
|
|||
checkwidth = MediaQuery.of(context).size.width * 0.95;
|
||||
}
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: ListView(
|
||||
return ListView(
|
||||
children: <Widget>[
|
||||
// DrawerHeader removed
|
||||
ListTile(
|
||||
|
@ -51,8 +50,7 @@ class _FiltersState extends State<Filters> {
|
|||
),
|
||||
const Text(
|
||||
"Filters",
|
||||
style:
|
||||
TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
|
||||
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
|
@ -207,6 +205,10 @@ class _FiltersState extends State<Filters> {
|
|||
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,
|
||||
|
@ -218,16 +220,24 @@ 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: Color.fromARGB(255, 0, 71, 132),
|
||||
color: const Color.fromARGB(255, 0, 71, 132),
|
||||
textcolor: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: HiveFunctions1.getAllUsers().length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
|
@ -259,9 +269,7 @@ class _FiltersState extends State<Filters> {
|
|||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
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';
|
||||
|
@ -110,7 +112,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(
|
||||
|
@ -149,9 +151,9 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
// height: double.infinity,
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF2b9af3),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
// color: Color(0xFF2b9af3),
|
||||
color: Constants.k2color),
|
||||
child: Text(
|
||||
item.sectionName,
|
||||
style: const TextStyle(
|
||||
|
@ -199,14 +201,24 @@ 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: 1, // medium
|
||||
md: 2, // medium
|
||||
lg: sectionList.length == 1
|
||||
? 1
|
||||
: 4, // large
|
||||
: 3, // large
|
||||
xl: 3, // extra large screen
|
||||
),
|
||||
mainAxisSpacing:
|
||||
|
@ -216,14 +228,24 @@ 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 ||
|
||||
!isTablet
|
||||
sectionList.length == 1
|
||||
? orientation ==
|
||||
Orientation.landscape
|
||||
? 10
|
||||
: 3.8
|
||||
: 2.4,
|
||||
: 4.8
|
||||
: isTablet
|
||||
? 3.6
|
||||
: 3.0,
|
||||
children: List.generate(
|
||||
sectionList.length,
|
||||
(i) {
|
||||
|
@ -443,8 +465,13 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
},
|
||||
),
|
||||
)
|
||||
: SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
: 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"),
|
||||
|
@ -458,6 +485,8 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
provider.setTextValue(val, sectionItem, multiple);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
case InteractionWidget.DROPDOWN:
|
||||
return customdropdown(sectionItem, provider, list, multiple);
|
||||
|
@ -466,7 +495,9 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
|
||||
Widget buildDateWidget(SectionList sectionItem) {
|
||||
return SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
||||
height: isTablet ? 50 : 40,
|
||||
child: TextField(
|
||||
controller:
|
||||
|
@ -546,8 +577,12 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
List<InputClass> list = provider.getData2(sectionItem);
|
||||
// .map((itemWord) => InputClass.fromJson(itemWord))
|
||||
// .toList();
|
||||
return SizedBox(
|
||||
width: isTablet ? 250 : MediaQuery.of(context).size.width,
|
||||
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)
|
||||
|
@ -572,13 +607,18 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildCheckbox(SectionList sectionItem, String sectionName,
|
||||
ViewInteractionProvider provider, bool multiple) {
|
||||
return SizedBox(
|
||||
width: 250,
|
||||
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)
|
||||
|
@ -590,8 +630,8 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
checkColor: Colors.white,
|
||||
onChanged: (bool? newvalue) {
|
||||
value.ischecked = newvalue!;
|
||||
provider.setcheckBoxValue(
|
||||
sectionItem, sectionName, newvalue, value.id, multiple);
|
||||
provider.setcheckBoxValue(sectionItem, sectionName,
|
||||
newvalue, value.id, multiple);
|
||||
//setState(() {});
|
||||
},
|
||||
),
|
||||
|
@ -600,6 +640,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -616,9 +657,13 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
sectionItem.selectedObject = list[0];
|
||||
}
|
||||
// InputClass selectedObj = list[0];
|
||||
return SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
height: isTablet ? 60 : 40,
|
||||
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(
|
||||
|
@ -691,6 +736,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -701,9 +747,13 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
list = sectionItem.inputList!;
|
||||
}
|
||||
//InputClass selectedObj = list[0];
|
||||
return SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
height: isTablet ? 60 : 40,
|
||||
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,
|
||||
|
@ -801,6 +851,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -811,9 +862,13 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
}
|
||||
InputClass selectedObj = list[0];
|
||||
|
||||
return SizedBox(
|
||||
width: isTablet ? 200 : MediaQuery.of(context).size.width,
|
||||
height: isTablet ? 60 : 40,
|
||||
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,
|
||||
|
@ -920,6 +975,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
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';
|
||||
|
@ -79,7 +80,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
backgroundColor: const Color(0xFF2b9af3),
|
||||
// backgroundColor: const Color(0xFF2b9af3),
|
||||
automaticallyImplyLeading: false,
|
||||
actions: [saveActions(provider)],
|
||||
leading: InkWell(
|
||||
|
@ -115,8 +116,9 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
// height: double.infinity,
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF2b9af3),
|
||||
decoration: BoxDecoration(
|
||||
// color: Color(0xFF2b9af3),
|
||||
color: Constants.k2color,
|
||||
),
|
||||
child: Text(
|
||||
item.sectionName,
|
||||
|
@ -578,11 +580,14 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: CustomButton(
|
||||
backgroundColor: Colors.red.shade800,
|
||||
onPressed: () {
|
||||
//showDeleteProfileAlertDialog(context);
|
||||
for (var textcontrollers in provider.textEditingControllerList) {
|
||||
for (var textcontrollers
|
||||
in provider.textEditingControllerList) {
|
||||
textcontrollers.text = '';
|
||||
}
|
||||
|
||||
|
@ -592,15 +597,20 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
},
|
||||
textColor: Colors.white,
|
||||
title: "Reset",
|
||||
height: 40,
|
||||
width: isTablet ? 100 : 80,
|
||||
// height: 40,
|
||||
// width: isTablet ? 100 : 80,
|
||||
height: MediaQuery.of(context).size.height * 0.2,
|
||||
|
||||
fontsize: isTablet ? 15 : 10.2,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: isTablet ? 20 : 4,
|
||||
),
|
||||
CustomButton(
|
||||
backgroundColor: Colors.green.shade900,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: CustomButton(
|
||||
backgroundColor: Colors.green.shade500,
|
||||
onPressed: () async {
|
||||
if (textFieldsValidation(provider).isEmpty) {
|
||||
String record =
|
||||
|
@ -612,10 +622,14 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
},
|
||||
textColor: Colors.white,
|
||||
title: "Save",
|
||||
height: 40,
|
||||
width: isTablet ? 100 : 80,
|
||||
// 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,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: isTablet ? 20 : 2,
|
||||
),
|
||||
|
@ -1162,8 +1176,14 @@ class _InteractionScreenState extends State<InteractionScreen> {
|
|||
|
||||
setState(() {});
|
||||
},
|
||||
width: 80,
|
||||
height: 30,
|
||||
// width: 80,
|
||||
// height: 30,
|
||||
|
||||
height: 40,
|
||||
|
||||
// height:
|
||||
// MediaQuery.of(context).size.height *
|
||||
// 0.2,
|
||||
fontsize: 12,
|
||||
textColor: Colors.white,
|
||||
title: "Delete"),
|
||||
|
|
|
@ -54,7 +54,16 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
|
|||
//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);
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.arrow_back_ios,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
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,3 +1,4 @@
|
|||
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';
|
||||
|
@ -58,7 +59,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: () {
|
||||
|
@ -89,8 +90,9 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
|
|||
// height: double.infinity,
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF2b9af3),
|
||||
decoration: BoxDecoration(
|
||||
// color: Color(0xFF2b9af3),
|
||||
color: Constants.k2color,
|
||||
),
|
||||
child: Text(
|
||||
item.sectionName,
|
||||
|
@ -118,28 +120,52 @@ 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: 1, // medium
|
||||
md: 2, // medium
|
||||
lg: sectionList.length == 1
|
||||
? 1
|
||||
: 4, // large
|
||||
: 3, // large
|
||||
xl: 3, // extra large screen
|
||||
),
|
||||
mainAxisSpacing:
|
||||
sectionList.length == 1 || !isTablet
|
||||
? 1
|
||||
: 3.5,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
childAspectRatio:
|
||||
sectionList.length == 1 || !isTablet
|
||||
sectionList.length == 1
|
||||
? orientation ==
|
||||
Orientation.landscape
|
||||
? 10
|
||||
: 3.8
|
||||
: 2.8,
|
||||
: 4.8
|
||||
: isTablet
|
||||
? 2.8
|
||||
: 3.0,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
children: List.generate(
|
||||
sectionList.length,
|
||||
(i) {
|
||||
|
|
|
@ -26,10 +26,18 @@ class CustomButton extends StatelessWidget {
|
|||
width: width,
|
||||
child: ElevatedButton(
|
||||
onPressed: onPressed,
|
||||
style: ButtonStyle(
|
||||
// style: ButtonStyle(
|
||||
// backgroundColor:
|
||||
// MaterialStateColor.resolveWith((states) => backgroundColor),
|
||||
// ),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
MaterialStateColor.resolveWith((states) => backgroundColor),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10), // <-- Radius
|
||||
),
|
||||
),
|
||||
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(color: textColor, fontSize: fontsize ?? 24.0),
|
||||
|
|
|
@ -57,53 +57,77 @@ class _RankingState extends State<Ranking> {
|
|||
rowsPerPage: 5,
|
||||
columns: const [
|
||||
DataColumn(
|
||||
label: Text('Name',
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Name',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
DataColumn(
|
||||
label: Text('Tier',
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Tier',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
DataColumn(
|
||||
label: Text('Rank',
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Rank',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
DataColumn(
|
||||
label: Text('Score',
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Score',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
DataColumn(
|
||||
label: Text('Event',
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Event',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
DataColumn(
|
||||
label: Text('Affliations',
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Affliations',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
DataColumn(
|
||||
label: Text('Publications',
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Publications',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
DataColumn(
|
||||
label: Text('Trails',
|
||||
label: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text('Trails',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14.0,
|
||||
fontStyle: FontStyle.normal))),
|
||||
fontStyle: FontStyle.normal)),
|
||||
)),
|
||||
],
|
||||
source: _dataSource,
|
||||
),
|
||||
|
@ -140,7 +164,7 @@ class _RankingState extends State<Ranking> {
|
|||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return Alert();
|
||||
return Alert(data: "User Added Successfully");
|
||||
});
|
||||
},
|
||||
)),
|
||||
|
@ -158,27 +182,47 @@ class _RankingState extends State<Ranking> {
|
|||
// sheet.getRangeByName('A1').setText('pooja');
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
sheet.getRangeByName('A1').setText('Name 1122334455');
|
||||
sheet.getRangeByName('A2').setText('John');
|
||||
sheet.getRangeByName('A3').setText('Ashok');
|
||||
sheet.getRangeByName('A4').setText('Vicki');
|
||||
sheet.getRangeByName('A1').setText('Name');
|
||||
sheet.getRangeByName('A2').setText('Gerosa, Gino');
|
||||
sheet.getRangeByName('A3').setText('Gerosa, Gino');
|
||||
sheet.getRangeByName('A4').setText('Gerosa, Gino');
|
||||
|
||||
final Style headingStyle = workbook.styles.add('HeadingStyle');
|
||||
headingStyle.bold = true;
|
||||
headingStyle.hAlign = HAlignType.center;
|
||||
headingStyle.wrapText = true;
|
||||
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);
|
||||
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);
|
||||
|
||||
//Defining a global style with properties.
|
||||
final Style globalStyle = workbook.styles.add('globalStyle');
|
||||
|
@ -207,10 +251,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,7 +125,9 @@ class RisingStarState extends State<RisingStar> {
|
|||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return Alert();
|
||||
return Alert(
|
||||
data: "User Added Successfully",
|
||||
);
|
||||
});
|
||||
},
|
||||
)),
|
||||
|
|
|
@ -100,7 +100,7 @@ class _TrendsState extends State<Trends> {
|
|||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return Alert();
|
||||
return Alert(data: "User Added Successfully");
|
||||
});
|
||||
},
|
||||
)),
|
||||
|
|
Loading…
Reference in New Issue