Skip to content

refactor(ui)!: split flutterfire_ui into multiple packages, add docs and tests #8763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- "docs/**"
- "website/**"
- "**/example/**"
- "**/flutterfire_ui/**"
- "**/cloud_firestore_odm/**"
- "**.md"
push:
Expand All @@ -20,7 +19,6 @@ on:
- "docs/**"
- "website/**"
- "**/example/**"
- "**/flutterfire_ui/**"
- "**/cloud_firestore_odm/**"
- "**.md"

Expand Down
3 changes: 1 addition & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ packages/* @ehesp @salakar @kroikie @rrousselGit @russellwheatley
website/* @ehesp
docs/* @ehesp @salakar @kroikie
.github/ @salakar @kroikie
packages/flutterfire_ui* @lesnitsky
docs/ui/* @lesnitsky
packages/firebase_ui_* @lesnitsky
30 changes: 30 additions & 0 deletions packages/firebase_ui_auth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: f4abaa0735eba4dfd8f33f73363911d63931fe03
revision: f1875d570e39de09040c8f79aa13cc56baab8db1
channel: stable

project_type: package
3 changes: 3 additions & 0 deletions packages/firebase_ui_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# FlutterFire UI
# Firebase UI Auth

[![pub package](https://img.shields.io/pub/v/flutterfire_ui.svg)](https://pub.dev/packages/flutterfire_ui)
[![pub package](https://img.shields.io/pub/v/firebase_ui_auth.svg)](https://pub.dev/packages/firebase_ui_auth)

FlutterFire UI is a set of Flutter widgets and utilities designed to help you build and integrate your user interface with Firebase.
Firebase UI Auth is a set of Flutter widgets and utilities designed to help you build and integrate your user interface with Firebase Authentication.

> FlutterFire UI is still in beta and is subject to change. Please contribute to the [discussion](https://github.com/firebase/flutterfire/discussions/6978) with feedback.
> Please contribute to the [discussion](https://github.com/firebase/flutterfire/discussions/6978) with feedback.

## Installation

```sh
flutter pub add flutterfire_ui
flutter pub add firebase_ui_auth
```

## Getting Started
Expand All @@ -19,19 +19,19 @@ Here's a quick example that shows how to build a `SignInScreen` and `ProfileScre
```dart
import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutterfire_ui/auth.dart';
import 'package:firebase_ui_auth/firebase_ui_auth.dart';

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
const providerConfigs = [EmailProviderConfiguration()];
const providers = [EmailAuthProvider()];

return MaterialApp(
initialRoute: FirebaseAuth.instance.currentUser == null ? '/sign-in' : '/profile',
routes: {
'/sign-in': (context) {
return SignInScreen(
providerConfigs: providerConfigs,
providers: providers,
actions: [
AuthStateChangeAction<SignedIn>((context, state) {
Navigator.pushReplacementNamed(context, '/profile');
Expand All @@ -41,7 +41,7 @@ class MyApp extends StatelessWidget {
},
'/profile': (context) {
return ProfileScreen(
providerConfigs: providerConfigs,
providers: providers,
actions: [
SignedOutAction((context) {
Navigator.pushReplacementNamed(context, '/sign-in');
Expand All @@ -55,22 +55,10 @@ class MyApp extends StatelessWidget {
}
```

Learn more in the [Integrating your first screen section](doc/auth/integrating-your-first-screen.md) of the documentation
Learn more in the [Getting started guide](doc/getting-started.md).

## Roadmap / Features

FlutterFire UI is still in active development.

- For issues, please create a new [issue on the repository](https://github.com/firebase/flutterfire/issues).
- For feature requests, & questions, please participate on the [discussion](https://github.com/firebase/flutterfire/discussions/6978) thread.
- To contribute a change to this plugin, please review our [contribution guide](https://github.com/firebase/flutterfire/blob/master/CONTRIBUTING.md) and open a [pull request](https://github.com/firebase/flutterfire/pulls).

Please contribute to the [discussion](https://github.com/firebase/flutterfire/discussions/6978) with feedback.

## Next Steps

Once installed, you can read the following documentation to learn more about the FlutterFire UI widgets and utilities:

- [Authentication](doc/auth.md)
- [Firestore](doc/firestore.md)
- [Realtime Database](doc/database.md)
4 changes: 4 additions & 0 deletions packages/firebase_ui_auth/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
62 changes: 62 additions & 0 deletions packages/firebase_ui_auth/doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Firebase UI for authentication

Firebase UI for authentication provides a simple and easy way to implement authentication in your Flutter app.
The library provides fully featured UI screens to drop into new or existing applications, along with
lower level abstractions for developers looking for tighter control.

## Installation

Activate FlutterFire CLI

```sh
flutter pub global activate
```

Install dependencies

```sh
flutter pub add firebase_core
flutter pub add firebase_auth
# required for email link sign in and email verification
flutter pub add firebase_dynamic_links
flutter pub add firebase_ui_auth
```

## Configuration

Configure firebase using cli:

```sh
flutterfire configure
```

Initialize firebase app:

```dart
void main() {
WidgetsFlutterBinding.ensureInitialized();

await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
}
```

## macOS entitlements

If you're building for macOS, make sure to add necessary entitlements. Learn more [from the official Flutter documentation](https://docs.flutter.dev/development/platform-integration/macos/building).

## Next steps

To understand what Firebase UI for authentication offers, the following documentation pages walk you through the various topics on
how to use the package within your Flutter app.

- Available auth providers:

- [EmaiAuthProvider](./providers/email.md) - allows to register and sign in using email and password.
- [EmailLinkAuthProvider](./providers/email-link.md) - allows to register and sign in using a link sent to email.
- [PhoneAuthProvider](./providers/phone.md) - allows to register and sign in using a phone number
- [UniversalEmailSignInProvider](./providers/universal-email-sign-in.md) - gets all connected auth providers for a given email.
- [OAuth](./providers/oauth.md)

- [Localization](../../firebase_ui_localizations/README.md)
- [Theming](./theming.md)
- [Navigation](./navigation.md)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Navigation

FlutterFire UI uses Flutter navigation capabilities to navigate between pages.
Firebase UI uses Flutter navigation capabilities to navigate between pages.

By default, it uses "Navigator 1." when a new screen needs to be shown as a result of user interaction (`Navigator.push(context, route)` is used).

Expand All @@ -18,13 +18,13 @@ First, we define the root route that checks for authentication state and renders
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
const providerConfigs = [EmailProviderConfiguration()];
const providers = [EmailProvider()];

return MaterialApp(
initialRoute: FirebaseAuth.instance.currentUser == null ? '/sign-in' : '/profile',
routes: {
'/sign-in': (context) => SignInScreen(providerConfigs: providerConfigs),
'/profile': (context) => ProfileScreen(providerConfigs: providerConfigs),
'/sign-in': (context) => SignInScreen(providers: providers),
'/profile': (context) => ProfileScreen(providers: providers),
},
);
}
Expand Down Expand Up @@ -68,14 +68,14 @@ navigate to a named route, provide the `actions` list with a `ForgotPasswordActi
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
const providerConfigs = [EmailProviderConfiguration()];
const providers = [EmailProvider()];

return MaterialApp(
initialRoute: FirebaseAuth.instance.currentUser == null ? '/sign-in' : '/profile',
routes: {
'/sign-in': (context) {
return SignInScreen(
providerConfigs: providerConfigs,
providers: providers,
actions: [
ForgotPasswordAction((context, email) {
Navigator.of(context).pushNamed(
Expand All @@ -86,12 +86,24 @@ class MyApp extends StatelessWidget {
],
);
},
'/profile': (context) => ProfileScreen(providerConfigs: providerConfigs),
'/profile': (context) => ProfileScreen(providers: providers),
'/forgot-password': (context) => MyCustomForgotPasswordScreen(),
},
);
}
}
```

To learn more about the available actions, check out the [FlutterFireUIActions API reference](https://pub.dev/documentation/flutterfire_ui/latest/auth/FlutterFireUIActions-class.html).
To learn more about the available actions, check out the [FirebaseUIActions API reference](https://pub.dev/documentation/firebase_ui_auth/latest/firebase_ui_auth/FirebaseUIActions-class.html).

## Other topics

## Other topics

- [EmaiAuthProvider](./providers/email.md) - allows to register and sign in using email and password.
- [EmailLinkAuthProvider](./providers/email-link.md) - allows to register and sign in using a link sent to email.
- [PhoneAuthProvider](./providers/phone.md) - allows to register and sign in using a phone number
- [UniversalEmailSignInProvider](./providers/universal-email-sign-in.md) - gets all connected auth providers for a given email.
- [OAuth](./providers/oauth.md)
- [Localization](../../firebase_ui_localizations/README.md)
- [Theming](./theming.md)
Loading