Updated README, added GIF, added Github Actions, Fixed example routing and layout of button

This commit is contained in:
Thomas Klein Langenhorst 2022-11-24 14:41:39 +01:00
parent d3adebdfc5
commit 8fd2a3a58f
6 changed files with 42 additions and 8 deletions

32
.github/workflows/flutter.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches:
- master
- feature/*
- bugfix/*
- hotfix/*
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
/opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Flutter pub get
run: flutter pub get
- name: Flutter format
run: flutter format -o none --set-exit-if-changed .
- name: Flutter analyze
run: flutter analyze

View file

@ -1,7 +1,10 @@
[![pub package](https://img.shields.io/pub/v/flutter_date_time_picker.svg)](https://github.com/Iconica-Development) [![Build status](https://img.shields.io/github/workflow/status/Iconica-Development/flutter_form/CI)](https://github.com/Iconica-Development/flutter_form/actions/new) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
# Flutter Form
Flutter Form is a package you can use to create a single or multi page form with premade or custom inputfields.
![Form GIF](flutter_form.gif)
## Features
- Single or multi page form with the ability to define the navigational buttons.
@ -12,12 +15,10 @@ Flutter Form is a package you can use to create a single or multi page form with
## Setup
To use this package, add `flutter_form` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/platform-integration/platform-channels).
To use this package, add `flutter_form` as a dependency in your pubspec.yaml file.
## How To Use
See the [Example Code](example/lib/form_example.dart) for an example on how to use this package.
WARNING Make sure to define your FlutterFormInputControllers above your Flutter Form and not inside each page. This prevents that the used controllers differ from the registered ones.
Flutter Form has two paramaters: options and formController. Each of these parameters' own parameters will be explained in tabels below.
@ -49,6 +50,7 @@ FormController:
| nextStep() | Called to go to the next step. This is does not do anything else like autoNextStep does do. |
| finishForm() | Calls the onFinished of the form options. |
See the [Example Code](example/lib/form_example.dart) for an example on how to use this package.
## Issues
Please file any issues, bugs or feature request as an issue on our [GitHub](https://github.com/Iconica-Development/flutter_form/pulls) page. Commercial support is available if you need help with integration with your app or services. You can contact us at [support@iconica.nl](mailto:support@iconica.nl).

View file

@ -70,7 +70,8 @@ class CheckPageExample {
title,
style: const TextStyle(
fontWeight: FontWeight.w900,
fontSize: 20,
fontSize: 16,
overflow: TextOverflow.ellipsis,
),
),
const Spacer(),

View file

@ -22,7 +22,8 @@ class ThanksPage extends StatelessWidget {
height: 20,
),
ElevatedButton(
onPressed: () => Navigator.of(context).pushNamed('/'),
onPressed: () =>
Navigator.of(context).popUntil(ModalRoute.withName('/')),
child: const Text("Next"))
],
),

View file

@ -109,7 +109,7 @@ class _FormExampleState extends ConsumerState<FormExample> {
options: FlutterFormOptions(
onFinished: (Map<int, Map<String, dynamic>> results) {
debugPrint("Final full results: $results");
Navigator.of(context).pushNamed('/thanks');
Navigator.of(context).pushReplacementNamed('/thanks');
},
onNext: (int pageNumber, Map<String, dynamic> results) {
debugPrint("Results page $pageNumber: $results");
@ -170,8 +170,6 @@ class _FormExampleState extends ConsumerState<FormExample> {
top: size.height * 0.045,
left: size.width * 0.07,
),
width: size.width * 0.08,
height: size.width * 0.08,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(90),
color: const Color(0xFFD8D8D8).withOpacity(0.50),

BIN
flutter_form.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 MiB