WIP: Trying to throw real errors
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
@@ -30,6 +30,7 @@ class _LoginForm extends ConsumerState<LoginForm> {
|
||||
Widget build(BuildContext context) {
|
||||
final state = ref.watch(authorizationControllerProvider);
|
||||
final controller = ref.read(authorizationControllerProvider.notifier);
|
||||
final isLoading = state.isLoading;
|
||||
return SizedBox(
|
||||
width: 400,
|
||||
child: Form(
|
||||
@@ -119,23 +120,14 @@ class _LoginForm extends ConsumerState<LoginForm> {
|
||||
width: double.infinity,
|
||||
child: Text("Forgot password?", textAlign: TextAlign.left),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: _submitForm,
|
||||
child: const Text('Log in'),
|
||||
// ) {
|
||||
// if (_formKey.currentState!.validate()) {
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// const SnackBar(content: Text('Processing Data')),
|
||||
// );
|
||||
// }
|
||||
// _
|
||||
// },
|
||||
),
|
||||
state.when(
|
||||
loading: () => const CircularProgressIndicator(),
|
||||
data: (_) => const SizedBox.shrink(),
|
||||
error: (_, _) => const SizedBox.shrink(),
|
||||
),
|
||||
ElevatedButton(onPressed: _submitForm, child: const Text('Log in')),
|
||||
if (isLoading)
|
||||
Positioned.fill(
|
||||
child: Container(
|
||||
color: Colors.black.withValues(alpha: 0.2),
|
||||
child: const Center(child: CircularProgressIndicator()),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user