mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-11 15:40:29 -04:00
accessibility work
This commit is contained in:
parent
be8014c97a
commit
de691cd778
48 changed files with 862 additions and 551 deletions
|
@ -53,16 +53,16 @@ class EditProfileForm extends StatefulWidget {
|
|||
..add(DiagnosticsProperty<AccountSpec>('initialValue', initialValue));
|
||||
}
|
||||
|
||||
static const String formFieldName = 'name';
|
||||
static const String formFieldPronouns = 'pronouns';
|
||||
static const String formFieldAbout = 'about';
|
||||
static const String formFieldAvailability = 'availability';
|
||||
static const String formFieldFreeMessage = 'free_message';
|
||||
static const String formFieldAwayMessage = 'away_message';
|
||||
static const String formFieldBusyMessage = 'busy_message';
|
||||
static const String formFieldAvatar = 'avatar';
|
||||
static const String formFieldAutoAway = 'auto_away';
|
||||
static const String formFieldAutoAwayTimeout = 'auto_away_timeout';
|
||||
static const formFieldName = 'name';
|
||||
static const formFieldPronouns = 'pronouns';
|
||||
static const formFieldAbout = 'about';
|
||||
static const formFieldAvailability = 'availability';
|
||||
static const formFieldFreeMessage = 'free_message';
|
||||
static const formFieldAwayMessage = 'away_message';
|
||||
static const formFieldBusyMessage = 'busy_message';
|
||||
static const formFieldAvatar = 'avatar';
|
||||
static const formFieldAutoAway = 'auto_away';
|
||||
static const formFieldAutoAwayTimeout = 'auto_away_timeout';
|
||||
}
|
||||
|
||||
class _EditProfileFormState extends State<EditProfileForm> {
|
||||
|
@ -98,6 +98,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
name: EditProfileForm.formFieldAvailability,
|
||||
initialValue: initialValue,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(8).scaled(context),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
labelText: translate('account.form_availability'),
|
||||
hintText: translate('account.empty_busy_message')),
|
||||
|
@ -110,7 +111,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
Text(x == proto.Availability.AVAILABILITY_OFFLINE
|
||||
? translate('availability.always_show_offline')
|
||||
: AvailabilityWidget.availabilityName(x))
|
||||
.paddingLTRB(8, 0, 0, 0),
|
||||
.paddingLTRB(8.scaled(context), 0, 0, 0),
|
||||
])))
|
||||
.toList(),
|
||||
);
|
||||
|
@ -197,7 +198,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
children: [
|
||||
Row(children: [
|
||||
const Spacer(),
|
||||
AvatarWidget(
|
||||
StyledAvatar(
|
||||
name: _currentValueName,
|
||||
size: 128,
|
||||
borderColor: border,
|
||||
|
@ -218,6 +219,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
});
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(8).scaled(context),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
labelText: translate('account.form_name'),
|
||||
hintText: translate('account.empty_name')),
|
||||
|
@ -233,6 +235,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
initialValue: _savedValue.pronouns,
|
||||
maxLength: 64,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(8).scaled(context),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
labelText: translate('account.form_pronouns'),
|
||||
hintText: translate('account.empty_pronouns')),
|
||||
|
@ -245,6 +248,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
maxLines: 8,
|
||||
minLines: 1,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(8).scaled(context),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
labelText: translate('account.form_about'),
|
||||
hintText: translate('account.empty_about')),
|
||||
|
@ -256,6 +260,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
initialValue: _savedValue.freeMessage,
|
||||
maxLength: 128,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(8).scaled(context),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
labelText: translate('account.form_free_message'),
|
||||
hintText: translate('account.empty_free_message')),
|
||||
|
@ -266,6 +271,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
initialValue: _savedValue.awayMessage,
|
||||
maxLength: 128,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(8).scaled(context),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
labelText: translate('account.form_away_message'),
|
||||
hintText: translate('account.empty_away_message')),
|
||||
|
@ -276,6 +282,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
initialValue: _savedValue.busyMessage,
|
||||
maxLength: 128,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(8).scaled(context),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
labelText: translate('account.form_busy_message'),
|
||||
hintText: translate('account.empty_busy_message')),
|
||||
|
@ -291,12 +298,13 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
_currentValueAutoAway = v ?? false;
|
||||
});
|
||||
},
|
||||
).paddingLTRB(0, 0, 0, 16),
|
||||
).paddingLTRB(0, 0, 0, 16.scaled(context)),
|
||||
FormBuilderTextField(
|
||||
name: EditProfileForm.formFieldAutoAwayTimeout,
|
||||
enabled: _currentValueAutoAway,
|
||||
initialValue: _savedValue.autoAwayTimeout.toString(),
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(8).scaled(context),
|
||||
labelText: translate('account.form_auto_away_timeout'),
|
||||
),
|
||||
validator: FormBuilderValidators.positiveNumber(),
|
||||
|
@ -306,7 +314,7 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
const Spacer(),
|
||||
Text(widget.instructions).toCenter().flexible(flex: 6),
|
||||
const Spacer(),
|
||||
]).paddingSymmetric(vertical: 16),
|
||||
]).paddingSymmetric(vertical: 16.scaled(context)),
|
||||
Row(children: [
|
||||
const Spacer(),
|
||||
Builder(builder: (context) {
|
||||
|
@ -322,12 +330,12 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
onPressed: (networkReady && _isModified) ? _doSubmit : null,
|
||||
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
Icon(networkReady ? Icons.check : Icons.hourglass_empty,
|
||||
size: 16)
|
||||
.paddingLTRB(0, 0, 4, 0),
|
||||
size: 16.scaled(context))
|
||||
.paddingLTRB(0, 0, 4.scaled(context), 0),
|
||||
Text(networkReady
|
||||
? widget.submitText
|
||||
: widget.submitDisabledText)
|
||||
.paddingLTRB(0, 0, 4, 0)
|
||||
.paddingLTRB(0, 0, 4.scaled(context), 0)
|
||||
]),
|
||||
);
|
||||
}),
|
||||
|
@ -363,5 +371,5 @@ class _EditProfileFormState extends State<EditProfileForm> {
|
|||
late AccountSpec _savedValue;
|
||||
late bool _currentValueAutoAway;
|
||||
late String _currentValueName;
|
||||
bool _isModified = false;
|
||||
var _isModified = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue