Compare commits

..

No commits in common. "6415617f17fcc029102fe34c6b2e48cb66449e66" and "f51836649a9b8b980164cbec42b2101598a15971" have entirely different histories.

15 changed files with 625 additions and 816 deletions

View File

@ -97,6 +97,7 @@
BA275946E6DD86B40F4D9856 /* Pods-RunnerTests.release.xcconfig */, BA275946E6DD86B40F4D9856 /* Pods-RunnerTests.release.xcconfig */,
B68D6BBDE2D7389DD16E4C35 /* Pods-RunnerTests.profile.xcconfig */, B68D6BBDE2D7389DD16E4C35 /* Pods-RunnerTests.profile.xcconfig */,
); );
name = Pods;
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@ -670,7 +671,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 69ERN967NS;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (

View File

@ -1,5 +0,0 @@
import 'dart:ui';
class Constants {
static Color k2color = Color.fromARGB(255, 0, 71, 132);
}

View File

@ -2,8 +2,7 @@ import 'package:discover_module/custom_widget/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class Alert extends StatefulWidget { class Alert extends StatefulWidget {
Alert({super.key, required this.data}); const Alert({super.key});
String? data;
@override @override
State<Alert> createState() => _AlertState(); State<Alert> createState() => _AlertState();
@ -18,7 +17,7 @@ class _AlertState extends State<Alert> {
txtfont: 22.0, txtfont: 22.0,
), ),
content: Text1( content: Text1(
title: widget.data!, title: "User Added Successfully",
txtfont: 18.0, txtfont: 18.0,
), ),
actions: [ actions: [

View File

@ -81,7 +81,7 @@ class _MyAppState extends State<MyApp> {
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: const MyHomePage(title: 'Flutter Demo Home Page'),
); );
} }
} }
@ -136,7 +136,6 @@ class _MyHomePageState extends State<MyHomePage> {
colorFilter: colorFilter:
const ColorFilter.mode(Colors.white, BlendMode.srcIn), const ColorFilter.mode(Colors.white, BlendMode.srcIn),
), ),
centerTitle: false,
bottom: const TabBar( bottom: const TabBar(
indicatorColor: Colors.white, indicatorColor: Colors.white,
labelColor: Colors.white, labelColor: Colors.white,

View File

@ -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));
}
}

View File

@ -1,5 +1,4 @@
import 'package:discover_module/custom_widget/elevation_btn.dart'; 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/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
@ -35,7 +34,9 @@ class _FiltersState extends State<Filters> {
checkwidth = MediaQuery.of(context).size.width * 0.95; checkwidth = MediaQuery.of(context).size.width * 0.95;
} }
return ListView( return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: ListView(
children: <Widget>[ children: <Widget>[
// DrawerHeader removed // DrawerHeader removed
ListTile( ListTile(
@ -50,7 +51,8 @@ class _FiltersState extends State<Filters> {
), ),
const Text( const Text(
"Filters", "Filters",
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), style:
TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -205,10 +207,6 @@ class _FiltersState extends State<Filters> {
print("Txt2 ${txt2.text}"); print("Txt2 ${txt2.text}");
// Respond to button press // Respond to button press
if (_selectedItem != null ||
selectedColor != null ||
txt1.text.isNotEmpty ||
txt2.text.isNotEmpty) {
HiveFunctions1.createUser({ HiveFunctions1.createUser({
"name": _selectedItem, "name": _selectedItem,
"name1": _selectedItem1, "name1": _selectedItem1,
@ -220,24 +218,16 @@ class _FiltersState extends State<Filters> {
setState(() { setState(() {
shouldDisplay = !shouldDisplay; shouldDisplay = !shouldDisplay;
}); });
} else {
print("Iam else");
showDialog(
context: context,
builder: (_) {
return Alert(data: "Please select the Filter");
});
}
}, },
text: "ADD", text: "ADD",
color: const Color.fromARGB(255, 0, 71, 132), color: Color.fromARGB(255, 0, 71, 132),
textcolor: Colors.white, textcolor: Colors.white,
), ),
), ),
), ),
ListView.builder( Expanded(
child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
itemCount: HiveFunctions1.getAllUsers().length, itemCount: HiveFunctions1.getAllUsers().length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
@ -269,7 +259,9 @@ class _FiltersState extends State<Filters> {
), ),
); );
}), }),
),
], ],
),
); );
} }
} }

