5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @main
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = firebase_dart_admin_auth_sample_app
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.aortem.dartAdminAuthTestApp
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.aortem. All rights reserved.
15 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility in the flutter_test package. For aortem, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:firebase/main.dart';
9 | import 'package:flutter/material.dart';
10 | import 'package:flutter_test/flutter_test.dart';
11 |
12 | void main() {
13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | await tester.pumpWidget(const MyApp());
16 |
17 | // Verify that our counter starts at 0.
18 | expect(find.text('0'), findsOneWidget);
19 | expect(find.text('1'), findsNothing);
20 |
21 | // Tap the '+' icon and trigger a frame.
22 | await tester.tap(find.byIcon(Icons.add));
23 | await tester.pump();
24 |
25 | // Verify that our counter has incremented.
26 | expect(find.text('0'), findsNothing);
27 | expect(find.text('1'), findsOneWidget);
28 | });
29 | }
30 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/favicon.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "firebase_dart_admin_auth_sample_app",
3 | "short_name": "firebase_dart_admin_auth_sample_app",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/web/oauth_redirect.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | OAuth Redirect
6 |
25 |
26 |
27 | Authentication successful. You can close this window.
28 |
29 |
30 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 |
11 | void RegisterPlugins(flutter::PluginRegistry* registry) {
12 | FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
13 | registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
14 | }
15 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | flutter_secure_storage_windows
7 | )
8 |
9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.Create(L"firebase_dart_admin_auth_sample_app", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-mobile-app/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "projects": {
3 | "default": "fire-base-dart-admin-auth-sdk"
4 | },
5 | "targets": {
6 | "fire-base-dart-admin-auth-sdk": {
7 | "hosting": {
8 | "firebase-admin-auth-sdk-flutter_web_app-usman": [
9 | "fire-base-dart-admin-auth-sdk-flutter-web-app-usman"
10 | ]
11 | }
12 | }
13 | },
14 | "etags": {}
15 | }
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.fvm/flutter_sdk:
--------------------------------------------------------------------------------
1 | /Users/farimahpirahmadi/fvm/versions/3.22.3
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.fvm/flutter_sdk~origin_development:
--------------------------------------------------------------------------------
1 | /Users/farimahpirahmadi/fvm/versions/3.22.3
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.fvm/fvm_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "flutterSdkVersion": "3.22.3"
3 | }
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.fvm/release:
--------------------------------------------------------------------------------
1 | 3.22.3
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.fvm/version:
--------------------------------------------------------------------------------
1 | 3.22.3
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.fvm/versions/3.22.3:
--------------------------------------------------------------------------------
1 | /Users/farimahpirahmadi/fvm/versions/3.22.3
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.fvm/versions/3.22.3~origin_development:
--------------------------------------------------------------------------------
1 | /Users/farimahpirahmadi/fvm/versions/3.22.3
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.fvmrc:
--------------------------------------------------------------------------------
1 | {
2 | "flutter": "3.22.3"
3 | }
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Symbolication related
35 | app.*.symbols
36 |
37 | # Obfuscation related
38 | app.*.map.json
39 |
40 | # Android Studio will place build artifacts here
41 | /android/app/debug
42 | /android/app/profile
43 | /android/app/release
44 |
45 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/Dockerfile:
--------------------------------------------------------------------------------
1 | # Use latest stable channel SDK.
2 | FROM dart:stable AS build
3 |
4 | # Resolve app dependencies.
5 | WORKDIR /app
6 | COPY pubspec.* ./
7 | RUN dart pub get
8 |
9 | # Copy app source code (except anything in .dockerignore) and AOT compile app.
10 | COPY . .
11 | RUN dart compile exe bin/server.dart -o bin/server
12 |
13 | # Build minimal serving image from AOT-compiled `/server`
14 | # and the pre-built AOT-runtime in the `/runtime/` directory of the base image.
15 | FROM scratch
16 | COPY --from=build /runtime/ /
17 | COPY --from=build /app/bin/server /app/bin/
18 |
19 | # Start server.
20 | EXPOSE 8000
21 | CMD ["/app/bin/server"]
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/assets/service_account.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "service_account",
3 | "project_id": "Your Project ID",
4 | "private_key_id": "Your Private Key Id",
5 | "private_key": "Your Private key",
6 | "client_email": "Your Client Email",
7 | "client_id": "Your Client Id",
8 | "auth_uri": "Your auth Uri",
9 | "token_uri": "Your Token Uri",
10 | "auth_provider_x509_cert_url": "Your Auth Provider",
11 | "client_x509_cert_url": "Your Client Cert Url",
12 | "universe_domain": "Your Universe Domain"
13 | }
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/build.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/build.yaml
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "hosting": {
3 | "target": "firebase-admin-auth-sdk-flutter_web_app-usman",
4 | "public": "build/web",
5 | "ignore": [
6 | "firebase.json",
7 | "**/.*",
8 | "**/node_modules/**"
9 | ],
10 | "rewrites": [
11 | {
12 | "source": "**",
13 | "destination": "/index.html"
14 | }
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/apple_sign_in_screen/apple_sign_in_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
2 |
3 | class AppleSignInViewModel {
4 | final FirebaseAuth auth;
5 |
6 | AppleSignInViewModel({required this.auth});
7 |
8 | Future signInWithApple(String idToken,
9 | {String? nonce}) async {
10 | if (idToken.isEmpty) {
11 | throw FirebaseAuthException(
12 | code: 'invalid-id-token',
13 | message: 'Apple ID Token must not be empty',
14 | );
15 | }
16 |
17 | return await auth.signInWithApple(idToken, nonce: nonce);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/apply_action_code_screen/apply_action_code_screen_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class ApplyActionCodeScreenViewModel extends ChangeNotifier {
6 | bool loading = false;
7 |
8 | void setLoading(bool load) {
9 | loading = load;
10 | notifyListeners();
11 | }
12 |
13 | Future applyActionCode(
14 | String actionCode, VoidCallback onSuccess) async {
15 | try {
16 | setLoading(true);
17 |
18 | await FirebaseApp.firebaseAuth?.applyActionCode(actionCode);
19 |
20 | onSuccess();
21 |
22 | BotToast.showText(text: 'Success');
23 | } catch (e) {
24 | BotToast.showText(text: e.toString());
25 | } finally {
26 | setLoading(false);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/fetch_sign_in_methods_for_email_screen/fetch_sign_in_methods_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
4 |
5 | class FetchSignInMethodsViewModel extends ChangeNotifier {
6 | bool loading = false;
7 | List? result;
8 |
9 | void setLoading(bool load) {
10 | loading = load;
11 | notifyListeners();
12 | }
13 |
14 | Future fetchSignInMethods(String email) async {
15 | if (email.isEmpty) {
16 | BotToast.showText(text: 'Please enter an email');
17 | return;
18 | }
19 |
20 | try {
21 | setLoading(true);
22 | var fetchedResult =
23 | await FirebaseApp.firebaseAuth?.fetchSignInMethodsForEmail(email);
24 | result = fetchedResult?.cast(); // Explicitly cast to List
25 | notifyListeners();
26 | } catch (e) {
27 | BotToast.showText(text: e.toString());
28 | } finally {
29 | setLoading(false);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/initialize_recaptcha_config_screen/initialize_recaptcha_config_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 |
4 | class InitializeRecaptchaConfigScreen extends StatelessWidget {
5 | final FirebaseAuth auth;
6 |
7 | const InitializeRecaptchaConfigScreen({super.key, required this.auth});
8 |
9 | Future _initializeRecaptchaConfig(BuildContext context) async {
10 | try {
11 | // Replace with your actual reCAPTCHA site key
12 | const String siteKey =
13 | 'YOUR_RECAPTCHA_SITE_KEY'; //'YOUR_RECAPTCHA_SITE_KEY';
14 | await auth.initializeRecaptchaConfig(siteKey);
15 | ScaffoldMessenger.of(context).showSnackBar(
16 | const SnackBar(
17 | content: Text('reCAPTCHA config initialized successfully')),
18 | );
19 | } catch (e) {
20 | ScaffoldMessenger.of(context).showSnackBar(
21 | SnackBar(content: Text('Failed to initialize reCAPTCHA config: $e')),
22 | );
23 | }
24 | }
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | appBar: AppBar(title: const Text('Initialize reCAPTCHA Config')),
30 | body: Center(
31 | child: ElevatedButton(
32 | onPressed: () => _initializeRecaptchaConfig(context),
33 | child: const Text('Initialize reCAPTCHA Config'),
34 | ),
35 | ),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/set_language_code_screen/set_language_code_screen_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class SetLanguageCodeScreenViewModel extends ChangeNotifier {
6 | bool loading = false;
7 |
8 | void setLoading(bool load) {
9 | loading = load;
10 | notifyListeners();
11 | }
12 |
13 | Future setLanguageCode(String languageCode) async {
14 | try {
15 | setLoading(true);
16 |
17 | await FirebaseApp.firebaseAuth?.setLanguageCode(languageCode);
18 |
19 | BotToast.showText(text: 'Success');
20 | } catch (e) {
21 | BotToast.showText(text: e.toString());
22 | } finally {
23 | setLoading(false);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/set_presistence/firebase_presistance.dart:
--------------------------------------------------------------------------------
1 | class FirebasePersistence {
2 | static const String local = 'local';
3 | static const String session = 'session';
4 | static const String none = 'none';
5 | }
6 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/sign_in_with_custom_token_screen/sign_in_with_custom_token_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class SignInWithCustomTokenViewModel extends ChangeNotifier {
6 | bool loading = false;
7 | void setLoading(bool load) {
8 | loading = load;
9 | notifyListeners();
10 | }
11 |
12 | Future signInWithCustomToken(String uid, VoidCallback onSuccess) async {
13 | try {
14 | setLoading(true);
15 |
16 | await FirebaseApp.firebaseAuth?.signInWithCustomToken(uid);
17 |
18 | onSuccess();
19 | } catch (e) {
20 | BotToast.showText(text: e.toString());
21 | }
22 | setLoading(false);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/sign_in_with_email_and_password_screen/sign_in_with_email_and_password_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class SignInWithEmailAndPasswordViewModel extends ChangeNotifier {
6 | bool loading = false;
7 | void setLoading(bool load) {
8 | loading = load;
9 | notifyListeners();
10 | }
11 |
12 | Future signIn(
13 | String email, String password, VoidCallback onSuccess) async {
14 | try {
15 | setLoading(true);
16 |
17 | await FirebaseApp.firebaseAuth
18 | ?.signInWithEmailAndPassword(email, password);
19 |
20 | onSuccess();
21 | } catch (e) {
22 | BotToast.showText(text: e.toString());
23 | }
24 | setLoading(false);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/sign_up_screen/sign_up_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class SignUpViewModel extends ChangeNotifier {
6 | final FirebaseAuth _auth;
7 |
8 | SignUpViewModel(this._auth);
9 |
10 | bool loading = false;
11 | void setLoading(bool load) {
12 | loading = load;
13 | notifyListeners();
14 | }
15 |
16 | Future signUp(
17 | String email,
18 | String password,
19 | VoidCallback onSuccess,
20 | ) async {
21 | try {
22 | setLoading(true);
23 |
24 | UserCredential? userCredential =
25 | await _auth.createUserWithEmailAndPassword(email, password);
26 |
27 | BotToast.showText(text: '${userCredential.user.email} just signed up');
28 | onSuccess();
29 | } catch (e) {
30 | BotToast.showText(text: 'Sign up error: ${e.toString()}');
31 | } finally {
32 | setLoading(false);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/splash_screen/splash_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase/screens/sign_up_screen/sign_up_screen.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class SplashScreen extends StatefulWidget {
5 | const SplashScreen({super.key});
6 |
7 | @override
8 | State createState() => _SplashScreenState();
9 | }
10 |
11 | class _SplashScreenState extends State {
12 | @override
13 | void initState() {
14 | Future.delayed(const Duration(seconds: 3)).then(
15 | (value) {
16 | splashScreen();
17 | },
18 | );
19 | super.initState();
20 | }
21 |
22 | void splashScreen() {
23 | Navigator.push(
24 | context,
25 | MaterialPageRoute(
26 | builder: (context) => const SignUpScreen(),
27 | ),
28 | );
29 | }
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return Scaffold(
34 | body: Container(
35 | height: MediaQuery.sizeOf(context).height,
36 | width: MediaQuery.sizeOf(context).width,
37 | color: Colors.purple,
38 | child: Center(
39 | child: Text(
40 | 'SAMPLE APP',
41 | style: Theme.of(context).textTheme.bodySmall?.copyWith(
42 | color: Colors.white,
43 | fontWeight: FontWeight.w900,
44 | fontSize: 20,
45 | ),
46 | ),
47 | ),
48 | ),
49 | );
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/unlink_provider_screen/unlink_provider_screen_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class UnlinkProviderScreenViewModel extends ChangeNotifier {
6 | bool loading = false;
7 |
8 | void setLoading(bool load) {
9 | loading = load;
10 | notifyListeners();
11 | }
12 |
13 | Future unLinkProvider(String providerId) async {
14 | try {
15 | setLoading(true);
16 |
17 | await FirebaseApp.firebaseAuth?.unlinkProvider(providerId);
18 |
19 | BotToast.showText(text: 'Provider Unlinked Successfully');
20 | } catch (e) {
21 | BotToast.showText(text: e.toString());
22 | } finally {
23 | setLoading(false);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/update_password_screen/update_password_screen_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class UpdatePasswordScreenViewModel extends ChangeNotifier {
6 | bool loading = false;
7 |
8 | void setLoading(bool load) {
9 | loading = load;
10 | notifyListeners();
11 | }
12 |
13 | Future updatePassword(String newPassowrd) async {
14 | try {
15 | setLoading(true);
16 |
17 | await FirebaseApp.firebaseAuth?.updatePassword(newPassowrd);
18 | BotToast.showText(text: 'Password updated');
19 | } catch (e) {
20 | BotToast.showText(text: e.toString());
21 | } finally {
22 | setLoading(false);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/update_profile_screen/update_profile_screen_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class UpdateProfileScreenViewModel extends ChangeNotifier {
6 | bool loading = false;
7 |
8 | void setLoading(bool load) {
9 | loading = load;
10 | notifyListeners();
11 | }
12 |
13 | Future updateProfile(
14 | String displayName,
15 | String displayImage,
16 | VoidCallback onSuccess,
17 | ) async {
18 | try {
19 | setLoading(true);
20 | await FirebaseApp.firebaseAuth?.updateProfile(displayName, displayImage);
21 |
22 | BotToast.showText(text: 'Update Successfull');
23 | onSuccess();
24 | } catch (e) {
25 | BotToast.showText(text: e.toString());
26 | } finally {
27 | setLoading(false);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/screens/verify_before_email_update_screen/verify_before_email_update_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:bot_toast/bot_toast.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class VerifyBeforeEmailUpdateViewModel extends ChangeNotifier {
6 | final FirebaseAuth? _firebaseSdk = FirebaseApp.firebaseAuth;
7 | bool loading = false;
8 |
9 | void setLoading(bool load) {
10 | loading = load;
11 | notifyListeners();
12 | }
13 |
14 | Future verifyBeforeEmailUpdate(
15 | String newEmail, {
16 | ActionCodeSettings? actionCode,
17 | required VoidCallback onFinished,
18 | }) async {
19 | try {
20 | setLoading(true);
21 | await _firebaseSdk?.verifyBeforeEmailUpdate(newEmail, action: actionCode);
22 | BotToast.showText(text: 'Verification email has been sent to $newEmail');
23 | onFinished();
24 | } catch (e) {
25 | BotToast.showText(text: e.toString());
26 | } finally {
27 | setLoading(false);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/shared/action_tile.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase/utils/extensions.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class ActionTile extends StatelessWidget {
5 | final String title;
6 | final VoidCallback onTap;
7 | final bool loading;
8 | const ActionTile({
9 | super.key,
10 | required this.onTap,
11 | required this.title,
12 | this.loading = false,
13 | });
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return InkWell(
18 | onTap: onTap,
19 | child: Container(
20 | padding: 10.all,
21 | decoration: BoxDecoration(
22 | borderRadius: BorderRadius.circular(10),
23 | border: Border.all(
24 | color: Colors.purple,
25 | )),
26 | child: Row(
27 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
28 | children: [
29 | loading
30 | ? const SizedBox(
31 | height: 15,
32 | width: 15,
33 | child: CircularProgressIndicator(),
34 | )
35 | : Text(title),
36 | const Icon(
37 | Icons.arrow_forward_ios,
38 | color: Colors.purple,
39 | ),
40 | ],
41 | ),
42 | ),
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/shared/button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class Button extends StatelessWidget {
4 | final String? title;
5 | final VoidCallback onTap;
6 | final bool loading;
7 | const Button({
8 | super.key,
9 | required this.onTap,
10 | required this.title,
11 | this.loading = false,
12 | });
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return MaterialButton(
17 | onPressed: onTap,
18 | color: Colors.purple,
19 | shape: RoundedRectangleBorder(
20 | borderRadius: BorderRadius.circular(10),
21 | ),
22 | textColor: Colors.white,
23 | textTheme: ButtonTextTheme.normal,
24 | child: loading
25 | ? const SizedBox(
26 | height: 15,
27 | width: 15,
28 | child: CircularProgressIndicator(
29 | color: Colors.white,
30 | ),
31 | )
32 | : Text(title ?? ''),
33 | );
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/shared/input_field.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class InputField extends StatelessWidget {
4 | final TextEditingController? controller;
5 | final String? hint;
6 | final String? label;
7 | final bool? obscure;
8 | final TextInputType? textInputType;
9 | final bool obscureText;
10 | const InputField({
11 | super.key,
12 | this.controller,
13 | this.hint,
14 | this.label,
15 | this.obscure,
16 | this.textInputType,
17 | this.obscureText = false,
18 | });
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return TextField(
23 | controller: controller,
24 | obscureText: obscure ?? false,
25 | // obscureText: obscureText,
26 | keyboardType: textInputType,
27 | decoration: InputDecoration(
28 | hintText: hint,
29 | labelText: label,
30 | ),
31 | );
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/shared/shared.dart:
--------------------------------------------------------------------------------
1 | export 'input_field.dart';
2 | export 'button.dart';
3 | export 'sign_in_methods_bottom_sheet.dart';
4 | export 'action_tile.dart';
5 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/utils/extensions.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | extension NumExtension on num {
4 | EdgeInsets get horizontal {
5 | return EdgeInsets.symmetric(horizontal: toDouble());
6 | }
7 |
8 | EdgeInsets get vertical {
9 | return EdgeInsets.symmetric(vertical: toDouble());
10 | }
11 |
12 | EdgeInsets get all {
13 | return EdgeInsets.symmetric(
14 | horizontal: toDouble(),
15 | vertical: toDouble(),
16 | );
17 | }
18 |
19 | SizedBox get hSpace {
20 | return SizedBox(
21 | width: toDouble(),
22 | );
23 | }
24 |
25 | SizedBox get vSpace {
26 | return SizedBox(
27 | height: toDouble(),
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/lib/utils/platform_provider.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | String getPlatformId() {
4 | if (Platform.isAndroid) {
5 | return 'google.com';
6 | }
7 | if (Platform.isIOS) {
8 | return 'apple.com';
9 | }
10 | return 'google.com';
11 | }
12 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "firebase": "^11.2.0"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility in the flutter_test package. For aortem, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | //import 'package:firebase/main.dart';
9 | import 'package:flutter/material.dart';
10 | import 'package:flutter_test/flutter_test.dart';
11 |
12 | void main() {
13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | // await tester.pumpWidget(const MyApp());
16 |
17 | // Verify that our counter starts at 0.
18 | expect(find.text('0'), findsOneWidget);
19 | expect(find.text('1'), findsNothing);
20 |
21 | // Tap the '+' icon and trigger a frame.
22 | await tester.tap(find.byIcon(Icons.add));
23 | await tester.pump();
24 |
25 | // Verify that our counter has incremented.
26 | expect(find.text('0'), findsNothing);
27 | expect(find.text('1'), findsOneWidget);
28 | });
29 | }
30 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/favicon.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "firebase_dart_admin_auth_sample_app",
3 | "short_name": "firebase_dart_admin_auth_sample_app",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-flutter-web-app/web/oauth_redirect.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | OAuth Redirect
6 |
25 |
26 |
27 | Authentication successful. You can close this window.
28 |
29 |
30 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-react-app/placeholder.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-react-app/placeholder.txt
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-svelte-app/placeholder.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-svelte-app/placeholder.txt
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-vue-app/placeholder.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aortem/firebase-dart-admin-auth-sdk/82faf09d3b59f077fabff896a7d2f80f3b3ff2e3/firebase-dart-admin-auth-sdk/example/firebase-dart-admin-auth-sdk-vue-app/placeholder.txt
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/firebase_dart_admin_auth_sdk.dart:
--------------------------------------------------------------------------------
1 | library;
2 |
3 | export 'src/firebase_auth.dart';
4 | export 'src/user_credential.dart';
5 | export 'src/exceptions.dart';
6 | export 'src/utils.dart';
7 | export 'src/confirmation_result.dart';
8 | export 'src/auth_credential.dart';
9 | export 'src/firebase_app.dart';
10 | export 'src/auth_provider.dart';
11 | export 'src/application_verifier.dart';
12 | export 'src/user.dart';
13 | export 'src/auth/check_action_code.dart';
14 | export 'src/additional_user_info.dart';
15 |
16 | export 'src/auth/auth_link_with_phone_number.dart';
17 |
18 | export 'src/auth/auth_redirect_link.dart';
19 | export 'src/firebase_storage.dart';
20 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/additional_user_info.dart:
--------------------------------------------------------------------------------
1 | ///additional info
2 | class AdditionalUserInfo {
3 | ///isnewuser
4 | final bool isNewUser;
5 |
6 | ///providerid
7 | final String? providerId;
8 |
9 | ///profile
10 | final Map? profile;
11 |
12 | ///additional info
13 | AdditionalUserInfo({
14 | required this.isNewUser,
15 | this.providerId,
16 | this.profile,
17 | });
18 |
19 | ///factory
20 | factory AdditionalUserInfo.fromJson(Map json) {
21 | return AdditionalUserInfo(
22 | isNewUser: json['isNewUser'] ?? false,
23 | providerId: json['providerId'],
24 | profile: json['profile'],
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/application_verifier.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | ///application verifier
4 | abstract class ApplicationVerifier {
5 | ///type
6 | String get type;
7 |
8 | ///verify
9 | Future verify();
10 | }
11 |
12 | ///recaptcha
13 | class RecaptchaVerifier implements ApplicationVerifier {
14 | ///site key
15 | final String siteKey;
16 |
17 | ///recaptcha
18 |
19 | RecaptchaVerifier(this.siteKey);
20 |
21 | @override
22 | String get type => 'recaptcha';
23 |
24 | @override
25 | Future verify() async {
26 | throw UnimplementedError(
27 | 'RecaptchaVerifier.verify() must be implemented by a platform-specific class.');
28 | }
29 | }
30 |
31 | ///mock app verifyer
32 |
33 | class MockApplicationVerifier implements ApplicationVerifier {
34 | @override
35 | String get type => 'recaptcha';
36 |
37 | @override
38 | Future verify() async {
39 | await Future.delayed(const Duration(seconds: 1));
40 | return 'mock_recaptcha_token';
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/application_verifier_io.dart:
--------------------------------------------------------------------------------
1 | import 'application_verifier.dart';
2 |
3 | ///recaptcha verifier
4 | class RecaptchaVerifierIO implements RecaptchaVerifier {
5 | @override
6 | final String siteKey;
7 |
8 | ///recaptcha id
9 | RecaptchaVerifierIO(this.siteKey);
10 |
11 | @override
12 | String get type => 'recaptcha';
13 |
14 | @override
15 | Future verify() async {
16 | throw UnimplementedError(
17 | 'RecaptchaVerifier.verify() is not implemented for IO platforms.');
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/application_verifier_web.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'stub_js.dart' if (dart.library.js) 'dart:js' as js;
3 | import 'application_verifier.dart';
4 |
5 | ///recaptcha
6 | class RecaptchaVerifierWeb implements RecaptchaVerifier {
7 | @override
8 | final String siteKey;
9 |
10 | ///recaptcha
11 | RecaptchaVerifierWeb(this.siteKey);
12 |
13 | @override
14 | String get type => 'recaptcha';
15 |
16 | @override
17 | Future verify() async {
18 | final completer = Completer();
19 |
20 | js.context.callMethod('grecaptcha.ready', [
21 | () {
22 | js.context.callMethod('grecaptcha.execute', [
23 | siteKey,
24 | {'action': 'submit'}
25 | ]).then((token) {
26 | completer.complete(token as String);
27 | }).catchError((error) {
28 | completer.completeError(error);
29 | });
30 | }
31 | ]);
32 |
33 | return completer.future;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/auth/auth_base.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_dart_admin_auth_sdk/src/firebase_auth.dart';
2 | import 'package:firebase_dart_admin_auth_sdk/src/http_response.dart';
3 |
4 | /// An abstract base class providing core authentication functionality.
5 | ///
6 | /// This class serves as a foundation for classes that need to perform
7 | /// authentication requests using Firebase.
8 | abstract class AuthBase {
9 | /// The [FirebaseAuth] instance used to perform authentication requests.
10 | final FirebaseAuth auth;
11 |
12 | /// Constructs an instance of [AuthBase].
13 | ///
14 | /// Parameters:
15 | /// - [auth]: The [FirebaseAuth] instance that will handle requests.
16 | AuthBase(this.auth);
17 |
18 | /// Sends an authenticated request to Firebase using the specified [endpoint]
19 | /// and request [body].
20 | ///
21 | /// Parameters:
22 | /// - [endpoint]: The Firebase endpoint to interact with (e.g., 'update').
23 | /// - [body]: A `Map` containing the request payload.
24 | ///
25 | /// Returns a [Future] that resolves to an [HttpResponse] containing the
26 | /// server's response.
27 | ///
28 | /// Example usage:
29 | /// ```dart
30 | /// performRequest('update', {'oobCode': 'someCode'});
31 | /// ```
32 | Future performRequest(
33 | String endpoint, Map body) {
34 | return auth.performRequest(endpoint, body);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/auth/connect_auth_emulator.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
2 |
3 | ///connect auth class
4 | class ConnectAuthEmulatorService {
5 | ///auth instance
6 | final FirebaseAuth auth;
7 |
8 | ///connect auth service
9 | ConnectAuthEmulatorService(this.auth);
10 |
11 | ///connect auth function
12 | void connect(String host, int port) {
13 | final url = 'http://$host:$port';
14 | auth.setEmulatorUrl(url);
15 | print('Connected to Firebase Auth Emulator at $url');
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/auth/password_reset_email.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:firebase_dart_admin_auth_sdk/src/exceptions.dart';
3 |
4 | ///password reset
5 | class PasswordResetEmailService {
6 | ///auth
7 | final dynamic auth;
8 |
9 | ///password reset
10 | PasswordResetEmailService({required this.auth});
11 |
12 | ///password reset function
13 | Future sendPasswordResetEmail(String email) async {
14 | try {
15 | final url = Uri.https(
16 | 'identitytoolkit.googleapis.com',
17 | '/v1/accounts:sendOobCode',
18 | {if (auth.apiKey != 'your_api_key') 'key': auth.apiKey},
19 | );
20 |
21 | final response = await auth.httpClient.post(
22 | url,
23 | headers: {
24 | 'Content-Type': 'application/json; charset=UTF-8',
25 | if (auth.accessToken != null)
26 | 'Authorization': 'Bearer ${auth.accessToken}',
27 | },
28 | body: json.encode({
29 | 'requestType': 'PASSWORD_RESET',
30 | 'email': email,
31 | }),
32 | );
33 |
34 | if (response.statusCode != 200) {
35 | final error = json.decode(response.body)['error'];
36 | throw FirebaseAuthException(
37 | code: error['message'],
38 | message: error['message'],
39 | );
40 | }
41 | } catch (e) {
42 | throw FirebaseAuthException(
43 | code: 'password-reset-error',
44 | message: 'Failed to send password reset email: ${e.toString()}',
45 | );
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/auth/recaptcha_config.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | ///recaptcha config
4 | abstract class RecaptchaConfigService {
5 | ///recaptcha string
6 | Future initializeRecaptchaConfig(String siteKey);
7 |
8 | ///recaptcha token
9 | Future getRecaptchaToken();
10 | }
11 |
12 | ///recaptcha config
13 | class RecaptchaConfigServiceStub implements RecaptchaConfigService {
14 | @override
15 | Future initializeRecaptchaConfig(String siteKey) async {
16 | throw UnimplementedError(
17 | 'RecaptchaConfigService.initializeRecaptchaConfig() must be implemented by a platform-specific class.');
18 | }
19 |
20 | @override
21 | Future getRecaptchaToken() async {
22 | throw UnimplementedError(
23 | 'RecaptchaConfigService.getRecaptchaToken() must be implemented by a platform-specific class.');
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/auth/recaptcha_config_io.dart:
--------------------------------------------------------------------------------
1 | import 'recaptcha_config.dart';
2 |
3 | ///recaptcha
4 | class RecaptchaConfigServiceIO implements RecaptchaConfigService {
5 | @override
6 | Future initializeRecaptchaConfig(String siteKey) async {
7 | throw UnimplementedError(
8 | 'RecaptchaConfigService.initializeRecaptchaConfig() is not implemented for IO platforms.');
9 | }
10 |
11 | @override
12 | Future getRecaptchaToken() async {
13 | throw UnimplementedError(
14 | 'RecaptchaConfigService.getRecaptchaToken() is not implemented for IO platforms.');
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/auth/revoke_access_token.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
2 |
3 | ///revoke access token
4 | class RevokeAccessTokenService {
5 | final FirebaseAuth _auth;
6 |
7 | ///revoke access token
8 | RevokeAccessTokenService({required FirebaseAuth auth}) : _auth = auth;
9 |
10 | ///revoke access token method
11 | Future revokeAccessToken() async {
12 | if (_auth.currentUser == null) {
13 | throw FirebaseAuthException(
14 | code: 'no-current-user',
15 | message: 'No user is currently signed in.',
16 | );
17 | }
18 |
19 | try {
20 | // Get the current user's ID token
21 | String? idToken = await _auth.currentUser?.getIdToken();
22 | if (idToken == null) {
23 | throw FirebaseAuthException(
24 | code: 'no-id-token',
25 | message: 'Failed to get ID token for current user.',
26 | );
27 | }
28 |
29 | // In a real-world scenario, you might want to make an API call to your backend
30 | // to revoke the token server-side. For example:
31 | // await _auth.performRequest('revokeToken', {'token': idToken});
32 |
33 | // Sign out the user to invalidate the session
34 | await _auth.signOut();
35 | } catch (e) {
36 | throw FirebaseAuthException(
37 | code: 'revoke-access-token-error',
38 | message: 'Failed to revoke access token: ${e.toString()}',
39 | );
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/auth/sign_out_auth.dart:
--------------------------------------------------------------------------------
1 | import '../../firebase_dart_admin_auth_sdk.dart';
2 |
3 |
4 | /// A service that handles the sign-out process for the current user in Firebase Authentication.
5 | ///
6 | /// This class is responsible for signing out the current user from Firebase, effectively
7 | /// clearing any authentication state and user-related data in the app.
8 | class FirebaseSignOut {
9 |
10 | /// Signs out the current user and clears their session.
11 | ///
12 | /// This method performs the following actions:
13 | /// 1. Sets the current user to `null` using [FirebaseApp.instance.setCurrentUser],
14 | /// effectively logging the user out and clearing their session.
15 | ///
16 | /// This method does not return any value.
17 | ///
18 | /// Throws:
19 | /// - No exceptions are thrown by this method.
20 | Future signOut() async {
21 | // Clear the current user session by setting the current user to null.
22 | FirebaseApp.instance.setCurrentUser(null);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/confirmation_result.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_dart_admin_auth_sdk/firebase_dart_admin_auth_sdk.dart';
2 |
3 | ///confirm results
4 |
5 | class ConfirmationResult {
6 | ///verify id
7 | final String verificationId;
8 |
9 | ///confirm function
10 | final Future Function(String) confirm;
11 |
12 | ///confirm result
13 |
14 | ConfirmationResult({required this.verificationId, required this.confirm});
15 | }
16 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/exceptions.dart:
--------------------------------------------------------------------------------
1 | ///expection
2 | class FirebaseAuthException implements Exception {
3 | ///code
4 | final String code;
5 |
6 | ///message
7 | final String message;
8 |
9 | ///auth expection
10 |
11 | FirebaseAuthException({required this.code, required this.message});
12 |
13 | @override
14 | String toString() => 'FirebaseAuthException: $code - $message';
15 | }
16 |
--------------------------------------------------------------------------------
/firebase-dart-admin-auth-sdk/lib/src/popup_redirect_resolver.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | ///popup redirect
4 |
5 | abstract class PopupRedirectResolver {
6 | ///resolve popup
7 | Future