2022-09-20 16:32:46 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2022-09-27 16:38:12 +02:00
|
|
|
import 'package:flutter_login/flutter_login.dart';
|
2022-09-20 16:32:46 +02:00
|
|
|
|
|
|
|
void main() {
|
2022-09-27 16:38:12 +02:00
|
|
|
runApp(const LoginExample());
|
2022-09-20 16:32:46 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 16:38:12 +02:00
|
|
|
class LoginExample extends StatelessWidget {
|
|
|
|
const LoginExample({super.key});
|
2022-09-20 16:32:46 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-09-27 16:38:12 +02:00
|
|
|
return MaterialApp(
|
|
|
|
theme: ThemeData.dark(),
|
|
|
|
home: Scaffold(
|
|
|
|
body: EmailPasswordLoginForm(
|
|
|
|
options: LoginOptions(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
border: OutlineInputBorder(),
|
|
|
|
),
|
|
|
|
emailInputPrefix: Icon(Icons.email),
|
|
|
|
passwordInputPrefix: Icon(Icons.password),
|
|
|
|
title: Text('Login'),
|
|
|
|
image: FlutterLogo(),
|
|
|
|
),
|
|
|
|
// ignore: avoid_print
|
|
|
|
onLogin: (email, password) => print('$email:$password'),
|
|
|
|
onRegister: (email, password) => print('Register!'),
|
|
|
|
onForgotPassword: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
2022-09-20 16:32:46 +02:00
|
|
|
}
|
|
|
|
}
|