Added Last Name display and made it editable
This commit is contained in:
@@ -9,11 +9,13 @@ class AccountNameText extends StatelessWidget {
|
||||
const AccountNameText({
|
||||
super.key,
|
||||
required this.hintText,
|
||||
required this.lastNameHint,
|
||||
required this.inputWidth,
|
||||
required this.borderWidth,
|
||||
});
|
||||
|
||||
final String hintText;
|
||||
final String lastNameHint;
|
||||
final double inputWidth;
|
||||
final double borderWidth;
|
||||
|
||||
@@ -25,29 +27,55 @@ class AccountNameText extends StatelessWidget {
|
||||
if (state.isEditing) {
|
||||
return SizedBox(
|
||||
width: inputWidth,
|
||||
child: TextFormField(
|
||||
controller: state.controller,
|
||||
style: theme.textTheme.headlineMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
autofocus: true,
|
||||
enabled: !state.isBusy,
|
||||
decoration: InputDecoration(
|
||||
hintText: hintText,
|
||||
isDense: true,
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: theme.colorScheme.primary,
|
||||
width: borderWidth,
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final displayName = state.currentFullName.isNotEmpty ? state.currentFullName : hintText;
|
||||
return Text(
|
||||
state.currentName,
|
||||
displayName,
|
||||
style: theme.textTheme.headlineMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user