View File

@ -1,8 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; 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/interaction_data.dart';
import 'package:discover_module/ui_screen/interactionform/model/save_interaction.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/util.dart';
@ -112,7 +110,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
style: TextStyle( style: TextStyle(
fontSize: isTablet ? 22 : 14, color: Colors.white), fontSize: isTablet ? 22 : 14, color: Colors.white),
), ),
// backgroundColor: const Color(0xFF2b9af3), backgroundColor: const Color(0xFF2b9af3),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
actions: [saveActions(provider)], actions: [saveActions(provider)],
leading: InkWell( leading: InkWell(
@ -151,9 +149,9 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
// height: double.infinity, // height: double.infinity,
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: const BoxDecoration(
// color: Color(0xFF2b9af3), color: Color(0xFF2b9af3),
color: Constants.k2color), ),
child: Text( child: Text(
item.sectionName, item.sectionName,
style: const TextStyle( style: const TextStyle(
@ -201,24 +199,14 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
child: GridView.count( child: GridView.count(
physics: physics:
const NeverScrollableScrollPhysics(), 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: crossAxisCount:
context.responsive<int>( context.responsive<int>(
1, 1,
sm: 1, // small sm: 1, // small
md: 2, // medium md: 1, // medium
lg: sectionList.length == 1 lg: sectionList.length == 1
? 1 ? 1
: 3, // large : 4, // large
xl: 3, // extra large screen xl: 3, // extra large screen
), ),
mainAxisSpacing: mainAxisSpacing:
@ -228,24 +216,14 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
: 3.5, : 3.5,
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
// childAspectRatio:
// sectionList.length == 1 ||
// !isTablet
// ? orientation ==
// Orientation.landscape
// ? 10
// : 3.8
// : 2.4,
childAspectRatio: childAspectRatio:
sectionList.length == 1 sectionList.length == 1 ||
!isTablet
? orientation == ? orientation ==
Orientation.landscape Orientation.landscape
? 10 ? 10
: 4.8 : 3.8
: isTablet : 2.4,
? 3.6
: 3.0,
children: List.generate( children: List.generate(
sectionList.length, sectionList.length,
(i) { (i) {
@ -465,13 +443,8 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
}, },
), ),
) )
: Expanded( : SizedBox(
child: Padding( width: isTablet ? 200 : MediaQuery.of(context).size.width,
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, height: isTablet ? 50 : 40,
child: InteractionTextField( child: InteractionTextField(
maxchars: int.parse(sectionItem.chars ?? "0"), maxchars: int.parse(sectionItem.chars ?? "0"),
@ -485,8 +458,6 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
provider.setTextValue(val, sectionItem, multiple); provider.setTextValue(val, sectionItem, multiple);
}, },
), ),
),
),
); );
case InteractionWidget.DROPDOWN: case InteractionWidget.DROPDOWN:
return customdropdown(sectionItem, provider, list, multiple); return customdropdown(sectionItem, provider, list, multiple);
@ -495,9 +466,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
Widget buildDateWidget(SectionList sectionItem) { Widget buildDateWidget(SectionList sectionItem) {
return SizedBox( 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, height: isTablet ? 50 : 40,
child: TextField( child: TextField(
controller: controller:
@ -577,12 +546,8 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
List<InputClass> list = provider.getData2(sectionItem); List<InputClass> list = provider.getData2(sectionItem);
// .map((itemWord) => InputClass.fromJson(itemWord)) // .map((itemWord) => InputClass.fromJson(itemWord))
// .toList(); // .toList();
return Padding( return SizedBox(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), width: isTablet ? 250 : MediaQuery.of(context).size.width,
child: SizedBox(
// width: isTablet ? 250 : MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
for (InputClass value in list) for (InputClass value in list)
@ -607,18 +572,13 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
), ),
], ],
), ),
),
); );
} }
Widget buildCheckbox(SectionList sectionItem, String sectionName, Widget buildCheckbox(SectionList sectionItem, String sectionName,
ViewInteractionProvider provider, bool multiple) { ViewInteractionProvider provider, bool multiple) {
return Padding( return SizedBox(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), width: 250,
child: SizedBox(
// width: 250,
width: MediaQuery.of(context).size.width,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
for (var value in provider.checkboxlist) for (var value in provider.checkboxlist)
@ -630,8 +590,8 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
checkColor: Colors.white, checkColor: Colors.white,
onChanged: (bool? newvalue) { onChanged: (bool? newvalue) {
value.ischecked = newvalue!; value.ischecked = newvalue!;
provider.setcheckBoxValue(sectionItem, sectionName, provider.setcheckBoxValue(
newvalue, value.id, multiple); sectionItem, sectionName, newvalue, value.id, multiple);
//setState(() {}); //setState(() {});
}, },
), ),
@ -640,7 +600,6 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
), ),
], ],
), ),
),
); );
} }
@ -657,13 +616,9 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
sectionItem.selectedObject = list[0]; sectionItem.selectedObject = list[0];
} }
// InputClass selectedObj = list[0]; // InputClass selectedObj = list[0];
return Padding( return SizedBox(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), width: isTablet ? 200 : MediaQuery.of(context).size.width,
child: SizedBox( height: isTablet ? 60 : 40,
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
// height: isTablet ? 60 : 40,
width: MediaQuery.of(context).size.width,
child: DropdownButtonFormField2<InputClass>( child: DropdownButtonFormField2<InputClass>(
isExpanded: true, isExpanded: true,
decoration: InputDecoration( decoration: InputDecoration(
@ -736,7 +691,6 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
padding: EdgeInsets.symmetric(horizontal: 16), padding: EdgeInsets.symmetric(horizontal: 16),
), ),
), ),
),
); );
} }
@ -747,13 +701,9 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
list = sectionItem.inputList!; list = sectionItem.inputList!;
} }
//InputClass selectedObj = list[0]; //InputClass selectedObj = list[0];
return Padding( return SizedBox(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), width: isTablet ? 200 : MediaQuery.of(context).size.width,
child: SizedBox( height: isTablet ? 60 : 40,
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
// height: isTablet ? 60 : 40,
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButtonFormField2<InputClass>( child: DropdownButtonFormField2<InputClass>(
isExpanded: true, isExpanded: true,
@ -851,7 +801,6 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
}, },
), ),
), ),
),
); );
} }
@ -862,13 +811,9 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
} }
InputClass selectedObj = list[0]; InputClass selectedObj = list[0];
return Padding( return SizedBox(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), width: isTablet ? 200 : MediaQuery.of(context).size.width,
child: SizedBox( height: isTablet ? 60 : 40,
// width: isTablet ? 200 : MediaQuery.of(context).size.width,
// height: isTablet ? 60 : 40,
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButtonFormField2<InputClass>( child: DropdownButtonFormField2<InputClass>(
isExpanded: true, isExpanded: true,
@ -975,7 +920,6 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
), ),
), ),
), ),
),
); );
} }

