From 9d58231bf8fadd888f7a5f7552c46ae507724c03 Mon Sep 17 00:00:00 2001 From: AkhileshManda Date: Fri, 29 Oct 2021 17:29:16 +0530 Subject: [PATCH] organised files --- lib/main.dart | 6 +- lib/ui/event_feedback.dart | 0 lib/ui/{ => pages}/app_feedback_page.dart | 6 +- lib/ui/{ => pages}/event_list_page.dart | 6 +- lib/ui/{ => pages}/homePage(temporary).dart | 8 +- lib/ui/{ => pages}/login_screen.dart | 4 +- lib/ui/{ => pages}/past_event_page.dart | 10 +- lib/ui/{ => utils}/MenuWidget.dart | 12 +- lib/ui/{ => utils}/app_feedback.dart | 0 lib/ui/{ => utils}/dialog_widget.dart | 0 lib/ui/{ => utils}/event_creation.dart | 0 lib/ui/{ => utils}/event_details.dart | 4 +- lib/ui/{ => utils}/event_list.dart | 2 +- lib/ui/{ => utils}/past_event_details.dart | 4 +- lib/ui/{ => utils}/past_event_list.dart | 4 +- lib/ui/{ => widgets}/EventCard.dart | 0 lib/ui/widgets/MenuWidget.dart | 328 ++++++++++++++++++ lib/ui/widgets/page_scaffold_widget.dart | 51 +++ lib/ui/{ => widgets}/slider_widget.dart | 4 +- .../{ => widgets}/slider_widget_present.dart | 4 +- 20 files changed, 417 insertions(+), 36 deletions(-) delete mode 100644 lib/ui/event_feedback.dart rename lib/ui/{ => pages}/app_feedback_page.dart (92%) rename lib/ui/{ => pages}/event_list_page.dart (91%) rename lib/ui/{ => pages}/homePage(temporary).dart (91%) rename lib/ui/{ => pages}/login_screen.dart (98%) rename lib/ui/{ => pages}/past_event_page.dart (82%) rename lib/ui/{ => utils}/MenuWidget.dart (97%) rename lib/ui/{ => utils}/app_feedback.dart (100%) rename lib/ui/{ => utils}/dialog_widget.dart (100%) rename lib/ui/{ => utils}/event_creation.dart (100%) rename lib/ui/{ => utils}/event_details.dart (97%) rename lib/ui/{ => utils}/event_list.dart (99%) rename lib/ui/{ => utils}/past_event_details.dart (97%) rename lib/ui/{ => utils}/past_event_list.dart (98%) rename lib/ui/{ => widgets}/EventCard.dart (100%) create mode 100644 lib/ui/widgets/MenuWidget.dart create mode 100644 lib/ui/widgets/page_scaffold_widget.dart rename lib/ui/{ => widgets}/slider_widget.dart (99%) rename lib/ui/{ => widgets}/slider_widget_present.dart (98%) diff --git a/lib/main.dart b/lib/main.dart index 05876b1..2658c87 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,9 +5,9 @@ import 'package:flutter_neumorphic/flutter_neumorphic.dart'; import './util/cloud_messaging_handler.dart'; import './util/crashlytics_handler.dart'; -import './ui/login_screen.dart'; -import './ui/homePage(temporary).dart'; -import 'ui/event_details.dart'; +import 'ui/pages/login_screen.dart'; +import 'ui/pages/homePage(temporary).dart'; +import 'ui/utils/event_details.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); diff --git a/lib/ui/event_feedback.dart b/lib/ui/event_feedback.dart deleted file mode 100644 index e69de29..0000000 diff --git a/lib/ui/app_feedback_page.dart b/lib/ui/pages/app_feedback_page.dart similarity index 92% rename from lib/ui/app_feedback_page.dart rename to lib/ui/pages/app_feedback_page.dart index f5b6e53..5b2af6f 100644 --- a/lib/ui/app_feedback_page.dart +++ b/lib/ui/pages/app_feedback_page.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; -import '../styles.dart'; -import 'MenuWidget.dart'; -import 'app_feedback.dart'; +import '../../styles.dart'; +import '../widgets/MenuWidget.dart'; +import '../utils/app_feedback.dart'; class AppFeedBackPage extends StatefulWidget { const AppFeedBackPage({Key key}) : super(key: key); diff --git a/lib/ui/event_list_page.dart b/lib/ui/pages/event_list_page.dart similarity index 91% rename from lib/ui/event_list_page.dart rename to lib/ui/pages/event_list_page.dart index bd3101b..8200a10 100644 --- a/lib/ui/event_list_page.dart +++ b/lib/ui/pages/event_list_page.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; -import '../styles.dart'; -import 'MenuWidget.dart'; -import 'event_list.dart'; +import '../../styles.dart'; +import '../widgets/MenuWidget.dart'; +import '../utils/event_list.dart'; class EventListPage extends StatefulWidget { const EventListPage({Key key}) : super(key: key); diff --git a/lib/ui/homePage(temporary).dart b/lib/ui/pages/homePage(temporary).dart similarity index 91% rename from lib/ui/homePage(temporary).dart rename to lib/ui/pages/homePage(temporary).dart index c4f0fa3..2258f21 100644 --- a/lib/ui/homePage(temporary).dart +++ b/lib/ui/pages/homePage(temporary).dart @@ -1,11 +1,11 @@ //this is temporary homepage till the th erequired homepage is made. //this is made for the checking whether the login page is siigning correctly import 'package:club_calendar/styles.dart'; -import 'package:club_calendar/ui/event_list.dart'; -import 'package:club_calendar/ui/past_event_list.dart'; +import 'package:club_calendar/ui/utils/event_list.dart'; +import 'package:club_calendar/ui/utils/past_event_list.dart'; import 'package:flutter/material.dart'; -import 'MenuWidget.dart'; -import 'app_feedback.dart'; +import '../widgets/MenuWidget.dart'; +import '../utils/app_feedback.dart'; import 'event_list_page.dart'; diff --git a/lib/ui/login_screen.dart b/lib/ui/pages/login_screen.dart similarity index 98% rename from lib/ui/login_screen.dart rename to lib/ui/pages/login_screen.dart index d475646..3da1282 100644 --- a/lib/ui/login_screen.dart +++ b/lib/ui/pages/login_screen.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart' as neu; -import '../styles.dart'; -import '../util/google_sign_in.dart'; +import '../../styles.dart'; +import '../../util/google_sign_in.dart'; class LoginScreen extends StatefulWidget { static const routeName = "/loginScreen"; diff --git a/lib/ui/past_event_page.dart b/lib/ui/pages/past_event_page.dart similarity index 82% rename from lib/ui/past_event_page.dart rename to lib/ui/pages/past_event_page.dart index 14dd2ae..7e2b997 100644 --- a/lib/ui/past_event_page.dart +++ b/lib/ui/pages/past_event_page.dart @@ -1,7 +1,9 @@ -import 'package:club_calendar/ui/past_event_list.dart'; +import 'package:club_calendar/ui/utils/past_event_list.dart'; +import 'package:club_calendar/ui/widgets/page_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import '../styles.dart'; -import 'MenuWidget.dart'; +import '../../styles.dart'; +import '../widgets/MenuWidget.dart'; + class PastEventListPage extends StatefulWidget { @@ -45,7 +47,7 @@ class _PastEventListPageState extends State { ), drawer: MenuWidget(), - body: PastEventList() + body:PastEventList() ); diff --git a/lib/ui/MenuWidget.dart b/lib/ui/utils/MenuWidget.dart similarity index 97% rename from lib/ui/MenuWidget.dart rename to lib/ui/utils/MenuWidget.dart index bb885f3..1f08842 100644 --- a/lib/ui/MenuWidget.dart +++ b/lib/ui/utils/MenuWidget.dart @@ -1,16 +1,16 @@ -import 'package:club_calendar/ui/homePage(temporary).dart'; -import 'package:club_calendar/ui/past_event_page.dart'; +import 'package:club_calendar/ui/pages/homePage(temporary).dart'; +import 'package:club_calendar/ui/pages/past_event_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart' as neu; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; -import '../styles.dart'; -import '../util/google_sign_in.dart'; +import '../../styles.dart'; +import '../../util/google_sign_in.dart'; import 'package:sliding_switch/sliding_switch.dart'; import 'package:auto_size_text/auto_size_text.dart'; -import 'app_feedback_page.dart'; +import '../pages/app_feedback_page.dart'; import 'event_details.dart'; -import 'event_list_page.dart'; +import '../pages/event_list_page.dart'; //Drawer Code class MenuWidget extends StatefulWidget { diff --git a/lib/ui/app_feedback.dart b/lib/ui/utils/app_feedback.dart similarity index 100% rename from lib/ui/app_feedback.dart rename to lib/ui/utils/app_feedback.dart diff --git a/lib/ui/dialog_widget.dart b/lib/ui/utils/dialog_widget.dart similarity index 100% rename from lib/ui/dialog_widget.dart rename to lib/ui/utils/dialog_widget.dart diff --git a/lib/ui/event_creation.dart b/lib/ui/utils/event_creation.dart similarity index 100% rename from lib/ui/event_creation.dart rename to lib/ui/utils/event_creation.dart diff --git a/lib/ui/event_details.dart b/lib/ui/utils/event_details.dart similarity index 97% rename from lib/ui/event_details.dart rename to lib/ui/utils/event_details.dart index 513b40a..d0dc2bc 100644 --- a/lib/ui/event_details.dart +++ b/lib/ui/utils/event_details.dart @@ -1,9 +1,9 @@ -import 'package:club_calendar/ui/slider_widget_present.dart'; +import 'package:club_calendar/ui/widgets/slider_widget_present.dart'; import 'package:flutter/material.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart' as neu; import 'package:sliding_sheet/sliding_sheet.dart'; -import '../styles.dart'; +import '../../styles.dart'; class EventDetailsPage extends StatelessWidget { static const String routeName = '\EventDetailsScreen'; final styles = Styles(); diff --git a/lib/ui/event_list.dart b/lib/ui/utils/event_list.dart similarity index 99% rename from lib/ui/event_list.dart rename to lib/ui/utils/event_list.dart index 6a7f1aa..af79b71 100644 --- a/lib/ui/event_list.dart +++ b/lib/ui/utils/event_list.dart @@ -1,6 +1,6 @@ import 'package:club_calendar/styles.dart'; import 'package:flutter/material.dart'; -import 'EventCard.dart'; +import '../widgets/EventCard.dart'; import 'event_details.dart'; class EventList extends StatefulWidget { diff --git a/lib/ui/past_event_details.dart b/lib/ui/utils/past_event_details.dart similarity index 97% rename from lib/ui/past_event_details.dart rename to lib/ui/utils/past_event_details.dart index 1cf88aa..5c4b6d0 100644 --- a/lib/ui/past_event_details.dart +++ b/lib/ui/utils/past_event_details.dart @@ -3,9 +3,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:sliding_sheet/sliding_sheet.dart'; -import '../styles.dart'; +import '../../styles.dart'; import 'dialog_widget.dart'; -import 'slider_widget.dart'; +import '../widgets/slider_widget.dart'; class PastEventDetailsPage extends StatelessWidget { final styles = Styles(); diff --git a/lib/ui/past_event_list.dart b/lib/ui/utils/past_event_list.dart similarity index 98% rename from lib/ui/past_event_list.dart rename to lib/ui/utils/past_event_list.dart index 6ed3570..9f548f4 100644 --- a/lib/ui/past_event_list.dart +++ b/lib/ui/utils/past_event_list.dart @@ -1,7 +1,7 @@ import 'package:club_calendar/styles.dart'; -import 'package:club_calendar/ui/past_event_details.dart'; +import 'package:club_calendar/ui/utils/past_event_details.dart'; import 'package:flutter/material.dart'; -import 'EventCard.dart'; +import '../widgets/EventCard.dart'; import 'event_details.dart'; import 'event_list.dart'; diff --git a/lib/ui/EventCard.dart b/lib/ui/widgets/EventCard.dart similarity index 100% rename from lib/ui/EventCard.dart rename to lib/ui/widgets/EventCard.dart diff --git a/lib/ui/widgets/MenuWidget.dart b/lib/ui/widgets/MenuWidget.dart new file mode 100644 index 0000000..7189e81 --- /dev/null +++ b/lib/ui/widgets/MenuWidget.dart @@ -0,0 +1,328 @@ +import 'package:club_calendar/ui/pages/homePage(temporary).dart'; +import 'package:club_calendar/ui/pages/past_event_page.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_neumorphic/flutter_neumorphic.dart' as neu; +import 'package:flutter_neumorphic/flutter_neumorphic.dart'; +import '../../styles.dart'; +import '../../util/google_sign_in.dart'; +import 'package:sliding_switch/sliding_switch.dart'; +import 'package:auto_size_text/auto_size_text.dart'; + +import '../pages/app_feedback_page.dart'; +import '../utils/event_details.dart'; +import '../pages/event_list_page.dart'; + +//Drawer Code +class MenuWidget extends StatefulWidget { + const MenuWidget({Key key}) : super(key: key); + + @override + _MenuWidgetState createState() => _MenuWidgetState(); +} + +class _MenuWidgetState extends State { + @override + Widget build(BuildContext context) { + //bool variable to keep in touch of events when button pressed + + bool isPressedEvent = false; + bool isPressedPastEvent = false; + bool isPressedFeedBack = false; + + var styles = Styles(); + double deviceHeight = MediaQuery.of(context).size.height, + deviceWidth = MediaQuery.of(context).size.width; + + //********************************************************************************************** + + return Drawer( + child: SingleChildScrollView( + child: Container( + width: deviceWidth, + color: Styles.backgroundColor, + child: Container( + height: deviceHeight, + child: ListView(children: [ + //Image + + Padding( + padding: const EdgeInsets.all(25), + child: Container( + width: deviceWidth * 0.2, + height: deviceHeight * 0.2, + child: Image.asset( + "assets/icons/CC-Logo(1).png", + scale: 1.3, + ), + ), + ), + + //********************************************************************************************** + + //Slider + Padding( + padding: const EdgeInsets.only( + top: 20, bottom: 50, left: 10, right: 10), + child: SizedBox( + height: deviceHeight * 0.06399636, + width: deviceWidth * 0.8, + child: SlidingSwitch( + value: false, + width: deviceWidth * 0.731, //check adaptability + onChanged: (bool value) { + print(value); + }, + height: 55, + animationDuration: const Duration(milliseconds: 400), + onTap: () {}, + onDoubleTap: () {}, + onSwipe: () {}, + textOff: "Dark", + textOn: "Light", + colorOn: Colors.white, + colorOff: const Color(0xff6682c0), + background: Colors.black38, + buttonColor: Colors.black, + inactiveColor: const Color(0xff636f7b), + ), + ), + ), + + //********************************************************************************************** + + //Event + Padding( + //Check adaptability + padding: const EdgeInsets.only( + top: 10, bottom: 10, left: 10, right: 10), + child: Container( + alignment: Alignment.bottomCenter, + height: deviceHeight * 0.07399636, + width: deviceWidth * 0.79, + child: neu.NeumorphicButton( + style: neu.NeumorphicStyle( + shadowLightColorEmboss: Styles.backgroundColor, + shadowLightColor: Styles.backgroundColor, + boxShape: neu.NeumorphicBoxShape.roundRect( + BorderRadius.circular( + MediaQuery.of(context).size.height * 0.0387820513), + ), + color: !isPressedEvent + ? Styles.backgroundColor + : Colors.black12, + + shape: neu.NeumorphicShape.flat, + + depth: isPressedEvent + ? -4.9687 + : 4.9687, //MediaQuery.of(context).size.height*0.023, + ), + + //TODO + onPressed: () { + + + Navigator.push( + context, MaterialPageRoute(builder: (context) => EventListPage()), + ); + + + + + setState(() { + isPressedEvent = true; + }); + }, + child: Container( + height: deviceHeight * 0.06599636, + width: deviceWidth * 0.76, + child: Row( + children: [ + Container( + padding: EdgeInsets.only(left: deviceWidth * 0.011), + ), + Flexible( + child: Center( + child: AutoSizeText( + "Events", + style: TextStyle( + color: Styles.fontColor, + fontSize: 20, + fontWeight: FontWeight.w400), + textAlign: TextAlign.center, + ), + ), + ), + ], + ), + ), + ), + ), + ), + + //********************************************************************************************** + + //Past Events + Padding( + //Check adaptability + padding: const EdgeInsets.only( + top: 10, bottom: 10, left: 10, right: 10), + child: Container( + alignment: Alignment.bottomCenter, + height: deviceHeight * 0.07399636, + width: deviceWidth * 0.79, + child: neu.NeumorphicButton( + style: neu.NeumorphicStyle( + shadowLightColorEmboss: Styles.backgroundColor, + shadowLightColor: Styles.backgroundColor, + boxShape: neu.NeumorphicBoxShape.roundRect( + BorderRadius.circular( + MediaQuery.of(context).size.height * 0.0387820513), + ), + color: !isPressedPastEvent + ? Styles.backgroundColor + : Colors.black12, + intensity: 1, + shape: neu.NeumorphicShape.flat, + + depth: isPressedPastEvent + ? -4.9687 + : 4.9687, //MediaQuery.of(context).size.height*0.023, + oppositeShadowLightSource: false, + ), + + //TODO + onPressed: () { + + + Navigator.push( + context, MaterialPageRoute(builder: (context) => PastEventListPage()), + ); + + + setState(() { + isPressedPastEvent = true; + }); + }, + child: Container( + height: deviceHeight * 0.06599636, + width: deviceWidth * 0.76, + child: Row( + children: [ + Container( + padding: EdgeInsets.only(left: deviceWidth * 0.011), + ), + Flexible( + child: Center( + child: AutoSizeText( + "Past Events", + style: TextStyle( + color: Styles.fontColor, + fontWeight: FontWeight.w400, + fontSize: 20 + ), + textAlign: TextAlign.center, + ), + ), + ), + ], + ), + ), + ), + ), + ), + + //********************************************************************************************** + + //Send Feedback + Padding( + padding: const EdgeInsets.only( + top: 10, bottom: 10, left: 10, right: 10), + child: Container( + alignment: Alignment.bottomCenter, + height: deviceHeight * 0.07399636, + width: deviceWidth * 0.79, + child: neu.NeumorphicButton( + style: neu.NeumorphicStyle( + shadowLightColorEmboss: Styles.backgroundColor, + shadowLightColor: Styles.backgroundColor, + boxShape: neu.NeumorphicBoxShape.roundRect( + BorderRadius.circular( + MediaQuery.of(context).size.height * 0.0387820513), + ), + color: !isPressedFeedBack + ? Styles.backgroundColor + : Colors.black12, + intensity: 1, + shape: neu.NeumorphicShape.flat, + + depth: isPressedFeedBack + ? -4.9687 + : 4.9687, //MediaQuery.of(context).size.height*0.023, + oppositeShadowLightSource: false, + ), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AppFeedBackPage()), + ); + + setState(() { + isPressedFeedBack = true; + }); + }, + child: Container( + height: deviceHeight * 0.06599636, + width: deviceWidth * 0.76, + child: Row( + children: [ + Container( + padding: EdgeInsets.only(left: deviceWidth * 0.011), + ), + Flexible( + child: Center( + child: AutoSizeText( + "Send feedback", + style: TextStyle( + color: Styles.fontColor, + fontWeight: FontWeight.w400, + fontSize: 20 + ), + textAlign: TextAlign.center, + ), + ), + ), + ], + ), + ), + ), + ), + ), + + //********************************************************************************************** + + SizedBox( + height: deviceHeight * 0.07, + ), + + //Signout Button + Padding( + padding: const EdgeInsets.all(20), + child: Align( + alignment: Alignment.bottomLeft, + child: FloatingActionButton( + backgroundColor: Colors.grey[800], + onPressed: () { + var googleSignMe = GoogleSignMeIn(); + googleSignMe.logout(); + }, + child: Icon(Icons.logout), + ), + ), + ), + ]), + )), + )); + } +} diff --git a/lib/ui/widgets/page_scaffold_widget.dart b/lib/ui/widgets/page_scaffold_widget.dart new file mode 100644 index 0000000..d273fbc --- /dev/null +++ b/lib/ui/widgets/page_scaffold_widget.dart @@ -0,0 +1,51 @@ +import 'package:club_calendar/styles.dart'; +import 'package:flutter/material.dart'; +import 'MenuWidget.dart'; + +class PageScaffold extends StatefulWidget { + final Widget body; + + PageScaffold({this.body}); + + + @override + _PageScaffoldState createState() => _PageScaffoldState(); +} + +class _PageScaffoldState extends State { + @override + Widget build(BuildContext context) { + Styles styles = new Styles(); + return Scaffold( + appBar:AppBar( + + backgroundColor: Styles.backgroundColor, + elevation: 0.0, + + automaticallyImplyLeading: false, + title: Row( + children: [ + Builder( + + builder: (context) => IconButton( + icon: Icon(Icons.menu), + + onPressed: (){ + Scaffold.of(context).openDrawer(); + } + + ), + ), + Text("CLUB CALENDAR", + style: styles.headingStyle(),) + + + ], + ), + + ), + drawer: MenuWidget(), + body: widget.body + ); + } +} diff --git a/lib/ui/slider_widget.dart b/lib/ui/widgets/slider_widget.dart similarity index 99% rename from lib/ui/slider_widget.dart rename to lib/ui/widgets/slider_widget.dart index afe71c6..79075bb 100644 --- a/lib/ui/slider_widget.dart +++ b/lib/ui/widgets/slider_widget.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:sliding_sheet/sliding_sheet.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart' as neu; -import '../styles.dart'; -import 'dialog_widget.dart'; +import '../../styles.dart'; +import '../utils/dialog_widget.dart'; Widget slider(BuildContext context) { double deviceHeight = MediaQuery.of(context).size.height, diff --git a/lib/ui/slider_widget_present.dart b/lib/ui/widgets/slider_widget_present.dart similarity index 98% rename from lib/ui/slider_widget_present.dart rename to lib/ui/widgets/slider_widget_present.dart index 1e34e75..1283ea8 100644 --- a/lib/ui/slider_widget_present.dart +++ b/lib/ui/widgets/slider_widget_present.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:sliding_sheet/sliding_sheet.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart' as neu; -import '../styles.dart'; -import 'dialog_widget.dart'; +import '../../styles.dart'; +import '../utils/dialog_widget.dart'; Widget sliderPresent(BuildContext context) { double deviceHeight = MediaQuery.of(context).size.height,