rework ui
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fotodocumentation/utils/login_credentials.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:fotodocumentation/pages/ui_utils/general_style.dart';
|
||||
import 'package:fotodocumentation/utils/di_container.dart';
|
||||
import 'package:fotodocumentation/utils/global_router.dart';
|
||||
|
||||
class PageHeaderWidget extends StatelessWidget {
|
||||
LoginCredentials get loginCredentials => DiContainer.get();
|
||||
|
||||
final String text;
|
||||
final String subText;
|
||||
|
||||
@@ -13,7 +19,7 @@ class PageHeaderWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top:24.0, bottom: 24.0),
|
||||
padding: const EdgeInsets.only(top: 24.0, bottom: 24.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -30,6 +36,7 @@ class PageHeaderWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
_logoutButton(context),
|
||||
Image.asset(
|
||||
'assets/images/logo.png',
|
||||
height: 48,
|
||||
@@ -52,4 +59,34 @@ class PageHeaderWidget extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _logoutButton(BuildContext context) {
|
||||
return ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
loginCredentials.logout();
|
||||
context.go(GlobalRouter.pathLogin);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.logout_rounded,
|
||||
color: _generalStyle.secondaryTextLabelColor,
|
||||
size: 24,
|
||||
),
|
||||
label: Text(
|
||||
"logout",
|
||||
style: TextStyle(
|
||||
fontFamily: _generalStyle.fontFamily,
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 16,
|
||||
color: _generalStyle.secondaryTextLabelColor,
|
||||
),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user