View File

@ -1,7 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; 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/add_event/add_hcp.dart';
import 'package:discover_module/ui_screen/interactionform/interactionprovider.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/interaction_data.dart';
@ -80,7 +79,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
color: Colors.white), color: Colors.white),
), ),
), ),
// backgroundColor: const Color(0xFF2b9af3), backgroundColor: const Color(0xFF2b9af3),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
actions: [saveActions(provider)], actions: [saveActions(provider)],
leading: InkWell( leading: InkWell(
@ -116,9 +115,8 @@ class _InteractionScreenState extends State<InteractionScreen> {
// height: double.infinity, // height: double.infinity,
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: const BoxDecoration(
// color: Color(0xFF2b9af3), color: Color(0xFF2b9af3),
color: Constants.k2color,
), ),
child: Text( child: Text(
item.sectionName, item.sectionName,
@ -580,14 +578,11 @@ class _InteractionScreenState extends State<InteractionScreen> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Padding( CustomButton(
padding: const EdgeInsets.all(4.0),
child: CustomButton(
backgroundColor: Colors.red.shade800, backgroundColor: Colors.red.shade800,
onPressed: () { onPressed: () {
//showDeleteProfileAlertDialog(context); //showDeleteProfileAlertDialog(context);
for (var textcontrollers for (var textcontrollers in provider.textEditingControllerList) {
in provider.textEditingControllerList) {
textcontrollers.text = ''; textcontrollers.text = '';
} }
@ -597,20 +592,15 @@ class _InteractionScreenState extends State<InteractionScreen> {
}, },
textColor: Colors.white, textColor: Colors.white,
title: "Reset", title: "Reset",
// height: 40, height: 40,
// width: isTablet ? 100 : 80, width: isTablet ? 100 : 80,
height: MediaQuery.of(context).size.height * 0.2,
fontsize: isTablet ? 15 : 10.2, fontsize: isTablet ? 15 : 10.2,
), ),
),
SizedBox( SizedBox(
width: isTablet ? 20 : 4, width: isTablet ? 20 : 4,
), ),
Padding( CustomButton(
padding: const EdgeInsets.all(4.0), backgroundColor: Colors.green.shade900,
child: CustomButton(
backgroundColor: Colors.green.shade500,
onPressed: () async { onPressed: () async {
if (textFieldsValidation(provider).isEmpty) { if (textFieldsValidation(provider).isEmpty) {
String record = String record =
@ -622,14 +612,10 @@ class _InteractionScreenState extends State<InteractionScreen> {
}, },
textColor: Colors.white, textColor: Colors.white,
title: "Save", title: "Save",
// height: 40, height: 40,
// width: isTablet ? 100 : 80, width: isTablet ? 100 : 80,
height: MediaQuery.of(context).size.height * 0.2,
// width: MediaQuery.of(context).size.width * 0.1,
fontsize: isTablet ? 16 : 12, fontsize: isTablet ? 16 : 12,
), ),
),
SizedBox( SizedBox(
width: isTablet ? 20 : 2, width: isTablet ? 20 : 2,
), ),
@ -1176,14 +1162,8 @@ class _InteractionScreenState extends State<InteractionScreen> {
setState(() {}); setState(() {});
}, },
// width: 80, width: 80,
// height: 30, height: 30,
height: 40,
// height:
// MediaQuery.of(context).size.height *
// 0.2,
fontsize: 12, fontsize: 12,
textColor: Colors.white, textColor: Colors.white,
title: "Delete"), title: "Delete"),

View File

@ -54,16 +54,7 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
//style: TextStyle(fontSize: isTablet ? 22 : 14, color: Colors.white), //style: TextStyle(fontSize: isTablet ? 22 : 14, color: Colors.white),
), ),
automaticallyImplyLeading: false, 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( body: Container(
child: Center( child: Center(

View File

@ -46,7 +46,7 @@ class _SavedFormListScreenState extends State<SavedFormListScreen> {
style: TextStyle(fontSize: isTablet ? 22 : 14, color: Colors.white), style: TextStyle(fontSize: isTablet ? 22 : 14, color: Colors.white),
), ),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
// backgroundColor: const Color(0xFF2b9af3), backgroundColor: const Color(0xFF2b9af3),
leading: InkWell( leading: InkWell(
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);

View File

@ -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/interactionprovider.dart';
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.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/model/save_interaction.dart';
@ -59,7 +58,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
style: TextStyle( style: TextStyle(
fontSize: isTablet ? 22 : 14, color: Colors.white), fontSize: isTablet ? 22 : 14, color: Colors.white),
), ),
// backgroundColor: const Color(0xFF2b9af3), backgroundColor: const Color(0xFF2b9af3),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
leading: InkWell( leading: InkWell(
onTap: () { onTap: () {
@ -90,9 +89,8 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
// height: double.infinity, // height: double.infinity,
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: const BoxDecoration(
// color: Color(0xFF2b9af3), color: Color(0xFF2b9af3),
color: Constants.k2color,
), ),
child: Text( child: Text(
item.sectionName, item.sectionName,
@ -120,52 +118,28 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
child: GridView.count( child: GridView.count(
physics: physics:
const NeverScrollableScrollPhysics(), 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>( crossAxisCount: context.responsive<int>(
1, 1,
sm: 1, // small sm: 1, // small
md: 2, // medium md: 1, // medium
lg: sectionList.length == 1 lg: sectionList.length == 1
? 1 ? 1
: 3, // large : 4, // large
xl: 3, // extra large screen xl: 3, // extra large screen
), ),
mainAxisSpacing: mainAxisSpacing:
sectionList.length == 1 || !isTablet sectionList.length == 1 || !isTablet
? 1 ? 1
: 3.5, : 3.5,
shrinkWrap: true,
padding: EdgeInsets.zero,
childAspectRatio: childAspectRatio:
sectionList.length == 1 sectionList.length == 1 || !isTablet
? orientation == ? orientation ==
Orientation.landscape Orientation.landscape
? 10 ? 10
: 4.8 : 3.8
: isTablet : 2.8,
? 2.8
: 3.0,
shrinkWrap: true,
padding: EdgeInsets.zero,
children: List.generate( children: List.generate(
sectionList.length, sectionList.length,
(i) { (i) {

View File

@ -26,18 +26,10 @@ class CustomButton extends StatelessWidget {
width: width, width: width,
child: ElevatedButton( child: ElevatedButton(
onPressed: onPressed, onPressed: onPressed,
// style: ButtonStyle( style: ButtonStyle(
// backgroundColor:
// MaterialStateColor.resolveWith((states) => backgroundColor),
// ),
style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor:
MaterialStateColor.resolveWith((states) => backgroundColor), MaterialStateColor.resolveWith((states) => backgroundColor),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), // <-- Radius
), ),
),
child: Text( child: Text(
title, title,
style: TextStyle(color: textColor, fontSize: fontsize ?? 24.0), style: TextStyle(color: textColor, fontSize: fontsize ?? 24.0),

View File

@ -57,77 +57,53 @@ class _RankingState extends State<Ranking> {
rowsPerPage: 5, rowsPerPage: 5,
columns: const [ columns: const [
DataColumn( DataColumn(
label: FittedBox( label: Text('Name',
fit: BoxFit.scaleDown,
child: Text('Name',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.0, fontSize: 14.0,
fontStyle: FontStyle.normal)), fontStyle: FontStyle.normal))),
)),
DataColumn( DataColumn(
label: FittedBox( label: Text('Tier',
fit: BoxFit.scaleDown,
child: Text('Tier',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.0, fontSize: 14.0,
fontStyle: FontStyle.normal)), fontStyle: FontStyle.normal))),
)),
DataColumn( DataColumn(
label: FittedBox( label: Text('Rank',
fit: BoxFit.scaleDown,
child: Text('Rank',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.0, fontSize: 14.0,
fontStyle: FontStyle.normal)), fontStyle: FontStyle.normal))),
)),
DataColumn( DataColumn(
label: FittedBox( label: Text('Score',
fit: BoxFit.scaleDown,
child: Text('Score',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.0, fontSize: 14.0,
fontStyle: FontStyle.normal)), fontStyle: FontStyle.normal))),
)),
DataColumn( DataColumn(
label: FittedBox( label: Text('Event',
fit: BoxFit.scaleDown,
child: Text('Event',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.0, fontSize: 14.0,
fontStyle: FontStyle.normal)), fontStyle: FontStyle.normal))),
)),
DataColumn( DataColumn(
label: FittedBox( label: Text('Affliations',
fit: BoxFit.scaleDown,
child: Text('Affliations',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.0, fontSize: 14.0,
fontStyle: FontStyle.normal)), fontStyle: FontStyle.normal))),
)),
DataColumn( DataColumn(
label: FittedBox( label: Text('Publications',
fit: BoxFit.scaleDown,
child: Text('Publications',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.0, fontSize: 14.0,
fontStyle: FontStyle.normal)), fontStyle: FontStyle.normal))),
)),
DataColumn( DataColumn(
label: FittedBox( label: Text('Trails',
fit: BoxFit.scaleDown,
child: Text('Trails',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.0, fontSize: 14.0,
fontStyle: FontStyle.normal)), fontStyle: FontStyle.normal))),
)),
], ],
source: _dataSource, source: _dataSource,
), ),
@ -164,7 +140,7 @@ class _RankingState extends State<Ranking> {
showDialog( showDialog(
context: context, context: context,
builder: (_) { 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('pooja');
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
sheet.getRangeByName('A1').setText('Name'); sheet.getRangeByName('A1').setText('Name 1122334455');
sheet.getRangeByName('A2').setText('Gerosa, Gino'); sheet.getRangeByName('A2').setText('John');
sheet.getRangeByName('A3').setText('Gerosa, Gino'); sheet.getRangeByName('A3').setText('Ashok');
sheet.getRangeByName('A4').setText('Gerosa, Gino'); sheet.getRangeByName('A4').setText('Vicki');
final Style headingStyle = workbook.styles.add('HeadingStyle'); final Style headingStyle = workbook.styles.add('HeadingStyle');
headingStyle.bold = true; headingStyle.bold = true;
headingStyle.hAlign = HAlignType.center; headingStyle.hAlign = HAlignType.center;
headingStyle.wrapText = true; headingStyle.wrapText = true;
sheet.getRangeByName('B1').setText('Tier'); sheet.getRangeByName('B1').setText('Mark1');
sheet.getRangeByName('B2').setText("Tier1"); sheet.getRangeByName('B2').setNumber(10);
sheet.getRangeByName('B3').setText("Tier1"); sheet.getRangeByName('B3').setNumber(39);
sheet.getRangeByName('B4').setText("Tier1"); sheet.getRangeByName('B4').setNumber(25);
sheet.getRangeByName('C1').setText('Rank'); sheet.getRangeByName('C1').setText('Mark2');
sheet.getRangeByName('C2').setNumber(1); sheet.getRangeByName('C2').setNumber(49);
sheet.getRangeByName('C3').setNumber(1); sheet.getRangeByName('C3').setNumber(23);
sheet.getRangeByName('C4').setNumber(1); sheet.getRangeByName('C4').setNumber(13);
sheet.getRangeByName('D1').setText('Score'); sheet.getRangeByName('D1').setText('Mark3');
sheet.getRangeByName('D2').setNumber(0); sheet.getRangeByName('D2').setNumber(24);
sheet.getRangeByName('D3').setNumber(0); sheet.getRangeByName('D3').setNumber(30);
sheet.getRangeByName('D4').setNumber(0); sheet.getRangeByName('D4').setNumber(10);
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. //Defining a global style with properties.
final Style globalStyle = workbook.styles.add('globalStyle'); final Style globalStyle = workbook.styles.add('globalStyle');
@ -251,10 +207,10 @@ class _RankingState extends State<Ranking> {
globalStyle1.numberFormat = '0.00'; globalStyle1.numberFormat = '0.00';
//Apply GlobalStyle //Apply GlobalStyle
// sheet.getRangeByName('A1:D1').cellStyle = globalStyle; sheet.getRangeByName('A1:D1').cellStyle = globalStyle;
// //Apply GlobalStyle1 //Apply GlobalStyle1
// sheet.getRangeByName('B2:D4').cellStyle = globalStyle1; sheet.getRangeByName('B2:D4').cellStyle = globalStyle1;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
final List<int> bytes = workbook.saveSync(); final List<int> bytes = workbook.saveSync();

View File

@ -125,9 +125,7 @@ class RisingStarState extends State<RisingStar> {
showDialog( showDialog(
context: context, context: context,
builder: (_) { builder: (_) {
return Alert( return Alert();
data: "User Added Successfully",
);
}); });
}, },
)), )),

View File

@ -100,7 +100,7 @@ class _TrendsState extends State<Trends> {
showDialog( showDialog(
context: context, context: context,
builder: (_) { builder: (_) {
return Alert(data: "User Added Successfully"); return Alert();
}); });
}, },
)), )),