搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.6

altogic

Altogic 的 Dart 客戶端。Altogic 是一個後端應用程式開發與執行平台,讓個人與企業能夠設計、部署與管理可擴展的應用程式。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
100
喜歡數
10
Pub 分數
140

安裝套件

flutter pub add altogic

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Altogic 是 Altogic 後端平台的 Dart 客戶端,讓開發者能夠建構、部署和管理具備整合後端服務的可擴展應用程式。它提供 Flutter 應用與 Altogic 的雲基礎設施之間的無縫連接,提供即時資料同步、驗證、檔案儲存和資料庫作業等功能。該客戶端支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,非常適合跨平台應用程式開發。專注於簡潔與效能,Altogic 減少後端複雜性,同時加速應用程式的交付。

適用情境

  • 即時應用開發
  • 跨平台後端整合
  • 使用者身分驗證管理
  • 基於雲的資料儲存
  • 可擴展的應用程式部署
  • 檔案上傳和檢索

主要特色

  • 即時資料同步
  • 內建驗證
  • 雲資料庫存取
  • 檔案儲存服務
  • 平台無關的 SDK
  • RESTful API 兼容性

適合對象

  • 全端 Flutter 開發人員
  • 新創企業建構最小可行產品
  • 需要快速建立後端的團隊
  • 需要即時更新的應用
  • 具有多平台需求的專案

使用建議

  • 需要 Altogic 帳戶
  • 依賴雲端基礎設施
  • 無後端程式碼的有限自訂
  • 新使用者的學習曲線
  • 即時功能的網路依賴

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Altogic Dart

Altogic Dart is a Dart client for the Altogic Client Library. It provides access to all the functionality of the Altogic Client Library.

This package includes some Flutter dependencies in addition to the altogic_dart package.

Quick start

This altogic client library guide will show you how to use the key modules of the client library to execute commands in your backend app. For more in-depth coverage, see the Client API reference.

Flutter Guides / Examples

Additional Functionalities

Default Local Storage

AltogicClient needs a local storage implementation to hold sessions and user information. This package provides a default local storage implementation that uses the shared_preferences package.

import 'package:altogic_dart_flutter/altogic_dart_flutter.dart';

final altogic = createClient(
    'your env url',
    'your client key'
);

Auto Open Sign In With Provider URLs

AltogicClient can open sign-in with provider URLs automatically. You can use the AuthManager.signInWithProvider method to open sign-in with provider URLs directly.

altogic.auth.signInWithProvider('google');

Handle Redirect URLs

In many authentication flows/operations, Altogic redirects your user to a specific URL.

For example, oAuth2 flow after the user signed in with the provider sign-in page, Altogic redirects the user to the redirect URL you specified in the Altogic Designer > App Settings > Authentication.

You can handle redirect URLs on websites by getting which path opens the site.

You can use deep linking in mobile or desktop applications to open the application from a redirect URL.

Deep Linking Configuration
AltogicState

If you use "AltogicState" at the root of the application, the "AltogicState" will be "mounted" throughout the application lifecycle. Thus, we can listen to the deep links when the application is resumed or launched with a deep link.

When the application opens by a deep link, AltogicState cannot synchronously inform you about the deep link. Instead, you can override methods to be called when a deep link opens the application.

Available methods to override: onEmailVerificationLink, onMagicLink, onOauthProviderLink, onEmailChangeLink, onPasswordResetLink.

AltogicState provides a getter named navigatorObserver to observe navigation events. You can use BuildContext as the parameter for deep linking methods. If you use navigatorObserver, e.g., onMagicLink called with context; otherwise, BuildContext will be null for these methods.


class AltogicAuthExampleApp extends StatefulWidget {
  const AltogicAuthExampleApp({Key? key}) : super(key: key);

  @override
  State<AltogicAuthExampleApp> createState() => _AltogicAuthExampleAppState();
}

class _AltogicAuthExampleAppState extends AltogicState<AltogicAuthExampleApp> {
  @override
  void onEmailVerificationLink(BuildContext? context, EmailVerificationRedirect redirect) {
    // Handle email verification link
  }

  @override
  void onMagicLink(BuildContext? context, MagicLinkRedirect redirect) {
    // Handle magic link
  }

  @override
  void onPasswordResetLink(BuildContext? context, PasswordResetRedirect redirect) {
    // Handle password reset link
  }

  @override
  void onEmailChangeLink(BuildContext? context, ChangeEmailRedirect redirect) {
    // Handle email change link
  }

  @override
  void onOauthProviderLink(BuildContext? context, OauthRedirect redirect) {
    // Handle oauth provider link
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorObservers: [navigatorObserver],
      // ...
    );
  }
}

When Application Not Running

Generally, in the first run of the application, many developers show a splash screen. In this case, the application is launched with a deep link, AuthState.onX methods are triggered, and maybe the user is navigated to another page from the triggered method. Also, the splash screen will try to navigate to another page. This case causes a conflict.

To avoid this conflict, you can use AltogicState.applicationInitialRedirect static getter:

Future<void> init() async {
  // Check if the application was launched with a deep link
  var launchedRedirect = await AltogicState.applicationInitialRedirect;
  if (launchedRedirect != null) {
    return;
  }
  // navigate now
}

You can use the AltogicState.applicationInitialRedirect getter instead of the AltogicState.onX methods. But you have to listen to ApplicationLifecycle events manually to handle deep links.

Restore Auth Session

AltogicClient can restore the session from local storage. To do this, you can use the AltogicClient.restoreAuthSession method.

If the application is not running and launched with a deep link, the restoreAuthSession method checks if the application launched with a deep-link. If the application opens with a deep-link, the restoreAuthSession method will not restore the session from local storage. (Necessary to avoid conflicts)

await altogic.restoreAuthSession();

Learn more

You can use the following resources to learn more and get help

Bugs Report

Think you’ve found a bug? Please, send us an email [support@altogic.com](mailto:support@altogic.com) or open issue on GitHub.

altogic_dart package repository
altogic package repository

Support / Feedback

For issues with, questions about, feedback for the client library, or want to see a new feature please, send us an email [support@altogic.com](mailto:support@altogic.com) or reach out to our community forums

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。