orange 1.1.5 orange: ^1.1.5 copied to clipboard
orange database is super fast and esay modern key-value store. working everywhere.and no need build_runner
Orange Database 🍊 #
Features #
- ✨ Super Fast Speed 100 x faster than SharedPreference
- 🦄 Super Easy: No initialization required, same api as SharedPreference
- 🚀 All Environment Work: Working on Android, iOS, Web, Mac, Windows, Linux even cli.
- 🌐 No Build Runner: Do not waste your time on build_runner
Installation #
flutter pub add orange
Usage #
await Orange.setString('orange', 'is delicious! 🍊');
String? orange = await Orange.getString('orange');
print(orange); // is delicious! 🍊
await Orange.remove('orange');
you got all usage of Orange now! 🎉
Benchmark #
read & write 10000 times with Orange Database 🍊 and shared_preferences
Execution orange 🍊 write performance test time: 6 ms
Execution orange 🍊 read performance test time: 1 ms
Execution shared_preferences write performance test time: 49228 ms
Execution shared_preferences read performance test time: 28 ms
you can re run the benchmark test this repository
Advanced Usage #
Initialize #
if you need initialize first, you can use Orange.init()
method.
this is useful when handling a large amount of data. because orange database need load data from disk when first access.
await Orange.init();
Check Saved Disk Time #
if you want to check if the data is saved on disk, you can use Orange.isSavedToDisk()
method.
bool isSaved = await Orange.isSavedToDisk('orange');
print(isSaved); // true