Fixes for Settings Page
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pweb/pages/settings/profile/account/name/state.dart';
|
||||
|
||||
|
||||
class AccountNameText extends StatelessWidget {
|
||||
const AccountNameText({
|
||||
super.key,
|
||||
required this.state,
|
||||
required this.hintText,
|
||||
required this.inputWidth,
|
||||
required this.borderWidth,
|
||||
});
|
||||
|
||||
final AccountNameState state;
|
||||
final String hintText;
|
||||
final double inputWidth;
|
||||
final double borderWidth;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Text(
|
||||
state.currentName,
|
||||
style: theme.textTheme.headlineMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user