mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-23 14:40:58 -04:00
lint work
This commit is contained in:
parent
9e4008214d
commit
6e8725f569
43 changed files with 257 additions and 332 deletions
|
@ -1,8 +1,8 @@
|
|||
import 'package:awesome_extensions/awesome_extensions.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_translate/flutter_translate.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:quickalert/quickalert.dart';
|
||||
|
||||
|
@ -18,16 +18,14 @@ class NewAccountPage extends ConsumerStatefulWidget {
|
|||
static const path = '/new_account';
|
||||
|
||||
@override
|
||||
NewAccountPageState createState() {
|
||||
return NewAccountPageState();
|
||||
}
|
||||
NewAccountPageState createState() => NewAccountPageState();
|
||||
}
|
||||
|
||||
class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
||||
final _formKey = GlobalKey<FormBuilderState>();
|
||||
late bool isInAsyncCall = false;
|
||||
static const String formFieldName = "name";
|
||||
static const String formFieldTitle = "title";
|
||||
static const String formFieldName = 'name';
|
||||
static const String formFieldTitle = 'title';
|
||||
|
||||
Future<void> createAccount() async {
|
||||
final imws = await newIdentityMaster();
|
||||
|
@ -56,19 +54,18 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
}
|
||||
|
||||
Widget _newAccountForm(BuildContext context,
|
||||
{required Future<void> Function(GlobalKey<FormBuilderState>) onSubmit}) {
|
||||
return FormBuilder(
|
||||
{required Future<void> Function(GlobalKey<FormBuilderState>) onSubmit}) => FormBuilder(
|
||||
key: _formKey,
|
||||
child: ListView(
|
||||
children: [
|
||||
Text(translate("new_account_page.header"))
|
||||
Text(translate('new_account_page.header'))
|
||||
.textStyle(context.headlineSmall)
|
||||
.paddingSymmetric(vertical: 16),
|
||||
FormBuilderTextField(
|
||||
autofocus: true,
|
||||
name: formFieldName,
|
||||
decoration:
|
||||
InputDecoration(hintText: translate("account.form_name")),
|
||||
InputDecoration(hintText: translate('account.form_name')),
|
||||
maxLength: 64,
|
||||
// The validator receives the text that the user has entered.
|
||||
validator: FormBuilderValidators.compose([
|
||||
|
@ -79,11 +76,11 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
name: formFieldTitle,
|
||||
maxLength: 64,
|
||||
decoration:
|
||||
InputDecoration(hintText: translate("account.form_title")),
|
||||
InputDecoration(hintText: translate('account.form_title')),
|
||||
),
|
||||
Row(children: [
|
||||
const Spacer(),
|
||||
Text(translate("new_account_page.instructions"))
|
||||
Text(translate('new_account_page.instructions'))
|
||||
.toCenter()
|
||||
.flexible(flex: 6),
|
||||
const Spacer(),
|
||||
|
@ -108,7 +105,6 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -121,7 +117,7 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
return Scaffold(
|
||||
// resizeToAvoidBottomInset: false,
|
||||
appBar: DefaultAppBar(context,
|
||||
title: Text(translate("new_account_page.titlebar"))),
|
||||
title: Text(translate('new_account_page.titlebar'))),
|
||||
body: _newAccountForm(
|
||||
context,
|
||||
onSubmit: (formKey) async {
|
||||
|
@ -130,11 +126,11 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
try {
|
||||
await createAccount();
|
||||
} catch (e) {
|
||||
QuickAlert.show(
|
||||
await QuickAlert.show(
|
||||
context: context,
|
||||
type: QuickAlertType.error,
|
||||
title: translate("new_account_page.error"),
|
||||
text: 'Exception: ${e.toString()}',
|
||||
title: translate('new_account_page.error'),
|
||||
text: 'Exception: $e',
|
||||
//backgroundColor: Colors.black,
|
||||
//titleColor: Colors.white,
|
||||
//textColor: Colors.white,
|
||||
|
@ -144,4 +140,9 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
).paddingSymmetric(horizontal: 24, vertical: 8),
|
||||
).withModalHUD(context, displayModalHUD);
|
||||
}
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties.add(DiagnosticsProperty<bool>('isInAsyncCall', isInAsyncCall));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue