diff --git a/.gitignore b/.gitignore index 24476c5..938bb9c 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,14 @@ migrate_working_dir/ .pub-cache/ .pub/ /build/ +apps/*/build/ +packages/*/build/ + +# generated dart files +**/*.freezed.dart +**/*.g.dart +**/*.gr.dart +injection.config.dart # Symbolication related app.*.symbols diff --git a/README.md b/apps/main/README.md similarity index 100% rename from README.md rename to apps/main/README.md diff --git a/analysis_options.yaml b/apps/main/analysis_options.yaml similarity index 100% rename from analysis_options.yaml rename to apps/main/analysis_options.yaml diff --git a/android/.gitignore b/apps/main/android/.gitignore similarity index 100% rename from android/.gitignore rename to apps/main/android/.gitignore diff --git a/android/app/build.gradle b/apps/main/android/app/build.gradle similarity index 100% rename from android/app/build.gradle rename to apps/main/android/app/build.gradle diff --git a/android/app/src/debug/AndroidManifest.xml b/apps/main/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from android/app/src/debug/AndroidManifest.xml rename to apps/main/android/app/src/debug/AndroidManifest.xml diff --git a/android/app/src/main/AndroidManifest.xml b/apps/main/android/app/src/main/AndroidManifest.xml similarity index 100% rename from android/app/src/main/AndroidManifest.xml rename to apps/main/android/app/src/main/AndroidManifest.xml diff --git a/android/app/src/main/kotlin/com/example/flutter_bootstrap/MainActivity.kt b/apps/main/android/app/src/main/kotlin/com/example/flutter_bootstrap/MainActivity.kt similarity index 100% rename from android/app/src/main/kotlin/com/example/flutter_bootstrap/MainActivity.kt rename to apps/main/android/app/src/main/kotlin/com/example/flutter_bootstrap/MainActivity.kt diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/apps/main/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from android/app/src/main/res/drawable-v21/launch_background.xml rename to apps/main/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/android/app/src/main/res/drawable/launch_background.xml b/apps/main/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from android/app/src/main/res/drawable/launch_background.xml rename to apps/main/android/app/src/main/res/drawable/launch_background.xml diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/main/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to apps/main/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/main/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to apps/main/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/main/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to apps/main/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/main/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to apps/main/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/main/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to apps/main/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/values-night/styles.xml b/apps/main/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from android/app/src/main/res/values-night/styles.xml rename to apps/main/android/app/src/main/res/values-night/styles.xml diff --git a/android/app/src/main/res/values/styles.xml b/apps/main/android/app/src/main/res/values/styles.xml similarity index 100% rename from android/app/src/main/res/values/styles.xml rename to apps/main/android/app/src/main/res/values/styles.xml diff --git a/android/app/src/profile/AndroidManifest.xml b/apps/main/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from android/app/src/profile/AndroidManifest.xml rename to apps/main/android/app/src/profile/AndroidManifest.xml diff --git a/android/build.gradle b/apps/main/android/build.gradle similarity index 100% rename from android/build.gradle rename to apps/main/android/build.gradle diff --git a/android/gradle.properties b/apps/main/android/gradle.properties similarity index 100% rename from android/gradle.properties rename to apps/main/android/gradle.properties diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/apps/main/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from android/gradle/wrapper/gradle-wrapper.properties rename to apps/main/android/gradle/wrapper/gradle-wrapper.properties diff --git a/android/settings.gradle b/apps/main/android/settings.gradle similarity index 100% rename from android/settings.gradle rename to apps/main/android/settings.gradle diff --git a/ios/.gitignore b/apps/main/ios/.gitignore similarity index 100% rename from ios/.gitignore rename to apps/main/ios/.gitignore diff --git a/ios/Flutter/AppFrameworkInfo.plist b/apps/main/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from ios/Flutter/AppFrameworkInfo.plist rename to apps/main/ios/Flutter/AppFrameworkInfo.plist diff --git a/ios/Flutter/Debug.xcconfig b/apps/main/ios/Flutter/Debug.xcconfig similarity index 100% rename from ios/Flutter/Debug.xcconfig rename to apps/main/ios/Flutter/Debug.xcconfig diff --git a/ios/Flutter/Release.xcconfig b/apps/main/ios/Flutter/Release.xcconfig similarity index 100% rename from ios/Flutter/Release.xcconfig rename to apps/main/ios/Flutter/Release.xcconfig diff --git a/ios/Podfile b/apps/main/ios/Podfile similarity index 100% rename from ios/Podfile rename to apps/main/ios/Podfile diff --git a/ios/Podfile.lock b/apps/main/ios/Podfile.lock similarity index 93% rename from ios/Podfile.lock rename to apps/main/ios/Podfile.lock index 6467694..cf906da 100644 --- a/ios/Podfile.lock +++ b/apps/main/ios/Podfile.lock @@ -4,11 +4,11 @@ PODS: - FirebaseAuth (~> 10.3.0) - Firebase/CoreOnly (10.3.0): - FirebaseCore (= 10.3.0) - - firebase_auth (4.2.9): + - firebase_auth (4.2.10): - Firebase/Auth (= 10.3.0) - firebase_core - Flutter - - firebase_core (2.7.0): + - firebase_core (2.7.1): - Firebase/CoreOnly (= 10.3.0) - Flutter - FirebaseAuth (10.3.0): @@ -66,8 +66,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Firebase: f92fc551ead69c94168d36c2b26188263860acd9 - firebase_auth: 4e8c693e848ed13b263de2d702d55fa82ed04a79 - firebase_core: 128d8c43c3a453a4a67463314fc3761bedff860b + firebase_auth: e94093901bee37bdba241fd8647c1d3ea6f55c8b + firebase_core: 1ae9f9aa76e6e1edc14fb181637ad466fd6c6fa4 FirebaseAuth: 0e415d29d846c1dce2fb641e46f35e9888d9bec6 FirebaseCore: 988754646ab3bd4bdcb740f1bfe26b9f6c0d5f2a FirebaseCoreInternal: e301297f4c15a17489e48ed722d733b1578e0c02 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/apps/main/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from ios/Runner.xcodeproj/project.pbxproj rename to apps/main/ios/Runner.xcodeproj/project.pbxproj diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/apps/main/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to apps/main/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/main/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/main/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/main/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to apps/main/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/main/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to apps/main/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/apps/main/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from ios/Runner.xcworkspace/contents.xcworkspacedata rename to apps/main/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/main/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/main/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/main/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to apps/main/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/ios/Runner/AppDelegate.swift b/apps/main/ios/Runner/AppDelegate.swift similarity index 100% rename from ios/Runner/AppDelegate.swift rename to apps/main/ios/Runner/AppDelegate.swift diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to apps/main/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to apps/main/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/apps/main/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from ios/Runner/Base.lproj/LaunchScreen.storyboard rename to apps/main/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/ios/Runner/Base.lproj/Main.storyboard b/apps/main/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from ios/Runner/Base.lproj/Main.storyboard rename to apps/main/ios/Runner/Base.lproj/Main.storyboard diff --git a/ios/Runner/Info.plist b/apps/main/ios/Runner/Info.plist similarity index 100% rename from ios/Runner/Info.plist rename to apps/main/ios/Runner/Info.plist diff --git a/ios/Runner/Runner-Bridging-Header.h b/apps/main/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from ios/Runner/Runner-Bridging-Header.h rename to apps/main/ios/Runner/Runner-Bridging-Header.h diff --git a/apps/main/lib/app_router.dart b/apps/main/lib/app_router.dart new file mode 100644 index 0000000..90e8e8c --- /dev/null +++ b/apps/main/lib/app_router.dart @@ -0,0 +1,78 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:auto_route/auto_route.dart'; +import 'package:flutter_bootstrap/data/repositories/auth.dart'; +import 'package:injectable/injectable.dart'; + +import 'bloc/auth_bloc.dart'; +import 'pages/login.dart'; +import 'pages/home.dart'; +import 'pages/profile.dart'; + +part 'app_router.gr.dart'; + +@Injectable() +class AuthGuard extends AutoRedirectGuard { + final AuthBloc authBloc; + final AuthRepository authRepository; + late final StreamSubscription _stream; + + AuthGuard(this.authBloc, this.authRepository) { + _stream = authBloc.stream.listen((state) { + state.maybeMap( + orElse: () { + reevaluate(); + }, + loaded: (_) {}, + ); + }); + } + + @override + void dispose() { + _stream.cancel(); + super.dispose(); + } + + @override + void onNavigation(NavigationResolver resolver, StackRouter router) { + authBloc.state.maybeMap( + orElse: () { + if (authRepository.getUser() == null) { + router.push( + LoginRoute(authBloc: authBloc, authRepository: authRepository)); + } else { + resolver.next(true); + } + }, + loading: (_) => {}, + loaded: (_) => resolver.next(true)); + } + + @override + Future canNavigate(RouteMatch route) { + return Future.value(authBloc.state is Loaded); + } +} + +@MaterialAutoRouter( + replaceInRouteName: 'Page,Route', + routes: [ + AutoRoute( + initial: true, + guards: [AuthGuard], + page: HomePage, + children: [ + AutoRoute(page: ProfilePage), + ], + ), + AutoRoute( + page: LoginPage, + ), + ], +) +@Injectable() +class AppRouter extends _$AppRouter { + AppRouter({required super.authGuard}); +} diff --git a/apps/main/lib/bloc/auth_bloc.dart b/apps/main/lib/bloc/auth_bloc.dart new file mode 100644 index 0000000..44ebd87 --- /dev/null +++ b/apps/main/lib/bloc/auth_bloc.dart @@ -0,0 +1,45 @@ +import 'package:bloc/bloc.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:injectable/injectable.dart'; + +import '../data/repositories/auth.dart'; + +part 'auth_event.dart'; +part 'auth_state.dart'; +part 'auth_bloc.freezed.dart'; + +@singleton +class AuthBloc extends Bloc { + final AuthRepository authRepository; + + AuthBloc(this.authRepository) : super(const Initial()) { + on<_Started>((event, emit) { + // nothing here for now + }); + + on<_SignIn>((event, emit) async { + emit(const Loading()); + + await authRepository.signInWithEmailAndPassword( + email: event.email, password: event.password); + + if (authRepository.getUser() != null) { + emit(const Loaded()); + } else { + emit(const Errored()); + } + }); + + on<_Logout>((event, emit) async { + await authRepository.signOut(); + + emit(const Initial()); + }); + + @disposeMethod + // ignore: unused_element + void dispose() { + close(); + } + } +} diff --git a/apps/main/lib/bloc/auth_event.dart b/apps/main/lib/bloc/auth_event.dart new file mode 100644 index 0000000..dd8c607 --- /dev/null +++ b/apps/main/lib/bloc/auth_event.dart @@ -0,0 +1,13 @@ +part of 'auth_bloc.dart'; + +@freezed +class AuthEvent with _$AuthEvent { + const factory AuthEvent.started() = _Started; + + const factory AuthEvent.signIn({ + email, + password + }) = _SignIn; + + const factory AuthEvent.logout() = _Logout; +} diff --git a/apps/main/lib/bloc/auth_state.dart b/apps/main/lib/bloc/auth_state.dart new file mode 100644 index 0000000..2feaae4 --- /dev/null +++ b/apps/main/lib/bloc/auth_state.dart @@ -0,0 +1,12 @@ +part of 'auth_bloc.dart'; + +@freezed +class AuthState with _$AuthState { + const factory AuthState.initial() = Initial; + + const factory AuthState.loading() = Loading; + + const factory AuthState.loaded() = Loaded; + + const factory AuthState.error() = Errored; +} diff --git a/lib/components/app_drawer.dart b/apps/main/lib/components/app_drawer.dart similarity index 76% rename from lib/components/app_drawer.dart rename to apps/main/lib/components/app_drawer.dart index 1437741..82931ee 100644 --- a/lib/components/app_drawer.dart +++ b/apps/main/lib/components/app_drawer.dart @@ -1,25 +1,23 @@ -import 'package:auth/auth.dart'; import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import '../bloc/auth_bloc.dart'; import '../app_router.dart'; -import '../data/repositories/auth_facade.dart'; -// statefull app drawer class AppDrawer extends StatefulWidget { - const AppDrawer({Key? key}) : super(key: key); + final AuthBloc _authBloc; + + const AppDrawer({Key? key, required AuthBloc authBloc}) + : _authBloc = authBloc, + super(key: key); @override State createState() => _AppDrawerState(); } class _AppDrawerState extends State { - final _authFacade = AuthFacade(); - - void signOut(BuildContext context) async { - await _authFacade.signOut(); - - context.router.push(const LoginRoute()); + void signOut(BuildContext context) { + widget._authBloc.add(const AuthEvent.logout()); } @override diff --git a/lib/data/models/user.dart b/apps/main/lib/data/models/user.dart similarity index 100% rename from lib/data/models/user.dart rename to apps/main/lib/data/models/user.dart diff --git a/apps/main/lib/data/repositories/auth.dart b/apps/main/lib/data/repositories/auth.dart new file mode 100644 index 0000000..319de92 --- /dev/null +++ b/apps/main/lib/data/repositories/auth.dart @@ -0,0 +1,35 @@ +import 'package:authentication/authentication.dart'; +import 'package:firebase_authentication/firebase_authentication.dart'; +import 'package:injectable/injectable.dart'; + +import '../models/user.dart'; + +@Injectable() +class AuthRepository extends FirebaseAuthentication implements Authentication { + User? getUser() { + final user = super.currentUser; + + return user == null + ? null + : User(id: user.uid, email: user.email, username: user.displayName); + } + + @override + Future signInWithEmailAndPassword( + {required String email, required String password}) async { + + return await super.signInWithEmailAndPassword(email: email, password: password); + } + + @override + Future createUserWithEmailAndPassword( + {required String email, required String password}) async { + + return await super.createUserWithEmailAndPassword(email: email, password: password); + } + + @override + Future signOut() async { + return await super.signOut(); + } +} diff --git a/lib/injection.dart b/apps/main/lib/injection.dart similarity index 51% rename from lib/injection.dart rename to apps/main/lib/injection.dart index a822cb8..4714e35 100644 --- a/lib/injection.dart +++ b/apps/main/lib/injection.dart @@ -2,7 +2,6 @@ import 'package:get_it/get_it.dart'; import 'package:injectable/injectable.dart'; import 'injection.config.dart'; -import 'services/firebase_auth.dart'; final getIt = GetIt.instance; @@ -11,10 +10,6 @@ final getIt = GetIt.instance; preferRelativeImports: true, asExtension: false, ) -Future configureDependencies() async => await $initGetIt(getIt); -@module -abstract class AppModule { - @preResolve - Future get authService => FirebaseAuthService.init(); -} +void configureDependencies() async => $initGetIt(getIt); + diff --git a/lib/main.dart b/apps/main/lib/main.dart similarity index 51% rename from lib/main.dart rename to apps/main/lib/main.dart index 8f89087..95bd286 100644 --- a/lib/main.dart +++ b/apps/main/lib/main.dart @@ -1,6 +1,6 @@ +import 'package:firebase_authentication/firebase_authentication.dart'; import 'package:flutter/material.dart'; - -import 'package:flutter_bootstrap/data/repositories/auth_facade.dart'; +import 'package:injectable/injectable.dart'; import 'injection.dart'; import 'app_router.dart'; @@ -8,19 +8,19 @@ import 'app_router.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - await configureDependencies(); - - // TODO: use a guard to redirect to home if logged in - final authFacade = AuthFacade(); - await authFacade.signOut(); + configureDependencies(); + await FirebaseAuthentication.initialize(); - runApp(MyApp()); + runApp(MyApp(appRouter: getIt())); } +@Injectable() class MyApp extends StatelessWidget { - MyApp({super.key}); + final AppRouter _appRouter; - final _appRouter = AppRouter(); + const MyApp({Key? key, required AppRouter appRouter}) + : _appRouter = appRouter, + super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/home.dart b/apps/main/lib/pages/home.dart similarity index 85% rename from lib/pages/home.dart rename to apps/main/lib/pages/home.dart index d3bb32a..b6a9802 100644 --- a/lib/pages/home.dart +++ b/apps/main/lib/pages/home.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:flutter_bootstrap/bloc/auth_bloc.dart'; import '../components/app_drawer.dart'; +import '../injection.dart'; class HomePage extends StatefulWidget { const HomePage({Key? key}) : super(key: key); @@ -22,7 +24,7 @@ class _HomePageState extends State { onPressed: () { Navigator.of(context).pop(); }, - child: Text('OK')), + child: const Text('OK')), ], ); }, @@ -35,7 +37,7 @@ class _HomePageState extends State { appBar: AppBar( title: const Text('Home'), ), - drawer: const AppDrawer(), + drawer: AppDrawer(authBloc: getIt()), body: Center( child: ElevatedButton( onPressed: () { diff --git a/apps/main/lib/pages/login.dart b/apps/main/lib/pages/login.dart new file mode 100644 index 0000000..0095da3 --- /dev/null +++ b/apps/main/lib/pages/login.dart @@ -0,0 +1,117 @@ +import 'package:flutter/material.dart'; +import 'package:auto_route/auto_route.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_bootstrap/data/repositories/auth.dart'; +import 'package:injectable/injectable.dart'; + +import '../bloc/auth_bloc.dart'; +import '../app_router.dart'; + +@Injectable() +class LoginPage extends StatefulWidget { + final AuthBloc authBloc; + final AuthRepository authRepository; + + const LoginPage( + {Key? key, required this.authBloc, required this.authRepository}) + : super(key: key); + + @override + State createState() => _LoginState(); +} + +// login form in dart +class _LoginState extends State { + final _formKey = GlobalKey(); + final _emailController = TextEditingController(); + final _passwordController = TextEditingController(); + + // async function to login + Future login(BuildContext context, AuthState state) async { + context.read().add(AuthEvent.signIn( + email: _emailController.text, password: _passwordController.text)); + } + + @override + Widget build(BuildContext context) { + return MultiBlocProvider( + providers: [ + BlocProvider.value( + value: widget.authBloc..add(const AuthEvent.started())) + ], + child: Scaffold( + appBar: AppBar( + title: const Text('Login'), + ), + body: Form( + key: _formKey, + child: BlocListener(listener: (context, state) { + state.maybeMap( + orElse: () {}, + loaded: (_) => context.router.replace(const HomeRoute()), + error: (state) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text('Login failed'), + backgroundColor: Colors.red, + ), + ); + }, + ); + }, child: BlocBuilder( + builder: (context, state) { + return Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + children: [ + TextFormField( + controller: _emailController, + decoration: const InputDecoration( + labelText: 'Email', + ), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter some text'; + } + return null; + }, + ), + TextFormField( + controller: _passwordController, + decoration: const InputDecoration( + labelText: 'Password', + ), + obscureText: true, + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter some text'; + } + return null; + }, + ), + state.maybeMap( + orElse: () => ElevatedButton( + onPressed: () { + if (_formKey.currentState!.validate()) { + login(context, state); + } + }, + child: const Text('Submit'), + ), + loading: (_) => const Center( + child: Padding( + padding: EdgeInsets.all(8.0), + child: CircularProgressIndicator(), + ), + ), + ), + ], + ), + ); + }, + )), + ), + ), + ); + } +} diff --git a/lib/pages/profile.dart b/apps/main/lib/pages/profile.dart similarity index 82% rename from lib/pages/profile.dart rename to apps/main/lib/pages/profile.dart index 200b8e5..02afb6b 100644 --- a/lib/pages/profile.dart +++ b/apps/main/lib/pages/profile.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; +import '../bloc/auth_bloc.dart'; import '../components/app_drawer.dart'; +import '../injection.dart'; class ProfilePage extends StatefulWidget { const ProfilePage({Key? key}) : super(key: key); @@ -16,7 +18,7 @@ class _ProfilePageState extends State { appBar: AppBar( title: const Text('Profile'), ), - drawer: const AppDrawer(), + drawer: AppDrawer(authBloc: getIt()), body: const Center( child: Text('Your profile!'), ), diff --git a/linux/.gitignore b/apps/main/linux/.gitignore similarity index 100% rename from linux/.gitignore rename to apps/main/linux/.gitignore diff --git a/linux/CMakeLists.txt b/apps/main/linux/CMakeLists.txt similarity index 100% rename from linux/CMakeLists.txt rename to apps/main/linux/CMakeLists.txt diff --git a/linux/flutter/CMakeLists.txt b/apps/main/linux/flutter/CMakeLists.txt similarity index 100% rename from linux/flutter/CMakeLists.txt rename to apps/main/linux/flutter/CMakeLists.txt diff --git a/linux/flutter/generated_plugin_registrant.cc b/apps/main/linux/flutter/generated_plugin_registrant.cc similarity index 100% rename from linux/flutter/generated_plugin_registrant.cc rename to apps/main/linux/flutter/generated_plugin_registrant.cc diff --git a/linux/flutter/generated_plugin_registrant.h b/apps/main/linux/flutter/generated_plugin_registrant.h similarity index 100% rename from linux/flutter/generated_plugin_registrant.h rename to apps/main/linux/flutter/generated_plugin_registrant.h diff --git a/linux/flutter/generated_plugins.cmake b/apps/main/linux/flutter/generated_plugins.cmake similarity index 100% rename from linux/flutter/generated_plugins.cmake rename to apps/main/linux/flutter/generated_plugins.cmake diff --git a/linux/main.cc b/apps/main/linux/main.cc similarity index 100% rename from linux/main.cc rename to apps/main/linux/main.cc diff --git a/linux/my_application.cc b/apps/main/linux/my_application.cc similarity index 100% rename from linux/my_application.cc rename to apps/main/linux/my_application.cc diff --git a/linux/my_application.h b/apps/main/linux/my_application.h similarity index 100% rename from linux/my_application.h rename to apps/main/linux/my_application.h diff --git a/macos/.gitignore b/apps/main/macos/.gitignore similarity index 100% rename from macos/.gitignore rename to apps/main/macos/.gitignore diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/apps/main/macos/Flutter/Flutter-Debug.xcconfig similarity index 100% rename from macos/Flutter/Flutter-Debug.xcconfig rename to apps/main/macos/Flutter/Flutter-Debug.xcconfig diff --git a/macos/Flutter/Flutter-Release.xcconfig b/apps/main/macos/Flutter/Flutter-Release.xcconfig similarity index 100% rename from macos/Flutter/Flutter-Release.xcconfig rename to apps/main/macos/Flutter/Flutter-Release.xcconfig diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/apps/main/macos/Flutter/GeneratedPluginRegistrant.swift similarity index 100% rename from macos/Flutter/GeneratedPluginRegistrant.swift rename to apps/main/macos/Flutter/GeneratedPluginRegistrant.swift diff --git a/macos/Podfile b/apps/main/macos/Podfile similarity index 100% rename from macos/Podfile rename to apps/main/macos/Podfile diff --git a/macos/Runner.xcodeproj/project.pbxproj b/apps/main/macos/Runner.xcodeproj/project.pbxproj similarity index 100% rename from macos/Runner.xcodeproj/project.pbxproj rename to apps/main/macos/Runner.xcodeproj/project.pbxproj diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/main/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/main/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/main/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to apps/main/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/apps/main/macos/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from macos/Runner.xcworkspace/contents.xcworkspacedata rename to apps/main/macos/Runner.xcworkspace/contents.xcworkspacedata diff --git a/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/main/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/main/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/macos/Runner/AppDelegate.swift b/apps/main/macos/Runner/AppDelegate.swift similarity index 100% rename from macos/Runner/AppDelegate.swift rename to apps/main/macos/Runner/AppDelegate.swift diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png rename to apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png rename to apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png rename to apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png rename to apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png rename to apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png rename to apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png rename to apps/main/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/apps/main/macos/Runner/Base.lproj/MainMenu.xib similarity index 100% rename from macos/Runner/Base.lproj/MainMenu.xib rename to apps/main/macos/Runner/Base.lproj/MainMenu.xib diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/apps/main/macos/Runner/Configs/AppInfo.xcconfig similarity index 100% rename from macos/Runner/Configs/AppInfo.xcconfig rename to apps/main/macos/Runner/Configs/AppInfo.xcconfig diff --git a/macos/Runner/Configs/Debug.xcconfig b/apps/main/macos/Runner/Configs/Debug.xcconfig similarity index 100% rename from macos/Runner/Configs/Debug.xcconfig rename to apps/main/macos/Runner/Configs/Debug.xcconfig diff --git a/macos/Runner/Configs/Release.xcconfig b/apps/main/macos/Runner/Configs/Release.xcconfig similarity index 100% rename from macos/Runner/Configs/Release.xcconfig rename to apps/main/macos/Runner/Configs/Release.xcconfig diff --git a/macos/Runner/Configs/Warnings.xcconfig b/apps/main/macos/Runner/Configs/Warnings.xcconfig similarity index 100% rename from macos/Runner/Configs/Warnings.xcconfig rename to apps/main/macos/Runner/Configs/Warnings.xcconfig diff --git a/macos/Runner/DebugProfile.entitlements b/apps/main/macos/Runner/DebugProfile.entitlements similarity index 100% rename from macos/Runner/DebugProfile.entitlements rename to apps/main/macos/Runner/DebugProfile.entitlements diff --git a/macos/Runner/Info.plist b/apps/main/macos/Runner/Info.plist similarity index 100% rename from macos/Runner/Info.plist rename to apps/main/macos/Runner/Info.plist diff --git a/macos/Runner/MainFlutterWindow.swift b/apps/main/macos/Runner/MainFlutterWindow.swift similarity index 100% rename from macos/Runner/MainFlutterWindow.swift rename to apps/main/macos/Runner/MainFlutterWindow.swift diff --git a/macos/Runner/Release.entitlements b/apps/main/macos/Runner/Release.entitlements similarity index 100% rename from macos/Runner/Release.entitlements rename to apps/main/macos/Runner/Release.entitlements diff --git a/pubspec.lock b/apps/main/pubspec.lock similarity index 91% rename from pubspec.lock rename to apps/main/pubspec.lock index e0519d8..8c50752 100644 --- a/pubspec.lock +++ b/apps/main/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "64fcb0dbca4386356386c085142fa6e79c00a3326ceaa778a2d25f5d9ba61441" + sha256: cb3a948a1eebbf8efd987c43f95418269930e912a88bc7b6a5a7658423133635 url: "https://pub.dev" source: hosted - version: "1.0.16" + version: "1.0.17" analyzer: dependency: transitive description: @@ -41,13 +41,13 @@ packages: url: "https://pub.dev" source: hosted version: "2.10.0" - auth: + authentication: dependency: "direct main" description: - path: "packages/auth" + path: "../../packages/authentication" relative: true source: path - version: "0.0.1" + version: "1.0.0+1" auto_route: dependency: "direct main" description: @@ -64,6 +64,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.3" + bloc: + dependency: "direct main" + description: + name: bloc + sha256: "658a5ae59edcf1e58aac98b000a71c762ad8f46f1394c34a52050cafb3e11a80" + url: "https://pub.dev" + source: hosted + version: "8.1.1" boolean_selector: dependency: transitive description: @@ -236,34 +244,41 @@ packages: dependency: transitive description: name: firebase_auth - sha256: "9907d80446466e638dad31c195150b305dffd145dc57610fcd12c72289432143" + sha256: "7f2124b9a3573099aaaaab8d6157032725d7e45593be0b80ab3b8ddeb7051c42" url: "https://pub.dev" source: hosted - version: "4.2.9" + version: "4.2.10" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: c645fec50b0391aa878288f58fa4fe9762c271380c457aedf5c7c9b718604f68 + sha256: "98e4a414db0e083a2cb8a24735bb57ef3a1ee40a1407a93513391b24ad6ffd5d" url: "https://pub.dev" source: hosted - version: "6.11.11" + version: "6.11.12" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "2dcf2a36852b9091741b4a4047a02e1f2c43a62c6cacec7df573a793a6543e6d" + sha256: c6c559fd885e35d6256a4c4ad54c45bdce41cc275fbb7e735ee860095e854cbf url: "https://pub.dev" source: hosted - version: "5.2.8" + version: "5.2.9" + firebase_authentication: + dependency: "direct main" + description: + path: "../../packages/firebase_authentication" + relative: true + source: path + version: "1.0.0+1" firebase_core: dependency: transitive description: name: firebase_core - sha256: fe30ac230f12f8836bb97e6e09197340d3c584526825b1746ea362a82e1e43f7 + sha256: "1c121a478af23755b0b93fd4aa70d3bd32a587dd51ef0a3979091ac0d2317d32" url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "2.7.1" firebase_core_platform_interface: dependency: transitive description: @@ -276,10 +291,10 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "291fbcace608aca6c860652e1358ef89752be8cc3ef227f8bbcd1e62775b833a" + sha256: "0c1cf1f1022d2245ac117443bb95207952ca770281524d2908e323bc063fb8ff" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" fixnum: dependency: transitive description: @@ -293,6 +308,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + sha256: "434951eea948dbe87f737b674281465f610b8259c16c097b8163ce138749a775" + url: "https://pub.dev" + source: hosted + version: "8.1.2" flutter_lints: dependency: "direct dev" description: @@ -487,6 +510,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" package_config: dependency: transitive description: @@ -527,6 +558,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + provider: + dependency: transitive + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" pub_semver: dependency: transitive description: diff --git a/pubspec.yaml b/apps/main/pubspec.yaml similarity index 95% rename from pubspec.yaml rename to apps/main/pubspec.yaml index 94ca54d..5a78c0e 100644 --- a/pubspec.yaml +++ b/apps/main/pubspec.yaml @@ -32,16 +32,20 @@ dependencies: sdk: flutter auto_route: ^5.0.4 + bloc: ^8.1.1 equatable: ^2.0.5 + flutter_bloc: ^8.1.2 freezed_annotation: ^2.2.0 get_it: ^7.2.0 json_annotation: ^4.8.0 injectable: ^2.1.0 logger: ^1.2.2 - # firebase auth - auth: - path: ./packages/auth + # authentication + authentication: + path: ../../packages/authentication + firebase_authentication: + path: ../../packages/firebase_authentication # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. diff --git a/web/favicon.png b/apps/main/web/favicon.png similarity index 100% rename from web/favicon.png rename to apps/main/web/favicon.png diff --git a/web/icons/Icon-192.png b/apps/main/web/icons/Icon-192.png similarity index 100% rename from web/icons/Icon-192.png rename to apps/main/web/icons/Icon-192.png diff --git a/web/icons/Icon-512.png b/apps/main/web/icons/Icon-512.png similarity index 100% rename from web/icons/Icon-512.png rename to apps/main/web/icons/Icon-512.png diff --git a/web/icons/Icon-maskable-192.png b/apps/main/web/icons/Icon-maskable-192.png similarity index 100% rename from web/icons/Icon-maskable-192.png rename to apps/main/web/icons/Icon-maskable-192.png diff --git a/web/icons/Icon-maskable-512.png b/apps/main/web/icons/Icon-maskable-512.png similarity index 100% rename from web/icons/Icon-maskable-512.png rename to apps/main/web/icons/Icon-maskable-512.png diff --git a/web/index.html b/apps/main/web/index.html similarity index 100% rename from web/index.html rename to apps/main/web/index.html diff --git a/web/manifest.json b/apps/main/web/manifest.json similarity index 100% rename from web/manifest.json rename to apps/main/web/manifest.json diff --git a/windows/.gitignore b/apps/main/windows/.gitignore similarity index 100% rename from windows/.gitignore rename to apps/main/windows/.gitignore diff --git a/windows/CMakeLists.txt b/apps/main/windows/CMakeLists.txt similarity index 100% rename from windows/CMakeLists.txt rename to apps/main/windows/CMakeLists.txt diff --git a/windows/flutter/CMakeLists.txt b/apps/main/windows/flutter/CMakeLists.txt similarity index 100% rename from windows/flutter/CMakeLists.txt rename to apps/main/windows/flutter/CMakeLists.txt diff --git a/packages/auth/windows/flutter/generated_plugin_registrant.cc b/apps/main/windows/flutter/generated_plugin_registrant.cc similarity index 100% rename from packages/auth/windows/flutter/generated_plugin_registrant.cc rename to apps/main/windows/flutter/generated_plugin_registrant.cc diff --git a/packages/auth/windows/flutter/generated_plugin_registrant.h b/apps/main/windows/flutter/generated_plugin_registrant.h similarity index 100% rename from packages/auth/windows/flutter/generated_plugin_registrant.h rename to apps/main/windows/flutter/generated_plugin_registrant.h diff --git a/packages/auth/windows/flutter/generated_plugins.cmake b/apps/main/windows/flutter/generated_plugins.cmake similarity index 100% rename from packages/auth/windows/flutter/generated_plugins.cmake rename to apps/main/windows/flutter/generated_plugins.cmake diff --git a/windows/runner/CMakeLists.txt b/apps/main/windows/runner/CMakeLists.txt similarity index 100% rename from windows/runner/CMakeLists.txt rename to apps/main/windows/runner/CMakeLists.txt diff --git a/windows/runner/Runner.rc b/apps/main/windows/runner/Runner.rc similarity index 100% rename from windows/runner/Runner.rc rename to apps/main/windows/runner/Runner.rc diff --git a/windows/runner/flutter_window.cpp b/apps/main/windows/runner/flutter_window.cpp similarity index 100% rename from windows/runner/flutter_window.cpp rename to apps/main/windows/runner/flutter_window.cpp diff --git a/windows/runner/flutter_window.h b/apps/main/windows/runner/flutter_window.h similarity index 100% rename from windows/runner/flutter_window.h rename to apps/main/windows/runner/flutter_window.h diff --git a/windows/runner/main.cpp b/apps/main/windows/runner/main.cpp similarity index 100% rename from windows/runner/main.cpp rename to apps/main/windows/runner/main.cpp diff --git a/windows/runner/resource.h b/apps/main/windows/runner/resource.h similarity index 100% rename from windows/runner/resource.h rename to apps/main/windows/runner/resource.h diff --git a/windows/runner/resources/app_icon.ico b/apps/main/windows/runner/resources/app_icon.ico similarity index 100% rename from windows/runner/resources/app_icon.ico rename to apps/main/windows/runner/resources/app_icon.ico diff --git a/windows/runner/runner.exe.manifest b/apps/main/windows/runner/runner.exe.manifest similarity index 100% rename from windows/runner/runner.exe.manifest rename to apps/main/windows/runner/runner.exe.manifest diff --git a/windows/runner/utils.cpp b/apps/main/windows/runner/utils.cpp similarity index 100% rename from windows/runner/utils.cpp rename to apps/main/windows/runner/utils.cpp diff --git a/windows/runner/utils.h b/apps/main/windows/runner/utils.h similarity index 100% rename from windows/runner/utils.h rename to apps/main/windows/runner/utils.h diff --git a/windows/runner/win32_window.cpp b/apps/main/windows/runner/win32_window.cpp similarity index 100% rename from windows/runner/win32_window.cpp rename to apps/main/windows/runner/win32_window.cpp diff --git a/windows/runner/win32_window.h b/apps/main/windows/runner/win32_window.h similarity index 100% rename from windows/runner/win32_window.h rename to apps/main/windows/runner/win32_window.h diff --git a/lib/app_router.dart b/lib/app_router.dart deleted file mode 100644 index 7b74ff1..0000000 --- a/lib/app_router.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:auto_route/auto_route.dart'; - -import 'pages/login.dart'; -import 'pages/home.dart'; -import 'pages/profile.dart'; - -part 'app_router.gr.dart'; - -@MaterialAutoRouter( - replaceInRouteName: 'Page,Route', - routes: [ - AutoRoute( - page: LoginPage, - initial: true, - ), - AutoRoute(page: HomePage), - AutoRoute(page: ProfilePage), - ], -) -// extend the generated private router -class AppRouter extends _$AppRouter {} diff --git a/lib/app_router.gr.dart b/lib/app_router.gr.dart deleted file mode 100644 index 7fb0213..0000000 --- a/lib/app_router.gr.dart +++ /dev/null @@ -1,91 +0,0 @@ -// ************************************************************************** -// AutoRouteGenerator -// ************************************************************************** - -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ************************************************************************** -// AutoRouteGenerator -// ************************************************************************** -// -// ignore_for_file: type=lint - -part of 'app_router.dart'; - -class _$AppRouter extends RootStackRouter { - _$AppRouter([GlobalKey? navigatorKey]) : super(navigatorKey); - - @override - final Map pagesMap = { - LoginRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const LoginPage(), - ); - }, - HomeRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const HomePage(), - ); - }, - ProfileRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const ProfilePage(), - ); - }, - }; - - @override - List get routes => [ - RouteConfig( - LoginRoute.name, - path: '/', - ), - RouteConfig( - HomeRoute.name, - path: '/home-page', - ), - RouteConfig( - ProfileRoute.name, - path: '/profile-page', - ), - ]; -} - -/// generated route for -/// [LoginPage] -class LoginRoute extends PageRouteInfo { - const LoginRoute() - : super( - LoginRoute.name, - path: '/', - ); - - static const String name = 'LoginRoute'; -} - -/// generated route for -/// [HomePage] -class HomeRoute extends PageRouteInfo { - const HomeRoute() - : super( - HomeRoute.name, - path: '/home-page', - ); - - static const String name = 'HomeRoute'; -} - -/// generated route for -/// [ProfilePage] -class ProfileRoute extends PageRouteInfo { - const ProfileRoute() - : super( - ProfileRoute.name, - path: '/profile-page', - ); - - static const String name = 'ProfileRoute'; -} diff --git a/lib/data/models/user.g.dart b/lib/data/models/user.g.dart deleted file mode 100644 index 3b2b4ce..0000000 --- a/lib/data/models/user.g.dart +++ /dev/null @@ -1,19 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'user.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -User _$UserFromJson(Map json) => User( - id: json['id'] as String, - email: json['email'] as String?, - username: json['username'] as String?, - ); - -Map _$UserToJson(User instance) => { - 'id': instance.id, - 'email': instance.email, - 'username': instance.username, - }; diff --git a/lib/data/repositories/auth_facade.dart b/lib/data/repositories/auth_facade.dart deleted file mode 100644 index 582c3f6..0000000 --- a/lib/data/repositories/auth_facade.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:auth/auth.dart'; -import 'package:injectable/injectable.dart'; - -import '../models/user.dart'; - -@Injectable() -class AuthFacade { - Future signIn({ - required String email, - required String password, - }) { - return Auth.signInWithEmailAndPassword(email: email, password: password); - } - - Future register( - {required String username, - required String email, - required String password}) { - return Auth.createUserWithEmailAndPassword( - email: email, password: password); - } - - User? getUser() { - final user = Auth.currentUser; - - return user == null - ? null - : User(id: user.uid, email: user.email, username: user.displayName); - } - - Future signOut() { - return Auth.signOut(); - } -} diff --git a/lib/injection.config.dart b/lib/injection.config.dart deleted file mode 100644 index 0b98d5b..0000000 --- a/lib/injection.config.dart +++ /dev/null @@ -1,40 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ************************************************************************** -// InjectableConfigGenerator -// ************************************************************************** - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:flutter/material.dart' as _i6; -import 'package:flutter_bootstrap/data/repositories/auth_facade.dart' as _i3; -import 'package:flutter_bootstrap/pages/login.dart' as _i5; -import 'package:flutter_bootstrap/services/firebase_auth.dart' as _i4; -import 'package:get_it/get_it.dart' as _i1; -import 'package:injectable/injectable.dart' as _i2; - -import 'injection.dart' as _i7; - -// ignore_for_file: unnecessary_lambdas -// ignore_for_file: lines_longer_than_80_chars -// initializes the registration of main-scope dependencies inside of GetIt -Future<_i1.GetIt> $initGetIt( - _i1.GetIt getIt, { - String? environment, - _i2.EnvironmentFilter? environmentFilter, -}) async { - final gh = _i2.GetItHelper( - getIt, - environment, - environmentFilter, - ); - final appModule = _$AppModule(); - gh.factory<_i3.AuthFacade>(() => _i3.AuthFacade()); - await gh.factoryAsync<_i4.FirebaseAuthService>( - () => appModule.authService, - preResolve: true, - ); - gh.factory<_i5.LoginPage>(() => _i5.LoginPage(key: gh<_i6.Key>())); - return getIt; -} - -class _$AppModule extends _i7.AppModule {} diff --git a/lib/pages/login.dart b/lib/pages/login.dart deleted file mode 100644 index dddabca..0000000 --- a/lib/pages/login.dart +++ /dev/null @@ -1,89 +0,0 @@ -// import 'dart:convert'; - -import 'package:auto_route/auto_route.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bootstrap/data/repositories/auth_facade.dart'; -import 'package:injectable/injectable.dart'; - -import '../app_router.dart'; - -@Injectable() -class LoginPage extends StatefulWidget { - const LoginPage({Key? key}) : super(key: key); - - @override - State createState() => _LoginState(); -} - -// login form in dart -class _LoginState extends State { - final _authFacade = AuthFacade(); - - final _formKey = GlobalKey(); - final _emailController = TextEditingController(); - final _passwordController = TextEditingController(); - - // async function to login - Future login(BuildContext context) async { - await _authFacade.signIn( - email: _emailController.text, password: _passwordController.text); - - if (_authFacade.getUser() != null) { - context.router.push(const HomeRoute()); - } else { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Login failed'), - backgroundColor: Colors.red, - ), - ); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Login'), - ), - body: Form( - key: _formKey, - child: Padding( - padding: const EdgeInsets.all(24.0), - child: Column( - children: [ - TextFormField( - controller: _emailController, - decoration: const InputDecoration( - labelText: 'Email', - ), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - ), - TextFormField( - controller: _passwordController, - decoration: const InputDecoration( - labelText: 'Password', - ), - obscureText: true, - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - ), - ElevatedButton( - onPressed: () => login(context), - child: const Text('Submit'), - ), - ], - )), - ), - ); - } -} diff --git a/lib/services/firebase_auth.dart b/lib/services/firebase_auth.dart deleted file mode 100644 index 193dd12..0000000 --- a/lib/services/firebase_auth.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:auth/auth.dart'; - -class FirebaseAuthService { - static Future init() async { - await Auth.initialize(); - - return FirebaseAuthService(); - } -} diff --git a/melos.yaml b/melos.yaml new file mode 100644 index 0000000..6b71a1b --- /dev/null +++ b/melos.yaml @@ -0,0 +1,5 @@ +name: flutter_bootstrap + +packages: + - packages/* + - apps/* diff --git a/packages/auth/.gitignore b/packages/auth/.gitignore deleted file mode 100644 index 96486fd..0000000 --- a/packages/auth/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -# 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/ diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md deleted file mode 100644 index 41cc7d8..0000000 --- a/packages/auth/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.0.1 - -* TODO: Describe initial release. diff --git a/packages/auth/LICENSE b/packages/auth/LICENSE deleted file mode 100644 index ba75c69..0000000 --- a/packages/auth/LICENSE +++ /dev/null @@ -1 +0,0 @@ -TODO: Add your license here. diff --git a/packages/auth/README.md b/packages/auth/README.md deleted file mode 100644 index 02fe8ec..0000000 --- a/packages/auth/README.md +++ /dev/null @@ -1,39 +0,0 @@ - - -TODO: Put a short description of the package here that helps potential users -know whether this package might be useful for them. - -## Features - -TODO: List what your package can do. Maybe include images, gifs, or videos. - -## Getting started - -TODO: List prerequisites and provide or point to information on how to -start using the package. - -## Usage - -TODO: Include short and useful examples for package users. Add longer examples -to `/example` folder. - -```dart -const like = 'sample'; -``` - -## 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. diff --git a/packages/auth/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/packages/auth/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java deleted file mode 100644 index d007606..0000000 --- a/packages/auth/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.flutter.plugins; - -import io.flutter.plugin.common.PluginRegistry; - -/** - * Generated file. Do not edit. - */ -public final class GeneratedPluginRegistrant { - public static void registerWith(PluginRegistry registry) { - if (alreadyRegisteredWith(registry)) { - return; - } - } - - private static boolean alreadyRegisteredWith(PluginRegistry registry) { - final String key = GeneratedPluginRegistrant.class.getCanonicalName(); - if (registry.hasPlugin(key)) { - return true; - } - registry.registrarFor(key); - return false; - } -} diff --git a/packages/auth/android/local.properties b/packages/auth/android/local.properties deleted file mode 100644 index 9f04ba5..0000000 --- a/packages/auth/android/local.properties +++ /dev/null @@ -1,2 +0,0 @@ -sdk.dir=/Users/patrick/Library/Android/sdk -flutter.sdk=/Users/patrick/myWork/TOOLS/flutter \ No newline at end of file diff --git a/packages/auth/ios/Flutter/Generated.xcconfig b/packages/auth/ios/Flutter/Generated.xcconfig deleted file mode 100644 index 876e41a..0000000 --- a/packages/auth/ios/Flutter/Generated.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/patrick/myWork/TOOLS/flutter -FLUTTER_APPLICATION_PATH=/Users/patrick/WORK/flutter_bootstrap/packages/firebase_auth -COCOAPODS_PARALLEL_CODE_SIGN=true -FLUTTER_TARGET=lib/main.dart -FLUTTER_BUILD_DIR=build -FLUTTER_BUILD_NAME=0.0.1 -FLUTTER_BUILD_NUMBER=0.0.1 -EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 -EXCLUDED_ARCHS[sdk=iphoneos*]=armv7 -DART_OBFUSCATION=false -TRACK_WIDGET_CREATION=true -TREE_SHAKE_ICONS=false -PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/packages/auth/ios/Flutter/flutter_export_environment.sh b/packages/auth/ios/Flutter/flutter_export_environment.sh deleted file mode 100755 index c0d41f6..0000000 --- a/packages/auth/ios/Flutter/flutter_export_environment.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/patrick/myWork/TOOLS/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/patrick/WORK/flutter_bootstrap/packages/firebase_auth" -export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_TARGET=lib/main.dart" -export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_BUILD_NAME=0.0.1" -export "FLUTTER_BUILD_NUMBER=0.0.1" -export "DART_OBFUSCATION=false" -export "TRACK_WIDGET_CREATION=true" -export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/packages/auth/ios/Runner/GeneratedPluginRegistrant.h b/packages/auth/ios/Runner/GeneratedPluginRegistrant.h deleted file mode 100644 index 7a89092..0000000 --- a/packages/auth/ios/Runner/GeneratedPluginRegistrant.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GeneratedPluginRegistrant_h -#define GeneratedPluginRegistrant_h - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface GeneratedPluginRegistrant : NSObject -+ (void)registerWithRegistry:(NSObject*)registry; -@end - -NS_ASSUME_NONNULL_END -#endif /* GeneratedPluginRegistrant_h */ diff --git a/packages/auth/ios/Runner/GeneratedPluginRegistrant.m b/packages/auth/ios/Runner/GeneratedPluginRegistrant.m deleted file mode 100644 index efe65ec..0000000 --- a/packages/auth/ios/Runner/GeneratedPluginRegistrant.m +++ /dev/null @@ -1,14 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#import "GeneratedPluginRegistrant.h" - -@implementation GeneratedPluginRegistrant - -+ (void)registerWithRegistry:(NSObject*)registry { -} - -@end diff --git a/packages/auth/ios/Runner/GoogleService-Info.plist b/packages/auth/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index e69de29..0000000 diff --git a/packages/auth/ios/firebase_app_id_file.json b/packages/auth/ios/firebase_app_id_file.json deleted file mode 100644 index 46cfe44..0000000 --- a/packages/auth/ios/firebase_app_id_file.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "file_generated_by": "FlutterFire CLI", - "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", - "GOOGLE_APP_ID": "1:90115821420:ios:bf63d2c9fdb7cddef12d49", - "FIREBASE_PROJECT_ID": "fir-auth-89014", - "GCM_SENDER_ID": "90115821420" -} \ No newline at end of file diff --git a/packages/auth/linux/flutter/generated_plugin_registrant.cc b/packages/auth/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index e71a16d..0000000 --- a/packages/auth/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,11 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - - -void fl_register_plugins(FlPluginRegistry* registry) { -} diff --git a/packages/auth/linux/flutter/generated_plugin_registrant.h b/packages/auth/linux/flutter/generated_plugin_registrant.h deleted file mode 100644 index e0f0a47..0000000 --- a/packages/auth/linux/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void fl_register_plugins(FlPluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/auth/linux/flutter/generated_plugins.cmake b/packages/auth/linux/flutter/generated_plugins.cmake deleted file mode 100644 index 2e1de87..0000000 --- a/packages/auth/linux/flutter/generated_plugins.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/packages/auth/macos/Flutter/GeneratedPluginRegistrant.swift b/packages/auth/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index cccf817..0000000 --- a/packages/auth/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { -} diff --git a/packages/auth/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/packages/auth/macos/Flutter/ephemeral/Flutter-Generated.xcconfig deleted file mode 100644 index c6a991e..0000000 --- a/packages/auth/macos/Flutter/ephemeral/Flutter-Generated.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -// This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/patrick/myWork/TOOLS/flutter -FLUTTER_APPLICATION_PATH=/Users/patrick/WORK/flutter_bootstrap/packages/firebase_auth -COCOAPODS_PARALLEL_CODE_SIGN=true -FLUTTER_BUILD_DIR=build -FLUTTER_BUILD_NAME=0.0.1 -FLUTTER_BUILD_NUMBER=0.0.1 -DART_OBFUSCATION=false -TRACK_WIDGET_CREATION=true -TREE_SHAKE_ICONS=false -PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/packages/auth/macos/Flutter/ephemeral/flutter_export_environment.sh b/packages/auth/macos/Flutter/ephemeral/flutter_export_environment.sh deleted file mode 100755 index 1b79280..0000000 --- a/packages/auth/macos/Flutter/ephemeral/flutter_export_environment.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/patrick/myWork/TOOLS/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/patrick/WORK/flutter_bootstrap/packages/firebase_auth" -export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_BUILD_NAME=0.0.1" -export "FLUTTER_BUILD_NUMBER=0.0.1" -export "DART_OBFUSCATION=false" -export "TRACK_WIDGET_CREATION=true" -export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/packages/auth/macos/firebase_app_id_file.json b/packages/auth/macos/firebase_app_id_file.json deleted file mode 100644 index 46cfe44..0000000 --- a/packages/auth/macos/firebase_app_id_file.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "file_generated_by": "FlutterFire CLI", - "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", - "GOOGLE_APP_ID": "1:90115821420:ios:bf63d2c9fdb7cddef12d49", - "FIREBASE_PROJECT_ID": "fir-auth-89014", - "GCM_SENDER_ID": "90115821420" -} \ No newline at end of file diff --git a/packages/auth/pubspec.yaml b/packages/auth/pubspec.yaml deleted file mode 100644 index d19e01f..0000000 --- a/packages/auth/pubspec.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: auth -description: A new Flutter package project. -version: 0.0.1 -homepage: - -environment: - sdk: '>=2.19.1 <3.0.0' - flutter: ">=1.17.0" - -dependencies: - flutter: - sdk: flutter - - firebase_auth: ^4.2.9 - firebase_core: ^2.7.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/authentication/.gitignore b/packages/authentication/.gitignore new file mode 100644 index 0000000..9141595 --- /dev/null +++ b/packages/authentication/.gitignore @@ -0,0 +1,50 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +migrate_working_dir/ + +*.swp +profile + +DerivedData/ + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +build/ +.android/ +.ios/ +.flutter-plugins +.flutter-plugins-dependencies + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json diff --git a/packages/auth/.metadata b/packages/authentication/.metadata similarity index 92% rename from packages/auth/.metadata rename to packages/authentication/.metadata index 34b416b..e02528f 100644 --- a/packages/auth/.metadata +++ b/packages/authentication/.metadata @@ -7,4 +7,4 @@ version: revision: 7048ed95a5ad3e43d697e0c397464193991fc230 channel: stable -project_type: package +project_type: module diff --git a/packages/authentication/README.md b/packages/authentication/README.md new file mode 100644 index 0000000..fb25b9e --- /dev/null +++ b/packages/authentication/README.md @@ -0,0 +1,11 @@ +# authentication + +A new Flutter module project. + +## Getting Started + +For help getting started with Flutter development, view the online +[documentation](https://flutter.dev/). + +For instructions integrating Flutter modules to your existing applications, +see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app). diff --git a/packages/auth/analysis_options.yaml b/packages/authentication/analysis_options.yaml similarity index 100% rename from packages/auth/analysis_options.yaml rename to packages/authentication/analysis_options.yaml diff --git a/packages/authentication/lib/authentication.dart b/packages/authentication/lib/authentication.dart new file mode 100644 index 0000000..0644134 --- /dev/null +++ b/packages/authentication/lib/authentication.dart @@ -0,0 +1,9 @@ +abstract class Authentication { + Future signInWithEmailAndPassword( + {required String email, required String password}) async {} + + Future createUserWithEmailAndPassword( + {required String email, required String password}) async {} + + Future signOut() async {} +} diff --git a/packages/authentication/pubspec.lock b/packages/authentication/pubspec.lock new file mode 100644 index 0000000..b6e8c3d --- /dev/null +++ b/packages/authentication/pubspec.lock @@ -0,0 +1,188 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" + source: hosted + version: "2.10.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" + source: hosted + version: "1.2.1" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" + source: hosted + version: "1.17.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" + source: hosted + version: "2.0.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + lints: + dependency: transitive + description: + name: lints + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" + source: hosted + version: "0.12.13" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" + source: hosted + version: "1.8.0" + path: + dependency: transitive + description: + name: path + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" + source: hosted + version: "1.8.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" + source: hosted + version: "0.4.16" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" +sdks: + dart: ">=2.19.1 <3.0.0" diff --git a/packages/authentication/pubspec.yaml b/packages/authentication/pubspec.yaml new file mode 100644 index 0000000..52a9eaa --- /dev/null +++ b/packages/authentication/pubspec.yaml @@ -0,0 +1,88 @@ +name: authentication +description: A Flutter module authentication project. +publish_to: none + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# +# This version is used _only_ for the Runner app, which is used if you just do +# a `flutter run` or a `flutter make-host-app-editable`. It has no impact +# on any other native host app that you embed your Flutter project into. +version: 1.0.0+1 + +environment: + sdk: '>=2.19.1 <3.0.0' + +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +flutter: + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add Flutter specific assets to your application, add an assets section, + # like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add Flutter specific custom fonts to your application, add a fonts + # section here, in this "flutter" section. Each entry in this list should + # have a "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages + + + # This section identifies your Flutter project as a module meant for + # embedding in a native host app. These identifiers should _not_ ordinarily + # be changed after generation - they are used to ensure that the tooling can + # maintain consistency when adding or modifying assets and plugins. + # They also do not have any bearing on your native host application's + # identifiers, which may be completely independent or the same as these. + module: + androidX: true + androidPackage: com.example.authentication + iosBundleIdentifier: com.example.authentication diff --git a/packages/firebase_authentication/.gitignore b/packages/firebase_authentication/.gitignore new file mode 100644 index 0000000..9141595 --- /dev/null +++ b/packages/firebase_authentication/.gitignore @@ -0,0 +1,50 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +migrate_working_dir/ + +*.swp +profile + +DerivedData/ + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +build/ +.android/ +.ios/ +.flutter-plugins +.flutter-plugins-dependencies + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json diff --git a/packages/firebase_authentication/.metadata b/packages/firebase_authentication/.metadata new file mode 100644 index 0000000..e02528f --- /dev/null +++ b/packages/firebase_authentication/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 7048ed95a5ad3e43d697e0c397464193991fc230 + channel: stable + +project_type: module diff --git a/packages/firebase_authentication/README.md b/packages/firebase_authentication/README.md new file mode 100644 index 0000000..9fbea8f --- /dev/null +++ b/packages/firebase_authentication/README.md @@ -0,0 +1,11 @@ +# firebase_authentication + +A new Flutter module project. + +## Getting Started + +For help getting started with Flutter development, view the online +[documentation](https://flutter.dev/). + +For instructions integrating Flutter modules to your existing applications, +see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app). diff --git a/packages/firebase_authentication/analysis_options.yaml b/packages/firebase_authentication/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/packages/firebase_authentication/analysis_options.yaml @@ -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 diff --git a/packages/auth/lib/auth.dart b/packages/firebase_authentication/lib/firebase_authentication.dart similarity index 64% rename from packages/auth/lib/auth.dart rename to packages/firebase_authentication/lib/firebase_authentication.dart index 7abebed..a9cfe15 100644 --- a/packages/auth/lib/auth.dart +++ b/packages/firebase_authentication/lib/firebase_authentication.dart @@ -1,22 +1,24 @@ library firebase_auth; +import 'package:authentication/authentication.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_core/firebase_core.dart'; import 'firebase_options.dart'; -class Auth { - static Future initialize() async { - await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); - } - +class FirebaseAuthentication implements Authentication { static final FirebaseAuth _firebaseAuth = FirebaseAuth.instance; - static User? get currentUser => _firebaseAuth.currentUser; + User? get currentUser => _firebaseAuth.currentUser; - Stream get authStateChanges => _firebaseAuth.authStateChanges(); + static Future initialize() async { + await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + + return FirebaseAuthentication(); + } - static Future signInWithEmailAndPassword( + @override + Future signInWithEmailAndPassword( {required String email, required String password}) async { try { @@ -26,12 +28,14 @@ class Auth { } } - static Future createUserWithEmailAndPassword( + @override + Future createUserWithEmailAndPassword( {required String email, required String password}) async { await _firebaseAuth.createUserWithEmailAndPassword(email: email, password: password); } - static Future signOut() async { + @override + Future signOut() async { await _firebaseAuth.signOut(); } } diff --git a/packages/auth/lib/firebase_options.dart b/packages/firebase_authentication/lib/firebase_options.dart similarity index 100% rename from packages/auth/lib/firebase_options.dart rename to packages/firebase_authentication/lib/firebase_options.dart diff --git a/packages/firebase_authentication/pubspec.lock b/packages/firebase_authentication/pubspec.lock new file mode 100644 index 0000000..d82828a --- /dev/null +++ b/packages/firebase_authentication/pubspec.lock @@ -0,0 +1,289 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: cb3a948a1eebbf8efd987c43f95418269930e912a88bc7b6a5a7658423133635 + url: "https://pub.dev" + source: hosted + version: "1.0.17" + async: + dependency: transitive + description: + name: async + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" + source: hosted + version: "2.10.0" + authentication: + dependency: "direct main" + description: + path: "../authentication" + relative: true + source: path + version: "1.0.0+1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" + source: hosted + version: "1.2.1" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" + source: hosted + version: "1.17.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + sha256: "7f2124b9a3573099aaaaab8d6157032725d7e45593be0b80ab3b8ddeb7051c42" + url: "https://pub.dev" + source: hosted + version: "4.2.10" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: "98e4a414db0e083a2cb8a24735bb57ef3a1ee40a1407a93513391b24ad6ffd5d" + url: "https://pub.dev" + source: hosted + version: "6.11.12" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: c6c559fd885e35d6256a4c4ad54c45bdce41cc275fbb7e735ee860095e854cbf + url: "https://pub.dev" + source: hosted + version: "5.2.9" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "1c121a478af23755b0b93fd4aa70d3bd32a587dd51ef0a3979091ac0d2317d32" + url: "https://pub.dev" + source: hosted + version: "2.7.1" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: "5615b30c36f55b2777d0533771deda7e5730e769e5d3cb7fda79e9bed86cfa55" + url: "https://pub.dev" + source: hosted + version: "4.5.3" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0c1cf1f1022d2245ac117443bb95207952ca770281524d2908e323bc063fb8ff" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" + source: hosted + version: "2.0.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + intl: + dependency: transitive + description: + name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" + source: hosted + version: "0.17.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + lints: + dependency: transitive + description: + name: lints + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" + source: hosted + version: "0.12.13" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" + source: hosted + version: "1.8.0" + path: + dependency: transitive + description: + name: path + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" + source: hosted + version: "1.8.2" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" + source: hosted + version: "0.4.16" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" +sdks: + dart: ">=2.19.1 <3.0.0" + flutter: ">=1.20.0" diff --git a/packages/firebase_authentication/pubspec.yaml b/packages/firebase_authentication/pubspec.yaml new file mode 100644 index 0000000..2d56c9c --- /dev/null +++ b/packages/firebase_authentication/pubspec.yaml @@ -0,0 +1,95 @@ +name: firebase_authentication +description: A Flutter firebase authentication module project. +publish_to: none + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# +# This version is used _only_ for the Runner app, which is used if you just do +# a `flutter run` or a `flutter make-host-app-editable`. It has no impact +# on any other native host app that you embed your Flutter project into. +version: 1.0.0+1 + +environment: + sdk: '>=2.19.1 <3.0.0' + +dependencies: + flutter: + sdk: flutter + + # custom authentication package + authentication: + path: ../authentication + + firebase_auth: ^4.2.10 + firebase_core: ^2.7.0 + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +flutter: + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add Flutter specific assets to your application, add an assets section, + # like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add Flutter specific custom fonts to your application, add a fonts + # section here, in this "flutter" section. Each entry in this list should + # have a "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages + + + # This section identifies your Flutter project as a module meant for + # embedding in a native host app. These identifiers should _not_ ordinarily + # be changed after generation - they are used to ensure that the tooling can + # maintain consistency when adding or modifying assets and plugins. + # They also do not have any bearing on your native host application's + # identifiers, which may be completely independent or the same as these. + module: + androidX: true + androidPackage: com.example.firebase_authentication + iosBundleIdentifier: com.example.firebaseAuthentication diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index e640c78..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:flutter_bootstrap/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 8b6d468..0000000 --- a/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,11 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - - -void RegisterPlugins(flutter::PluginRegistry* registry) { -} diff --git a/windows/flutter/generated_plugin_registrant.h b/windows/flutter/generated_plugin_registrant.h deleted file mode 100644 index dc139d8..0000000 --- a/windows/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void RegisterPlugins(flutter::PluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake deleted file mode 100644 index b93c4c3..0000000 --- a/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin)