rework ui
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fotodocumentation/pages/ui_utils/general_style.dart';
|
||||
import 'package:fotodocumentation/utils/di_container.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:fotodocumentation/l10n/app_localizations.dart';
|
||||
|
||||
class CustomerBackButton extends StatelessWidget {
|
||||
GeneralStyle get _generalStyle => DiContainer.get();
|
||||
|
||||
final String path;
|
||||
|
||||
const CustomerBackButton({super.key, required this.path});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton.icon(
|
||||
onPressed: () => context.pop(),
|
||||
icon: Icon(
|
||||
Icons.chevron_left,
|
||||
color: _generalStyle.secondaryTextLabelColor,
|
||||
size: 24,
|
||||
),
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.backButtonLabel,
|
||||
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),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -20,42 +20,72 @@ class PageHeaderWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 24.0, bottom: 24.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final isNarrow = constraints.maxWidth < 600;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
key: Key("PageHeaderTextHeadline"),
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 50,
|
||||
fontFamily: _generalStyle.fontFamily,
|
||||
color: _generalStyle.primaryTextLabelColor,
|
||||
if (isNarrow) ...[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
_logoutButton(context),
|
||||
Image.asset(
|
||||
'assets/images/logo.png',
|
||||
height: 48,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
_logoutButton(context),
|
||||
Image.asset(
|
||||
'assets/images/logo.png',
|
||||
height: 48,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
key: Key("PageHeaderTextHeadline"),
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 50,
|
||||
fontFamily: _generalStyle.fontFamily,
|
||||
color: _generalStyle.primaryTextLabelColor,
|
||||
),
|
||||
),
|
||||
] else ...[
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
key: Key("PageHeaderTextHeadline"),
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 50,
|
||||
fontFamily: _generalStyle.fontFamily,
|
||||
color: _generalStyle.primaryTextLabelColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
_logoutButton(context),
|
||||
Image.asset(
|
||||
'assets/images/logo.png',
|
||||
height: 48,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
if (subText.isNotEmpty) ...[
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
key: Key("PageHeaderTextSubHeadline"),
|
||||
subText,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: _generalStyle.fontFamily,
|
||||
color: _generalStyle.secondaryTextLabelColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
if (subText.isNotEmpty) ...[
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
key: Key("PageHeaderTextSubHeadline"),
|
||||
subText,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: _generalStyle.fontFamily,
|
||||
color: _generalStyle.secondaryTextLabelColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
abstract interface class GeneralStyle {
|
||||
Color? evaluationColor({int value = 0});
|
||||
Color? evaluationColor({required int value});
|
||||
|
||||
Color get evaluationGoodColor;
|
||||
Color get evaluationMiddleColor;
|
||||
@@ -20,6 +20,8 @@ abstract interface class GeneralStyle {
|
||||
Color get secondaryWidgetBackgroundColor;
|
||||
|
||||
Color get pageBackgroundColor;
|
||||
Color get deleteCancelButtonBackgroundColor;
|
||||
Color get deleteCancelTextColor;
|
||||
|
||||
Color get errorColor;
|
||||
|
||||
@@ -28,7 +30,7 @@ abstract interface class GeneralStyle {
|
||||
|
||||
class GeneralStyleImpl implements GeneralStyle {
|
||||
@override
|
||||
Color? evaluationColor({int value = 0}) {
|
||||
Color? evaluationColor({required int value}) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return evaluationGoodColor;
|
||||
@@ -70,6 +72,12 @@ class GeneralStyleImpl implements GeneralStyle {
|
||||
@override
|
||||
Color get pageBackgroundColor => const Color(0xFFF5F5F5);
|
||||
|
||||
@override
|
||||
Color get deleteCancelButtonBackgroundColor => const Color(0xFFD9D9D9);
|
||||
|
||||
@override
|
||||
Color get deleteCancelTextColor => const Color(0xFF1E1E1E);
|
||||
|
||||
@override
|
||||
Color get nextTextColor => const Color(0xFF757575);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user