パッケージ、リポジトリ、アプリカテゴリを検索

logarte のカバー
パッケージ詳細v1.5.0

logarte

ネットワークインスペクタ、ストレージモニタ、パスワード保護を備えたFlutterアプリ用の強力なアプリ内デバッグコンソール

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
6880
いいね数
249
Pub ポイント
120

パッケージをインストール

flutter pub add logarte

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Logarte は、Flutter アプリケーション向けの包括的なアプリ内デバッグコンソールであり、リアルタイムログ、ネットワーク検査、ストレージモニタリング、およびパスワード保護されたアクセスを提供し、機密データを保護します。開発者向けに設計されており、Android、iOS、Web、macOS、Windows、Linux など複数のプラットフォームで開発およびテスト中にアプリの動作を追跡するための直感的なインターフェースを提供します。このパッケージは、主要なツールを1つのセキュアなインターフェースに統合することで、デバッグ効率を向上させ、ターミナルログに頼らずに問題を診断しやすくなります。

用途

  • Flutter アプリのリアルタイムデバッグ
  • ネットワーク要求と応答のモニタリング
  • ローカルストレージおよび共有設定の確認
  • パスワード保護でデバッグツールを保護する
  • 複数のプラットフォーム間でアプリの動作をテストする

主な機能

  • 豊富なUIを備えたアプリ内デバッグコンソール
  • ネットワークリクエストインスペクタ
  • ローカルデータのストレージモニタ
  • パスワード保護されたアクセス
  • クロスプラットフォーム対応(Android、iOS、Web、macOS、Windows、Linux)

適している対象

  • アクティブな開発中のFlutter開発者
  • セキュアなデバッグアクセスが必要なチーム
  • 詳細な実行時診断を必要とするアプリ
  • 機密データ処理を含むプロジェクト
  • 複雑な状態やネットワークの問題をデバッグする

注意事項

  • 本番リリースを想定していない
  • デバッグモードでは手動で有効にする必要があります
  • アプリのサイズがわずかに増加する可能性があります
  • パスワードは実行時で設定する必要があります
  • 開発およびテスト環境に限定

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

logarte

In-app debug console and logger for Flutter apps.

📦 Features

  • 🚀 In-app console: Monitor your app inside your app
  • 🔒 Access control: Optional password protection
  • 📡 Network inspector: Track API calls and responses
  • 📁 Storage monitor: Track local storage operations
  • 📤 Copy & export: Share debug logs with your team
  • 📄 Curl command: Copy cURL command for API requests

📱 Screenshots

Console API Request Password

🩵 Sponsors

Want to say "thanks"? Check out our sponsors:

🪚 Usage

Add to pubspec.yaml
dependencies:
  logarte: ^0.2.1

Then run flutter pub get.

Initialize

Create a global Logarte instance:

final Logarte logarte = Logarte(
    // Protect with password
    password: '1234',
    
    // Skip password in debug mode
    ignorePassword: kDebugMode,

    // Share network request
    onShare: (String content) {
      Share.share(content);
    },

    // To have logs in IDE's debug console (default is false)
    disableDebugConsoleLogs: false,

    // Add shortcut actions (optional)
    onRocketLongPressed: (context) {
      // e.g: toggle theme mode
    }
    onRocketDoubleTapped: (context) {
      // e.g: change language
    }
);
Enable the debug console
In debug mode

Ideally, you should attach the floating button to the widget tree, then click it to open the debug console. This is the preferred way because you don't know when you'll need it and sometimes you might need to go back and forth many times. So, it's better to have it on the UI always.

@override
void initState() {
  super.initState();
  
  logarte.attach(
    context: context,
    visible: kDebugMode,
  );
}

This will attach the floating button when in debug mode. Curious how you can access it in production when it's not debug mode? Check below.

In production

Logarte is as valuable in production mode as it is in debug mode. Whenever you find a bug, notice something not working, API requests failing, etc., you should be able to check the console and find why.

Two ways to access in production:

Hidden gesture trigger

LogarteMagicalTap is a widget that attaches the floating button to the UI when tapped 10 times. Wrap any non-tappable widget, keep it secret, and make sure you've set a password while initializing.

LogarteMagicalTap(
  logarte: logarte,
  child: Text('App Version 1.0'),
)
Manual trigger

You might also have creative ideas on when and how to open the console. For example, I used a shake detection plugin and attached the floating button when the device was shaken 3 times consecutively. From my experience, this is extremely valuable. Why? Imagine: you've opened your app, went to deeper screens, and an API call failed. You say 'Thank God I've already integrated logarte. Let's open that console!' But you need to go to the page where you used LogarteMagicalTap, which might be too far or not visible at that stage of the app - maybe you're showing it on the profile page and you are on the login page. So be creative about where to add it and consider using shake detection or anything that would serve you better.

logarte.openConsole(context);

Different from the .attach(context) method, this will directly open the console (password page if set, else the console itself).

Log network requests
With Dio
dio.interceptors.add(LogarteDioInterceptor(logarte));

That's it? Yes, that's it. Now, all the network requests will be logged in both the debug and the graphical console.

With other HTTP clients
// After your HTTP request:
logarte.network(
  request: NetworkRequestLogarteEntry(
    method: 'POST',
    url: endpoint,
    headers: headers,
    body: body,
  ),
  response: NetworkResponseLogarteEntry(
    statusCode: response.statusCode,
    headers: response.headers,
    body: response.body,
  ),
);
Log messages
logarte.log('Button clicked');

This will log messages in both your IDE's debug console and the in-app logarte console.

Track navigation
MaterialApp(
  navigatorObservers: [LogarteNavigatorObserver(logarte)],
)
Track storage operations
logarte.database(
  target: 'language',
  value: 'en',
  source: 'SharedPreferences',
);
Add custom debug tab

While initializing, you can pass a custom tab widget to the Logarte instance. This tab will be shown in the console.

This is useful when you want to add a custom tab to the console, for example, to change the environment, copy device's FCM token, clear local cache, etc.

final Logarte logarte = Logarte(
  ...
  customTab: const MyCustomTab(),
  ...
);

🕹️ Example

See the complete example in this repository.

📄 License

MIT License - see LICENSE.

カテゴリー

依存関係

依存関係一覧 1 件

  • dio>=4.0.0 <6.0.0

ソースリポジトリ

このパッケージを使用しているプロジェクト