name ui fix and removed parts of the app that are not ready

This commit is contained in:
Arseni
2026-02-05 02:42:00 +03:00
parent 509af9bc5c
commit 0ce90eef21
9 changed files with 199 additions and 66 deletions

View File

@@ -128,7 +128,7 @@
"payoutNavReports": "Reports", "payoutNavReports": "Reports",
"payoutNavSettings": "Settings", "payoutNavSettings": "Settings",
"payoutNavLogout": "Logout", "payoutNavLogout": "Logout",
"payoutNavMethods": "Payouts", "payoutNavMethods": "Payout Methods",
"expand": "Expand", "expand": "Expand",
"collapse": "Collapse", "collapse": "Collapse",
"pageTitleRecipients": "Recipient address book", "pageTitleRecipients": "Recipient address book",

View File

@@ -128,7 +128,7 @@
"payoutNavReports": "Отчеты", "payoutNavReports": "Отчеты",
"payoutNavSettings": "Настройки", "payoutNavSettings": "Настройки",
"payoutNavLogout": "Выйти", "payoutNavLogout": "Выйти",
"payoutNavMethods": "Выплаты", "payoutNavMethods": "Способы выплат",
"expand": "Развернуть", "expand": "Развернуть",
"collapse": "Свернуть", "collapse": "Свернуть",
"pageTitleRecipients": "Адресная книга получателей", "pageTitleRecipients": "Адресная книга получателей",

View File

@@ -70,16 +70,17 @@ class _DashboardPageState extends State<DashboardPage> {
icon: Icons.person_add, icon: Icons.person_add,
), ),
), ),
const SizedBox(width: AppSpacing.small), //TODO bring back multiple payouts
Expanded( // const SizedBox(width: AppSpacing.small),
flex: 0, // Expanded(
child: TransactionRefButton( // flex: 0,
onTap: () => _setActive(false), // child: TransactionRefButton(
isActive: _showContainerMultiple, // onTap: () => _setActive(false),
label: l10n.sendMultiple, // isActive: _showContainerMultiple,
icon: Icons.group_add, // label: l10n.sendMultiple,
), // icon: Icons.group_add,
), // ),
// ),
], ],
), ),
const SizedBox(height: AppSpacing.medium), const SizedBox(height: AppSpacing.medium),

View File

@@ -0,0 +1,73 @@
import 'package:flutter/material.dart';
import 'package:pweb/providers/account_name.dart';
class AccountNameEditingFields extends StatelessWidget {
const AccountNameEditingFields({
super.key,
required this.hintText,
required this.lastNameHint,
required this.inputWidth,
required this.borderWidth,
required this.state,
});
final String hintText;
final String lastNameHint;
final double inputWidth;
final double borderWidth;
final AccountNameState state;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return SizedBox(
width: inputWidth,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextFormField(
controller: state.firstNameController,
style: theme.textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
),
autofocus: true,
enabled: !state.isBusy,
decoration: InputDecoration(
hintText: hintText,
labelText: hintText,
isDense: true,
border: UnderlineInputBorder(
borderSide: BorderSide(
color: theme.colorScheme.primary,
width: borderWidth,
),
),
),
),
const SizedBox(height: 8),
TextFormField(
controller: state.lastNameController,
style: theme.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w600,
),
enabled: !state.isBusy,
decoration: InputDecoration(
hintText: lastNameHint,
labelText: lastNameHint,
isDense: true,
border: UnderlineInputBorder(
borderSide: BorderSide(
color: theme.colorScheme.primary,
width: borderWidth,
),
),
),
),
],
),
);
}
}

View File

@@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
class AccountNameSingleLineText extends StatelessWidget {
const AccountNameSingleLineText({
super.key,
required this.text,
required this.style,
});
final String text;
final TextStyle? style;
@override
Widget build(BuildContext context) {
return Text(
text,
maxLines: 1,
softWrap: false,
overflow: TextOverflow.ellipsis,
style: style,
);
}
}

View File

