FLUTTER ECOSYSTEM

BilalRehman08/Async-Storage-Reader

BilalRehman08/Async-Storage-Reader open-source repository details.

非同步儲存讀取器 專案封面
Stars
3
Forks
0
最近推送(UTC)
2024年10月13日
專案狀態
未封存
Bilal Rehman GitHub avatar
GITHUB User

Bilal Rehman ↗

Sr. Software Engineer | Software Consultant | Mentoring Successful Careers

語言DartRubySwiftKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 8 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 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