Merge pull request #10 from Iconica-Development/feature/Improve_README

Updated README, added GIF, added Github Actions, fixed overflow bug w…
This commit is contained in:
FlutterJoey 2022-12-02 15:40:19 +01:00 committed by GitHub
commit badffe9538
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 198 additions and 143 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,21 +1,15 @@
[![pub package](https://img.shields.io/pub/v/flutter_introduction_widget.svg)](https://github.com/Iconica-Development) [![Build status](https://img.shields.io/github/workflow/status/Iconica-Development/flutter_login_widget/CI)](https://github.com/Iconica-Development/flutter_login_widget/actions/new) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
# Login Widget
A package facilitating the basic ingredients for creating functional yet customizable login pages A package facilitating the basic ingredients for creating functional yet customizable login pages
## Features [Login GIF](flutter_login.gif)
Create a login screen for email and password logins ## Setup
Create a forgot password screen by passing in the email from the login
## Getting started To use this package, add `flutter_login_widget` as a dependency in your pubspec.yaml file.
1. install the package by adding the following to your pubspec.yaml ## How to use
```
flutter_login:
git:
url: https://github.com/Iconica-Development/flutter_login.git
ref: 1.0.0
```
## Usage
```dart ```dart
final loginOptions = LoginOptions( final loginOptions = LoginOptions(
@ -93,3 +87,17 @@ class ForgotPasswordScreen extends StatelessWidget {
} }
``` ```
See the [Example Code](example/lib/main.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_login_widget) 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).
## Want to contribute
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](./CONTRIBUTING.md) and send us your [pull request](https://github.com/Iconica-Development/flutter_login_widget/pulls).
## Author
This `flutter_login_widget` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at <support@iconica.nl>

View file

@ -9,8 +9,10 @@ final loginOptions = LoginOptions(
), ),
emailInputPrefix: const Icon(Icons.email), emailInputPrefix: const Icon(Icons.email),
passwordInputPrefix: const Icon(Icons.password), passwordInputPrefix: const Icon(Icons.password),
title: const Text('Login'), title: const Text('Login Demo'),
image: const FlutterLogo(), image: const FlutterLogo(
size: 200,
),
requestForgotPasswordButtonBuilder: ( requestForgotPasswordButtonBuilder: (
context, context,
onPressed, onPressed,

BIN
flutter_login.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 MiB

View file

@ -65,7 +65,15 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var theme = Theme.of(context); var theme = Theme.of(context);
var options = widget.options; var options = widget.options;
return Column( return CustomScrollView(
physics: MediaQuery.of(context).viewInsets.bottom == 0
? const NeverScrollableScrollPhysics()
: null,
slivers: [
SliverFillRemaining(
fillOverscroll: true,
hasScrollBody: false,
child: Column(
children: [ children: [
if (options.title != null) ...[ if (options.title != null) ...[
const SizedBox( const SizedBox(
@ -111,7 +119,8 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
options.emailInputContainerBuilder( options.emailInputContainerBuilder(
TextFormField( TextFormField(
onChanged: _updateCurrentEmail, onChanged: _updateCurrentEmail,
validator: widget.options.validations.validateEmail, validator:
widget.options.validations.validateEmail,
initialValue: options.initialEmail, initialValue: options.initialEmail,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
@ -127,7 +136,8 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
TextFormField( TextFormField(
obscureText: _obscurePassword, obscureText: _obscurePassword,
onChanged: _updateCurrentPassword, onChanged: _updateCurrentPassword,
validator: widget.options.validations.validatePassword, validator:
widget.options.validations.validatePassword,
initialValue: options.initialPassword, initialValue: options.initialPassword,
keyboardType: TextInputType.visiblePassword, keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
@ -202,6 +212,9 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
), ),
), ),
], ],
),
),
],
); );
} }