chore: add readme description and versioning

This commit is contained in:
Joey Boerwinkel 2022-09-30 12:28:41 +02:00
parent c84ce5db22
commit c4f66f3c69
3 changed files with 89 additions and 33 deletions

112
README.md
View file

@ -1,39 +1,95 @@
<!-- A package facilitating the basic ingredients for creating functional yet customizable login pages
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
## Features ## Features
TODO: List what your package can do. Maybe include images, gifs, or videos. Create a login screen for email and password logins
Create a forgot password screen by passing in the email from the login
## Getting started ## Getting started
TODO: List prerequisites and provide or point to information on how to 1. install the package by adding the following to your pubspec.yaml
start using the package. ```
flutter_login:
git:
url: https://github.com/Iconica-Development/flutter_login.git
ref: 1.0.0
```
## Usage ## Usage
TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
```dart ```dart
const like = 'sample'; final loginOptions = LoginOptions(
decoration: const InputDecoration(
border: OutlineInputBorder(),
),
emailInputPrefix: const Icon(Icons.email),
passwordInputPrefix: const Icon(Icons.password),
title: const Text('Login'),
image: const FlutterLogo(),
requestForgotPasswordButtonBuilder: (context, onPressed, isDisabled) {
return Opacity(
opacity: isDisabled ? 0.5 : 1.0,
child: ElevatedButton(
onPressed: onPressed,
child: const Text('Send request'),
),
);
},
);
class LoginExample extends StatelessWidget {
const LoginExample({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark(),
home: LoginScreen(),
);
}
}
class LoginScreen extends StatelessWidget {
const LoginScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: EmailPasswordLoginForm(
options: loginOptions,
onLogin: (email, password) => print('$email:$password'),
onRegister: (email, password) => print('Register!'),
onForgotPassword: (email) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return const ForgotPasswordScreen();
},
),
);
},
),
);
}
}
class ForgotPasswordScreen extends StatelessWidget {
const ForgotPasswordScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: ForgotPasswordForm(
options: loginOptions,
title: Text('Forgot password'),
description: Text('Hello world'),
onRequestForgotPassword: (email) {
print('Forgot password email sent to $email');
},
),
);
}
}
``` ```
## Additional information
TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.

View file

@ -33,7 +33,7 @@ class LoginExample extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData.dark(), theme: ThemeData.dark(),
home: LoginScreen(), home: const LoginScreen(),
); );
} }
} }
@ -71,8 +71,8 @@ class ForgotPasswordScreen extends StatelessWidget {
appBar: AppBar(), appBar: AppBar(),
body: ForgotPasswordForm( body: ForgotPasswordForm(
options: loginOptions, options: loginOptions,
title: Text('Forgot password'), title: const Text('Forgot password'),
description: Text('Hello world'), description: const Text('Hello world'),
onRequestForgotPassword: (email) { onRequestForgotPassword: (email) {
print('Forgot password email sent to $email'); print('Forgot password email sent to $email');
}, },

View file

@ -1,9 +1,9 @@
name: flutter_login name: flutter_login
description: A new Flutter package project. description: A new Flutter package project.
version: 0.0.1 version: 1.0.0
environment: environment:
sdk: '>=2.18.1 <3.0.0' sdk: ">=2.18.1 <3.0.0"
flutter: ">=1.17.0" flutter: ">=1.17.0"
dependencies: dependencies: