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

套件詳情v1.0.0

async_storage_reader

Flutter 套件,用於讀取 React Native 應用的 AsyncStorage 資料,協助遷移至 Flutter 時避免資料遺失。

AndroidiOS
近 30 天下載
209
喜歡數
33
Pub 分數
150

安裝套件

flutter pub add async_storage_reader

套件介紹

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

一個專為讀取 React Native AsyncStorage 中儲存資料而設計的 Flutter 套件,可實現從 React Native 應用到 Flutter 的無縫資料遷移。它提供了一種簡單的方法來存取序列化的鍵值對,無需更改現有的儲存邏輯。在應用轉換期間,此套件特別有用,因為保留使用者資料至關重要。它支援 Android 和 iOS 平台,確保廣泛的相容性。透過利用原生檔案系統存取,它能安全地提取資料並維持完整性。

適用情境

  • 從 React Native 迁移到 Flutter
  • 在應用轉換期間保留使用者偏好
  • 讀取舊版 AsyncStorage 檔案
  • 支援混合應用開發階段
  • 在框架之間實現資料可攜性

主要特色

  • 讀取 AsyncStorage JSON 檔案
  • 跨平台(Android 與 iOS)
  • 所需設定最少
  • 安全數據提取
  • 相容 React Native 的儲存格式

適合對象

  • 從 React Native 迁移到 Flutter 的開發者
  • 管理應用過渡的團隊
  • 需要資料連續性的專案
  • 混合應用維護
  • 資料恢復場景

使用建議

  • 僅讀取資料——不寫入
  • 需要正確的檔案路徑存取
  • 不適用於即時同步
  • 限制為 AsyncStorage 格式
  • 不支援加密

原始 README

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

Migrate Local Data from React Native to Flutter - async_storage_reader

A Flutter package created to assist in migrating data from a React Native app by accessing and reading AsyncStorage for Android and iOS. It allows reading of AsyncStorage data from react native app, like user session tokens, preferences, other configurations, and cached data are preserved without logging out or data loss during migration to a new Flutter app.

Note: Please ensure that both the React Native and Flutter apps have the same bundle ID (for iOS) and application ID (for Android).

Why This Package?

When migrating from React Native to Flutter, one of the most significant challenges is ensuring that existing data stored in the app is preserved. This could include user session tokens, settings, cached preferences, or any other key-value pairs that were previously stored using React Native's AsyncStorage. Without this, users might lose their preferences or be logged out. This package solves the problem by offering an easy way to access all AsyncStorage in your new Flutter app.

Demo Preview

Demo Preview

Platform Support for async_storage_reader

The async_storage_reader package provides support for both Android and iOS platforms.

Features

  • Read individual key-value pairs from React Native's AsyncStorage.
  • Retrieve all key-value pairs stored in AsyncStorage.
  • Support for both Android and iOS platforms.
  • Prevent user logouts during app migrations by retrieving session tokens or other vital data.
  • Provides methods to read, remove, and clear storage data.

Getting Started

To use this package, add async_storage_reader as a dependency in your pubspec.yaml file:

dependencies:
  async_storage_reader: ^1.0.0

Example Usage

import 'package:async_storage_reader/async_storage_reader.dart';

final reader = AsyncStorageReader();

String? value = await reader.getItem('your_key');
print(value);  

Map<String, String> allItems = await reader.getAllItems();
print(allItems);  

bool success = await reader.removeItem('your_key');
print(success);  

bool success = await reader.clear();
print(success);  

License

This project is licensed under the MIT License - see the LICENSE file for details.

Connect With Me

GitHub: bilalrehman08 Linkedin: bilalrehman08 [YouTube: Bilal Rehman][youtube] Instagram: bilalrehman08 [Gmail: bilalrehman080808@gmail.com][gmail]

[gmail]: mailto:bilalrehman080808@gmail.com [youtube]: https://www.youtube.com/@bilalrehman08 [license]: https://github.com/BilalRehman08/Async-Storage-Reader/blob/main/LICENSE

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。