Skip to content

Commit

Permalink
add eventInfo Page and createEvent Page (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarshshendge authored Jun 4, 2021
1 parent 64099d2 commit f74842f
Show file tree
Hide file tree
Showing 11 changed files with 694 additions and 16 deletions.
2 changes: 2 additions & 0 deletions lib/constants/routing_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ class Routes {
static const String individualPost = "/individualPost";
static const String pinnedPostpage = "/pinnedPostPage";
static const String exploreEventsScreen = "/exploreEvents";
static const String eventInfoPage = "/eventInfo";
static const String createEventPage = "/createEventPage";
}
36 changes: 32 additions & 4 deletions lib/demo_server_data/events_demo_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ const eventsDemoData = [
"registrants": [
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"}
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
],
"admins": [
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
Expand Down Expand Up @@ -62,7 +69,14 @@ const eventsDemoData = [
"registrants": [
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"}
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
],
"admins": [
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
Expand Down Expand Up @@ -103,7 +117,14 @@ const eventsDemoData = [
"registrants": [
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"}
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
],
"admins": [
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
Expand Down Expand Up @@ -145,7 +166,14 @@ const eventsDemoData = [
"registrants": [
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"}
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
{"firstName": "Warren", "lastName": "Buff", "id": "asdasdasd"},
{"firstName": "Bustin", "lastName": "Jiber", "id": "asdasdasd"},
],
"admins": [
{"firstName": "Utkarsh", "lastName": "Shendge", "id": "asdasdasd"},
Expand Down
12 changes: 12 additions & 0 deletions lib/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
import 'package:talawa/main.dart';
import 'package:talawa/models/post/post_model.dart';
import 'package:talawa/splash_screen.dart';
import 'package:talawa/views/after_auth_screens/events/create_event_page.dart';
import 'package:talawa/views/after_auth_screens/events/event_info_page.dart';
import 'package:talawa/views/after_auth_screens/events/explore_events.dart';
import 'package:talawa/views/after_auth_screens/feed_page/individual_post.dart';
import 'package:talawa/views/after_auth_screens/feed_page/organization_feed.dart';
Expand All @@ -17,6 +19,7 @@ import 'package:talawa/views/pre_auth_screens/set_url.dart';
import 'package:talawa/views/pre_auth_screens/signup_details.dart';
import 'package:talawa/views/pre_auth_screens/waiting_to_join_private_org.dart';
import 'constants/routing_constants.dart';
import 'models/events/event_model.dart';

Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
Expand Down Expand Up @@ -85,6 +88,15 @@ Route<dynamic> generateRoute(RouteSettings settings) {
case Routes.exploreEventsScreen:
return MaterialPageRoute(
builder: (context) => const ExploreEvents(key: Key('ExploreEvents')));
case Routes.eventInfoPage:
final Event event = settings.arguments! as Event;
return MaterialPageRoute(
builder: (context) =>
EventInfoPage(key: const Key('EventInfo'), event: event),
);
case Routes.createEventPage:
return MaterialPageRoute(
builder: (context) => const CreateEventPage(key: Key('CreateEvent')));
default:
return MaterialPageRoute(
builder: (context) => const DemoPageView(
Expand Down
91 changes: 91 additions & 0 deletions lib/views/after_auth_screens/events/create_event_form.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import 'package:flutter/material.dart';
import 'package:talawa/services/size_config.dart';

class CreateEventForm extends StatefulWidget {
const CreateEventForm({Key? key}) : super(key: key);

@override
_CreateEventFormState createState() => _CreateEventFormState();
}

class _CreateEventFormState extends State<CreateEventForm> {
final _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return Form(
key: _formKey,
child: Column(
children: [
Row(
children: [
const Icon(Icons.title),
SizedBox(
width: SizeConfig.screenWidth! * 0.045,
),
Flexible(
child: TextFormField(
textInputAction: TextInputAction.next,
keyboardType: TextInputType.name,
decoration: InputDecoration(
labelText: 'Add Event Title',
labelStyle: Theme.of(context).textTheme.subtitle1,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
)),
),
],
),
SizedBox(
height: SizeConfig.screenHeight! * 0.013,
),
Row(
children: [
const Icon(Icons.place),
SizedBox(
width: SizeConfig.screenWidth! * 0.045,
),
Flexible(
child: TextFormField(
textInputAction: TextInputAction.next,
keyboardType: TextInputType.streetAddress,
decoration: InputDecoration(
hintText: 'Where is the event?',
labelText: 'Add Location',
labelStyle: Theme.of(context).textTheme.subtitle1,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
)),
),
],
),
SizedBox(
height: SizeConfig.screenHeight! * 0.013,
),
Row(
children: [
const Icon(Icons.view_headline),
SizedBox(
width: SizeConfig.screenWidth! * 0.045,
),
Flexible(
child: TextFormField(
keyboardType: TextInputType.multiline,
maxLines: 10,
minLines: 1,
decoration: InputDecoration(
hintText: 'Describe the event',
labelText: 'Add Description',
labelStyle: Theme.of(context).textTheme.subtitle1,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
)),
),
],
),
],
),
);
}
}
Loading

0 comments on commit f74842f

Please sign in to comment.