@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pweb/pages/settings/profile/account/name/editing.dart';
import 'package:pweb/pages/settings/profile/account/name/view.dart';
import 'package:pweb/providers/account_name.dart'; import 'package:pweb/providers/account_name.dart';
@@ -22,63 +24,22 @@ class AccountNameText extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final state = context.watch<AccountNameState>(); final state = context.watch<AccountNameState>();
final theme = Theme.of(context);
if (state.isEditing) { if (state.isEditing) {
return SizedBox( return AccountNameEditingFields(
width: inputWidth,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextFormField(
controller: state.firstNameController,
style: theme.textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
),
autofocus: true,
enabled: !state.isBusy,
decoration: InputDecoration(
hintText: hintText, hintText: hintText,
labelText: hintText, lastNameHint: lastNameHint,
isDense: true, borderWidth: borderWidth,
border: UnderlineInputBorder( inputWidth: inputWidth,
borderSide: BorderSide( state: state,
color: theme.colorScheme.primary,
width: borderWidth,
),
),
),
),
const SizedBox(height: 8),
TextFormField(
controller: state.lastNameController,
style: theme.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w600,
),
enabled: !state.isBusy,
decoration: InputDecoration(
hintText: lastNameHint,
labelText: lastNameHint,
isDense: true,
border: UnderlineInputBorder(
borderSide: BorderSide(
color: theme.colorScheme.primary,
width: borderWidth,
),
),
),
),
],
),
); );
} }
final displayName = state.currentFullName.isNotEmpty ? state.currentFullName : hintText; return AccountNameViewText(
return Text( hintText: hintText,
displayName, inputWidth: inputWidth,
style: theme.textTheme.headlineMedium?.copyWith( firstName: state.currentFirstName,
fontWeight: FontWeight.bold, lastName: state.currentLastName,
),
); );
} }
} }

View File

@@ -0,0 +1,73 @@
import 'package:flutter/material.dart';
import 'package:pweb/pages/settings/profile/account/name/line.dart';
class AccountNameViewText extends StatelessWidget {
const AccountNameViewText({
super.key,
required this.hintText,
required this.inputWidth,
required this.firstName,
required this.lastName,
});
final String hintText;
final double inputWidth;
final String firstName;
final String lastName;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final trimmedFirstName = firstName.trim();
final trimmedLastName = lastName.trim();
final hasFirstName = trimmedFirstName.isNotEmpty;
final hasLastName = trimmedLastName.isNotEmpty;
final firstLineStyle = theme.textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
);
final secondLineStyle = theme.textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
);
if (!hasFirstName && !hasLastName) {
return SizedBox(
width: inputWidth,
child: AccountNameSingleLineText(
text: hintText,
style: firstLineStyle,
),
);
}
if (!hasFirstName || !hasLastName) {
final singleLineName = hasFirstName ? trimmedFirstName : trimmedLastName;
return SizedBox(
width: inputWidth,
child: AccountNameSingleLineText(
text: singleLineName,
style: firstLineStyle,
),
);
}
return SizedBox(
width: inputWidth,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AccountNameSingleLineText(
text: trimmedFirstName,
style: firstLineStyle,
),
AccountNameSingleLineText(
text: trimmedLastName,
style: secondLineStyle,
),
],
),
);
}
}

View File

@@ -46,7 +46,8 @@ class PayoutSidebar extends StatelessWidget {
PayoutDestination.recipients, PayoutDestination.recipients,
PayoutDestination.invitations, PayoutDestination.invitations,
PayoutDestination.methods, PayoutDestination.methods,
PayoutDestination.reports, //PayoutDestination.reports,
//TODO Add when ready
]; ];
final theme = Theme.of(context); final theme = Theme.of(context);

View File

@@ -57,7 +57,7 @@ class UserProfileCard extends StatelessWidget {
child: Text( child: Text(
userName ?? loc.userNamePlaceholder, userName ?? loc.userNamePlaceholder,
style: theme.textTheme.bodyLarge?.copyWith( style: theme.textTheme.bodyLarge?.copyWith(
fontSize: 20, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
maxLines: 2, maxLines: 2,