From a81cb7cb029e6f483c58436aa49c75795ac91902 Mon Sep 17 00:00:00 2001 From: benedikts <sosnowskybene@gmail.com> Date: Mon, 4 Apr 2022 13:42:31 +0200 Subject: [PATCH] Improved look of ProfileEntry class --- .../profile/profile.dart | 55 ++++++++----------- 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/lib/bottom_navigation_bar_buttons/profile/profile.dart b/lib/bottom_navigation_bar_buttons/profile/profile.dart index b31edc4..9b813db 100644 --- a/lib/bottom_navigation_bar_buttons/profile/profile.dart +++ b/lib/bottom_navigation_bar_buttons/profile/profile.dart @@ -1,6 +1,4 @@ - import 'package:flutter/material.dart'; -import 'package:deggendorf_app/bottom_navigation_bar_buttons/settings/settings.dart'; class Profile extends StatefulWidget { const Profile({Key? key}) : super(key: key); @@ -20,12 +18,7 @@ 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: null, icon: Icon(Icons.settings)) ], backgroundColor: Colors.brown, ), @@ -66,9 +59,9 @@ class _ProfilePage extends State<Profile> { mainAxisAlignment: MainAxisAlignment.center, children: [ ProfileEntry( - category: "Name", description: "Very long example Name"), + category: "Name", description: "A very long example Name"), ProfileEntry(category: "Age", description: "123"), - ProfileEntry(category: "Birthday", description: "12.34.") + ProfileEntry(category: "Birthday", description: "30.02.") ], ), ) @@ -94,31 +87,27 @@ class ProfileEntry extends StatefulWidget { 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, - - ), + return 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), - ), - ) - ], - ), + ), + Expanded( + flex: 70, + child: Container( + padding: const EdgeInsets.fromLTRB(10, 5, 0, 5), + child: Text(widget.description), + ), + ) + ], ); } } -- GitLab