diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 7eaacd8..e5d9349 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -4,5 +4,6 @@ the Flutter tool needs it to communicate with the running application to allow setting breakpoints, to provide hot reload, etc. --> - + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 86049d1..e47418c 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -31,4 +31,7 @@ android:name="flutterEmbedding" android:value="2" /> + + + diff --git a/lib/UserDefinedList.dart b/lib/UserDefinedList.dart index 264553b..6a6cb88 100644 --- a/lib/UserDefinedList.dart +++ b/lib/UserDefinedList.dart @@ -16,19 +16,37 @@ class UserDefinedItem extends StatelessWidget { @override Widget build(BuildContext context) { - return ListTile( - leading: image, - title: Text(title), - subtitle: Text(description), + return Padding( + padding: const EdgeInsets.symmetric(vertical: 10.0), + child: ListTile( + title: Text( + title, + style: const TextStyle( + fontSize: 24, // beliebige Schriftgröße + ), + ), + subtitle: Text( + description, + style: const TextStyle( + fontSize: 18, // beliebige Schriftgröße + ), + ), + leading: Container( + child: image, + ), + ), ); } } class NewsList extends StatelessWidget { + const NewsList({super.key}); + @override Widget build(BuildContext context) { return ListView( + children: [ UserDefinedItem( title: 'Rosalia Kapelle', @@ -48,6 +66,8 @@ class NewsList extends StatelessWidget { } class IssueList extends StatelessWidget { + const IssueList({super.key}); + @override Widget build(BuildContext context) { return ListView( @@ -55,9 +75,8 @@ class IssueList extends StatelessWidget { UserDefinedItem( title: 'Licht ausgebrannt', description: 'Licht ist ausgebrannt in der Sebastianstraße', - image: Image.network('https://www.best-of-burgenland.com/assets/img/gemeinden/oggau/oggau_feuerwehr_2022-04-12_003.jpg'), + image: Image.network('https://api.ebsg.at/uploads/immo70/originals/objekt_809_oggau-am-neusiedler-see_7063_6021.jpeg',), ), - UserDefinedItem( title: 'test2', description: 'Gemeide Amt der Marktgemeinde Oggau. SPÖ regierend', diff --git a/lib/home.dart b/lib/home.dart index 4ba082d..8e4a6f4 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + import 'UserDefinedList.dart'; @@ -13,9 +15,14 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { int _selectedIndex = 0; + bool login = false; + bool isIssueItemEnabled = true; + static const TextStyle optionStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold); - static /*const*/ final List _widgetOptions = [ + + + /*static /*const*/ final List _widgetOptions = [ /*Text( 'Index 0: News', style: optionStyle, @@ -26,7 +33,7 @@ class _MyHomePageState extends State { 'Index 2: Profil', style: optionStyle, ) - ]; + ];*/ void _onItemTapped(int index) { setState(() { @@ -34,8 +41,45 @@ class _MyHomePageState extends State { }); } + void setLogin(bool value) { + setState(() { + login = value; + isIssueItemEnabled = value; + }); + } @override Widget build(BuildContext context) { + final List _widgetOptions = [ + NewsList(), + login ? IssueList() : Container( + child: const Text( + 'Mängel (nur für angemeldete Benutzer verfügbar)', + style: optionStyle, + textAlign: TextAlign.center, + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + child: Text(login ? 'Logout' : 'Login'), + onPressed: () { + setLogin(!login); + }, + ), + const Text( + 'Index 2: Profil', + style: optionStyle, + ), + ], + ), + ]; + + /*const Text( + 'Index 2: Profil', + style: optionStyle, + )*/ + return Scaffold( appBar: AppBar( title: const Text('Oggauer Gemeinde Trommler'), diff --git a/pubspec.yaml b/pubspec.yaml index 77ba232..96b0a42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +version: 0.0.1 environment: sdk: '>=2.18.2 <3.0.0'