lint work

This commit is contained in:
Christien Rioux 2023-07-26 14:20:29 -04:00
parent 9e4008214d
commit 6e8725f569
43 changed files with 257 additions and 332 deletions

View file

@ -6,15 +6,12 @@ class ContactsPage extends ConsumerWidget {
static const path = '/contacts';
@override
Widget build(BuildContext context, WidgetRef ref) {
return Scaffold(
appBar: null,
Widget build(BuildContext context, WidgetRef ref) => const Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text("Contacts Page"),
Text('Contacts Page'),
// ElevatedButton(
// onPressed: () async {
// ref.watch(authNotifierProvider.notifier).login(
@ -28,5 +25,4 @@ class ContactsPage extends ConsumerWidget {
),
),
);
}
}

View file

@ -6,15 +6,13 @@ class HomePage extends ConsumerWidget {
static const path = '/home';
@override
Widget build(BuildContext context, WidgetRef ref) {
return Scaffold(
appBar: AppBar(title: const Text("VeilidChat")),
body: Center(
Widget build(BuildContext context, WidgetRef ref) => Scaffold(
appBar: AppBar(title: const Text('VeilidChat')),
body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text("Home Page"),
Text('Home Page'),
// ElevatedButton(
// onPressed: () {
// ref.watch(authNotifierProvider.notifier).logout();
@ -25,5 +23,4 @@ class HomePage extends ConsumerWidget {
),
),
);
}
}

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:radix_colors/radix_colors.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:radix_colors/radix_colors.dart';
import '../tools/desktop_control.dart';
@ -30,12 +30,11 @@ class IndexPage extends StatelessWidget {
Expanded(
flex: 2,
child: SvgPicture.asset(
"assets/images/icon.svg",
'assets/images/icon.svg',
)),
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/images/title.svg",
'assets/images/title.svg',
))
]))),
));

View file

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:window_manager/window_manager.dart';
import 'package:reorderable_grid/reorderable_grid.dart';
import '../components/account_bubble.dart';
import '../providers/local_accounts.dart';
@ -41,10 +40,9 @@ class LoginPage extends ConsumerWidget {
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(height: 100, color: Color.fromARGB(255, 255, 0, 0)),
Spacer(),
Container(height: 100, color: const Color.fromARGB(255, 255, 0, 0)),
const Spacer(),
// accounts.when(
// error: (obj, err) => Text("error loading accounts: $err"),
// loading: () => CircularProgressIndicator(),
@ -58,9 +56,9 @@ class LoginPage extends ConsumerWidget {
// account: account);
// }).toList(),
// )),
AddAccountBubble(key: ValueKey("+")),
Spacer(),
Container(height: 100, color: Color.fromARGB(255, 0, 255, 0)),
const AddAccountBubble(key: ValueKey('+')),
const Spacer(),
Container(height: 100, color: const Color.fromARGB(255, 0, 255, 0)),
],
),
);

View file

@ -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));
}
}

View file

@ -6,15 +6,12 @@ class LoginPage extends ConsumerWidget {
static const path = '/settings';
@override
Widget build(BuildContext context, WidgetRef ref) {
return Scaffold(
appBar: null,
Widget build(BuildContext context, WidgetRef ref) => const Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text("Settings Page"),
Text('Settings Page'),
// ElevatedButton(
// onPressed: () async {
// ref.watch(authNotifierProvider.notifier).login(
@ -28,5 +25,4 @@ class LoginPage extends ConsumerWidget {
),
),
);
}
}