feat: change profile button
parent
686657628a
commit
98b45aabca
|
@ -4,9 +4,6 @@ import 'package:ernaehrung/android/pages/nav_pages/progress_page.dart';
|
||||||
import 'package:ernaehrung/android/pages/nav_pages/today_page.dart';
|
import 'package:ernaehrung/android/pages/nav_pages/today_page.dart';
|
||||||
import 'package:ernaehrung/android/pages/settings.dart';
|
import 'package:ernaehrung/android/pages/settings.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_profile_picture/flutter_profile_picture.dart';
|
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import '../../models/user.dart';
|
|
||||||
import 'meal_plan_page.dart';
|
import 'meal_plan_page.dart';
|
||||||
|
|
||||||
class MainPage extends StatefulWidget {
|
class MainPage extends StatefulWidget {
|
||||||
|
@ -40,7 +37,6 @@ class MainPageState extends State<MainPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final Box box = Hive.box<User>("USER_BOX");
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBodyBehindAppBar: false,
|
extendBodyBehindAppBar: false,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
@ -54,17 +50,26 @@ class MainPageState extends State<MainPage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => const SettingsPage()),
|
MaterialPageRoute(builder: (context) => const SettingsPage()),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: ProfilePicture(
|
style: ElevatedButton.styleFrom(
|
||||||
name: "${box.get("FIRST_NAME_FIELD")}",
|
backgroundColor: Colors.green, // Set the background color to green
|
||||||
radius: 16,
|
),
|
||||||
fontsize: 14,
|
child: Row(
|
||||||
))
|
children: const [
|
||||||
|
Icon(
|
||||||
|
Icons.account_circle,
|
||||||
|
size: 30,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
|
Loading…
Reference in New Issue