https://github.com/lamun-my-id/datalocal
Flutter dependency to save data via local saved with state, easy to use and fast.
https://github.com/lamun-my-id/datalocal
database easy-to-use fast flutter localdatabase secure
Last synced: 4 months ago
JSON representation
Flutter dependency to save data via local saved with state, easy to use and fast.
- Host: GitHub
- URL: https://github.com/lamun-my-id/datalocal
- Owner: lamun-my-id
- License: mit
- Created: 2024-03-26T06:58:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2026-01-27T07:31:34.000Z (5 months ago)
- Last Synced: 2026-01-27T20:24:20.035Z (5 months ago)
- Topics: database, easy-to-use, fast, flutter, localdatabase, secure
- Language: Dart
- Homepage:
- Size: 339 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Data Local
Plugin package to store data locally with storage techniques using the "shared preferences" plugin, this plugin already supports Android, iOS, Web, Windows, MacOS, and Linux. Data storage and data retrieval use isolates, so it can maximize the performance of flutter.
In addition, storing data in a structured manner, so it can be used to replace a local database. and there are various ways to call data, change data and delete data.
You can try it on
[datalocal.web.app](https://datalocal.web.app).
## Getting Started
The plugin itself is quite easy to use. Just call the DataLocal().create() method with the arguments. Don't forget to name the data state for example "notes". After that, you can do whatever you need such as inserting data, updating data, deleting data.
The state data will be reloaded when the app is restarted, but the data will remain there, until the app is removed or uninstalled.
#### Initialize example
```dart
state = await DataLocal.create("notes", onRefresh: () => setState(() {}));
```
change the name "note" with the name of the appropriate collection.
onRefresh can be filled in for what will be done when there is a data change (create, update, delete).
### Usage
for data usage and retrieval. Can be done using find(), this can also be done by sorting and filtering data easily. The result of data retrieval is a DataQuery containing data, the amount of data and the amount of data searched.
DataItem is the data that is stored, you can retrieve data directly in the form of Map or you can retrieve data according to the desired field using data.get(Datakey("field name")).
```dart
child: FutureBuilder(
future: state.find(sorts:[DataSort(DataKey("#createdAt"))]),
builder: (_, snapshot){
if(!snapshot.hasData) return CircularProgressIndicator();
DataQuery query = snapshot.data;
List datas = query.data;
return Column(
children: List.generate(datas.length, (index){
DataItem data = datas[index];
return Text(data.get(DataKey("title")));
},
);
)
},
),
```
## Contribution
You can request new features, file issues for missing features relevant to this plugin. You can also help by pointing out any bugs. Feedback is also welcome.
## Status
DataLocal will continue to be active in helping especially ourselves in project development.
## Support the package (optional)
If you find this package useful, you can support it by giving it a star.
## Credits
This package is developed by void