Skip to content
Snippets Groups Projects
Commit 2d2e08cb authored by Chaitanya's avatar Chaitanya
Browse files

event_chaitanya

parent 1f61c20d
Branches Deggendorf_App_1.0
No related tags found
No related merge requests found
import 'package:deggendorf_app/bottom_navigation_bar_buttons/home_page/home_page.dart';
import 'package:deggendorf_app/bottom_navigation_bar_buttons/event/event.dart';
import 'package:deggendorf_app/bottom_navigation_bar_buttons/home_page/homepage%20manager/home_page.dart';
import 'package:flutter/material.dart';
import 'bottom_navigation_bar_buttons/forum/forum.dart';
import 'bottom_navigation_bar_buttons/profile/profile.dart';
import 'bottom_navigation_bar_buttons/profile/profile.dart';
import 'bottom_navigation_bar_buttons/home_page/weather/current_weather.dart';
import '../bottom_navigation_bar_buttons/forum/forum.dart';
import '../bottom_navigation_bar_buttons/profile/profile.dart';
import '../bottom_navigation_bar_buttons/profile/profile.dart';
import '../bottom_navigation_bar_buttons/home_page/weather/current_weather.dart';
void main() {
runApp(const MyApp());
......@@ -48,7 +49,7 @@ class _MyHomePageState extends State<MyHomePage> {
//Index: 0
HomePage(),
//Index: 1,
SecondRoute(),
EventMainPage(),
//Index: 2,
Forum(),
//Index: 3
......
import 'package:deggendorf_app/bin/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
class EventMainPage extends StatefulWidget {
const EventMainPage({Key? key}) : super(key: key);
@override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState();
}
class _MyStatefulWidgetState extends State<EventMainPage> {
//This boolean variable is used for the checkboxes
bool _value = false;
/*This list contains the elements to be displayed on the event page.
These elements were originally thought to be bars which once clicked upon
are marked as checked.
If you want to add a new item to the scrollable list, add it in this list;
more specifically in the method initializeMyList.
*/
List<Widget> myListToBeDisplayed = [];
/*If you need to add a new item to the list, add it here.
*/
void initializeMyList() {
myListToBeDisplayed = [
sizedBox("Bar 1", "Mehr Informationen über Bar 1",
Icons.local_bar_rounded, 100, SecondRoute()),
sizedBox("Bar 2", "Mehr Informationen über Bar 1",
Icons.local_bar_rounded, 200, SecondRoute()),
sizedBox("Bar 3", "Mehr Informationen über Bar 3",
Icons.local_bar_rounded, 100, SecondRoute()),
sizedBox("Bar 4", "Mehr Informationen über Bar 4",
Icons.local_bar_rounded, 100, SecondRoute()),
sizedBox("Bar 5", "Mehr Informationen über Bar 5",
Icons.local_bar_rounded, 100, SecondRoute()),
sizedBox("Bar 6", "Mehr Informationen über Bar 6",
Icons.local_bar_rounded, 100, SecondRoute()),
];
}
@override
Widget build(BuildContext context) {
initializeMyList();
return Scaffold(
backgroundColor: Colors.blue[200],
appBar: AppBar(
title: Text("Eventname"),
backgroundColor: Colors.green,
),
body: Container(
child: Center(
child: ListView(
children: myListToBeDisplayed,
),
),
),
//This is the floating button at the bottom right of the page.
floatingActionButton: SpeedDial(
//edit here to change the colour and opacity of the overlay, when the button is pressed.
overlayColor: Colors.black,
overlayOpacity: 0.3,
animatedIcon: AnimatedIcons.menu_close,
backgroundColor: Colors.green[700],
children: [
SpeedDialChild(
child: Icon(Icons.info),
label: 'Option 1',
backgroundColor: Colors.red),
SpeedDialChild(
child: Icon(Icons.phone_android),
label: 'Option 2',
backgroundColor: Colors.green)
],
),
);
}
//This sized box is used in the list myListToBeDisplayed
SizedBox sizedBox(String mainTitle, String subtitle, IconData iconData,
double heightOfCheckBox, Widget navigateTo) {
return SizedBox(
height: heightOfCheckBox,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
color: Colors.green[100],
border: Border.all(color: Colors.green),
borderRadius: BorderRadius.circular(20),
), //BoxDecoration
child: CheckboxListTile(
title: Text(mainTitle),
subtitle: Text(subtitle),
secondary: Icon(iconData),
activeColor: Colors.green,
checkColor: Colors.white,
selected: _value,
value: _value,
onChanged: (bool? value) {
//This piece of code can be used to change the value of the checkbox upon click.
//It is commented because it is not used here.
setState(() {
_value = value!;
}
/*Navigator.push(
context,
MaterialPageRoute(
builder: (context) => navigateTo,
)*/);
},
), //CheckboxListTile
), //Container
), //Padding
);
}
}
import 'package:flutter/material.dart';
import '../../main.dart';
import '../../bin/main.dart';
class Forum extends StatefulWidget {
const Forum({Key? key}) : super(key: key);
......
import 'package:deggendorf_app/bottom_navigation_bar_buttons/home_page/list_of_widgets_for_home_page.dart';
import 'package:deggendorf_app/bottom_navigation_bar_buttons/home_page/weather/current_weather.dart';
import 'package:deggendorf_app/main.dart';
import 'package:deggendorf_app/bottom_navigation_bar_buttons/home_page/homepage%20manager/list_of_widgets_for_home_page.dart';
import 'package:deggendorf_app/bin/main.dart';
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
......@@ -22,8 +21,6 @@ class MyStatefulWidget extends StatefulWidget {
}
class _MyStatefulWidgetState extends State<MyStatefulWidget> {
List<int> bottom = <int>[0];
@override
Widget build(BuildContext context) {
const Key centerKey = ValueKey<String>('bottom-sliver-list');
......@@ -71,23 +68,20 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
(BuildContext context, int index) {
return new InkWell(
onTap: () {
if (index == 0) {
//If the widget tapped is the weather widget, then open weather page :)
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CurrentWeather()),
);
}
context,
MaterialPageRoute(
builder: (context) =>
new MyList(context).myListToBeTappedOn[index],
));
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20)),
height: 125,
child: new MyList(context).myList[index],
child: new MyList(context).myListToBeDisplayed[index],
));
},
childCount: new MyList(context).myList.length,
childCount: new MyList(context).myListToBeDisplayed.length,
),
),
],
......
import 'package:deggendorf_app/bin/main.dart';
import 'package:deggendorf_app/bottom_navigation_bar_buttons/home_page/weather/current_weather.dart';
import 'package:flutter/cupertino.dart';
class MyList {
List<Widget> myList = [];
List<Widget> myListToBeDisplayed = [];
List<Widget> myListToBeTappedOn = [];
MyList(BuildContext buildContext) {
myList = [
myListToBeDisplayed = [
actualWeatherContainer(buildContext),
Text("Input your widget here"),
Text("Input your widget here"),
......@@ -15,6 +19,18 @@ class MyList {
Text("Input your widget here"),
Text("Input your widget here"),
];
myListToBeTappedOn = [
CurrentWeather(),
SecondRoute(),
SecondRoute(),
SecondRoute(),
SecondRoute(),
SecondRoute(),
SecondRoute(),
SecondRoute(),
SecondRoute(),
];
}
}
import 'package:flutter/material.dart';
import 'package:deggendorf_app/bottom_navigation_bar_buttons/settings/settings.dart';
import '../settings/settings.dart';
class Profile extends StatefulWidget {
const Profile({Key? key}) : super(key: key);
......@@ -20,12 +20,15 @@ class _ProfilePage extends State<Profile> {
appBar: AppBar(
title: const Text('Konto'),
actions: <Widget>[
IconButton(onPressed:(){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SettingScreen()),
);
}, icon: Icon(Icons.settings))
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const SettingScreen()),
);
},
icon: Icon(Icons.settings))
],
backgroundColor: Colors.brown,
),
......@@ -95,7 +98,7 @@ class _ProfileEntryState extends State<ProfileEntry> {
@override
Widget build(BuildContext context) {
return TextButton(
onPressed: () { },
onPressed: () {},
style: TextButton.styleFrom(primary: Colors.brown),
child: Row(
children: [
......@@ -105,8 +108,7 @@ class _ProfileEntryState extends State<ProfileEntry> {
padding: EdgeInsets.fromLTRB(0, 5, 10, 5),
child: Text(
widget.category + ":",
textAlign: TextAlign.right,
textAlign: TextAlign.right,
),
),
),
......
......@@ -104,6 +104,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.2+1"
flutter_speed_dial:
dependency: "direct main"
description:
name: flutter_speed_dial
url: "https://pub.dartlang.org"
source: hosted
version: "4.6.6"
flutter_test:
dependency: "direct dev"
description: flutter
......
......@@ -32,12 +32,14 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.4
http: ^0.13.4
flutter_settings_screens: ^0.2.2+1
shared_preferences: ^2.0.13
flutter_speed_dial: ^4.3.0
dev_dependencies:
flutter_test:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment