Skip to content

Commit

Permalink
Commit from GitHub Actions (Forui Samples Presubmit)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Jul 2, 2024
1 parent c825e75 commit cbad283
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions samples/lib/widgets/checkbox.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/widgets.dart';

import 'package:auto_route/auto_route.dart';
import 'package:forui/forui.dart';

import 'package:forui_samples/sample_scaffold.dart';

@RoutePage()
Expand All @@ -14,31 +16,29 @@ class CheckboxPage extends SampleScaffold {

@override
Widget child(BuildContext context) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 30),
child: FCheckbox(
enabled: enabled,
),
),
],
);
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 30),
child: FCheckbox(
enabled: enabled,
),
),
],
);
}

@RoutePage()
class FormCheckboxPage extends SampleScaffold {

FormCheckboxPage({
@queryParam super.theme,
});

@override
Widget child(BuildContext context) => const Padding(
padding: EdgeInsets.all(15.0),
child: LoginForm(),
);

padding: EdgeInsets.all(15.0),
child: LoginForm(),
);
}

class LoginForm extends StatefulWidget {
Expand All @@ -58,35 +58,35 @@ class _LoginFormState extends State<LoginForm> {

@override
Widget build(BuildContext context) => Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FTextField.email(
hint: '[email protected]',
help: const Text(''),
validator: (value) => (value?.contains('@') ?? false) ? null : 'Please enter a valid email.',
),
const SizedBox(height: 4),
FTextField.password(
hint: '',
help: const Text(''),
validator: (value) => 8 <= (value?.length ?? 0) ? null : 'Password must be at least 8 characters long.',
),
const SizedBox(height: 4),
Row(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const FCheckbox(),
const SizedBox(width: 7),
Text('Remember password?', style: context.theme.typography.sm),
FTextField.email(
hint: '[email protected]',
help: const Text(''),
validator: (value) => (value?.contains('@') ?? false) ? null : 'Please enter a valid email.',
),
const SizedBox(height: 4),
FTextField.password(
hint: '',
help: const Text(''),
validator: (value) => 8 <= (value?.length ?? 0) ? null : 'Password must be at least 8 characters long.',
),
const SizedBox(height: 4),
Row(
children: [
const FCheckbox(),
const SizedBox(width: 7),
Text('Remember password?', style: context.theme.typography.sm),
],
),
const SizedBox(height: 30),
FButton(
label: const Text('Login'),
onPress: () => _formKey.currentState!.validate(),
),
],
),
const SizedBox(height: 30),
FButton(
label: const Text('Login'),
onPress: () => _formKey.currentState!.validate(),
),
],
),
);
);
}

0 comments on commit cbad283

Please sign in to comment.