diff --git a/assets/defaultProfilePicture.png b/assets/defaultProfilePicture.png new file mode 100644 index 0000000000000000000000000000000000000000..5d743050db584d75db2c3acde64448c6c023edeb Binary files /dev/null and b/assets/defaultProfilePicture.png differ diff --git a/lib/bottom_navigation_bar_buttons/profile/profile.dart b/lib/bottom_navigation_bar_buttons/profile/profile.dart new file mode 100644 index 0000000000000000000000000000000000000000..c0005ddd2720af6562236906d6dcef3cd5df0fc3 --- /dev/null +++ b/lib/bottom_navigation_bar_buttons/profile/profile.dart @@ -0,0 +1,118 @@ + +import 'package:flutter/material.dart'; + +class Profile extends StatefulWidget { + const Profile({Key? key}) : super(key: key); + + @override + _ProfilePage createState() => _ProfilePage(); +} + +/* +profile Page + */ + +class _ProfilePage extends State<Profile> { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Konto'), + actions: <Widget>[ + IconButton(onPressed: null, icon: Icon(Icons.settings)) + ], + backgroundColor: Colors.brown, + ), + body: Column( + children: <Widget>[ + Padding( + padding: const EdgeInsets.all(30), + child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.brown, shape: BoxShape.rectangle), + child: Padding( + padding: const EdgeInsets.all(5), + child: Text( + "Example Username", + maxLines: 2, + textScaleFactor: 2, + textAlign: TextAlign.center, + ), + )), + ), + Container( + alignment: Alignment.center, + decoration: + BoxDecoration(color: Colors.brown, shape: BoxShape.circle), + child: Padding( + padding: const EdgeInsets.all(5), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.brown, + backgroundImage: + AssetImage('assets/defaultProfilePicture.png'), + ), + )), + Padding( + padding: const EdgeInsets.fromLTRB(30, 10, 30, 20), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ProfileEntry( + category: "Name", description: "Very long example Name"), + ProfileEntry(category: "Age", description: "123"), + ProfileEntry(category: "Birthday", description: "12.34.") + ], + ), + ) + ], + ), + + //const Center(child: Text("Diese Seite wurde noch nicht entwickelt!!!")), + ); + } +} + +class ProfileEntry extends StatefulWidget { + var category; + var description; + + ProfileEntry({Key? key, required this.category, required this.description}) + : super(key: key); + + @override + _ProfileEntryState createState() => _ProfileEntryState(); +} + +class _ProfileEntryState extends State<ProfileEntry> { + @override + Widget build(BuildContext context) { + return TextButton( + onPressed: () { }, + style: TextButton.styleFrom(primary: Colors.brown), + child: Row( + children: [ + Expanded( + flex: 30, + child: Container( + padding: EdgeInsets.fromLTRB(0, 5, 10, 5), + child: Text( + widget.category + ":", + textAlign: TextAlign.right, + + ), + ), + ), + Expanded( + flex: 70, + child: Container( + padding: const EdgeInsets.fromLTRB(10, 5, 0, 5), + child: Text(widget.description), + ), + ) + ], + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index f2d548434670378bb8e29a1b370725b491798aae..64849b916b4b18739007e163f66ae01d456b1276 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,7 @@ import 'package:deggendorf_app/bottom_navigation_bar_buttons/weather/current_wea 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/settings/settings.dart'; void main() { @@ -52,7 +53,6 @@ class _MyHomePageState extends State<MyHomePage> { //Index: 3 SecondRoute(), //Index: 4 - SettingScreen(), ]; void _onItemTapped(int index) { @@ -72,6 +72,7 @@ class _MyHomePageState extends State<MyHomePage> { body: Center( child: _widgetOptions.elementAt(_selectedIndex), ), + /* From here are the bottom navigation bar's buttons Each button has an icon, a label and a colour, each of which are optional @@ -98,11 +99,6 @@ class _MyHomePageState extends State<MyHomePage> { label: 'Konto', backgroundColor: Colors.brown, ), - BottomNavigationBarItem( - icon: Icon(Icons.settings), - label: 'Einstellung', - backgroundColor: Colors.pink, - ), ], currentIndex: _selectedIndex, selectedItemColor: Colors.amber[800],