b012_data
2.1.0, released 2 weeks ago by b012tech.com
Spring Boot-inspired local SQLite CRUD and file helpers for Flutter entities.
What it does
Automatically generates SQLite CRUD statements from plain Dart entity classes without manual SQL or repository boilerplate. Provides file system helpers for reading, writing, and managing binary files and paths. Supports optional database and file encryption.
AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want local SQLite persistence without writing hand-written SQL or repositories
- You need file system helpers alongside local database storage
- You want optional encryption for your local database and files
Skip it when
- You need a cloud-synced backend database
- You require a full ORM with complex relationship mapping
Strengths
- No hand-written SQL or repository boilerplate required
- Handles both local SQLite CRUD and file system storage
- Supports cross-platform including mobile, desktop, and web
Weaknesses
- Requires careful exception handling as most entity methods throw when tables do not exist
- First access creates a default database named sqlf_easy.db unless changed
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 9
Make sure Flutter bindings are initialized with WidgetsFlutterBinding.ensureInitialized() before calling methods that need the application documents directory.
class Person {
String? idPers;
String? firstName;
String? lastName;
bool? sex;
DateTime? dateOfBirth;
MapEntry<String, bool> get pKeyAuto => const MapEntry('idPers', false);
List<String> get notNulls => <String>['firstName', 'lastName', 'sex', 'dateOfBirth'];
Person([this.idPers, this.firstName, this.lastName, this.sex, this.dateOfBirth]);
Map<String, dynamic> toMap() => {
'idPers': idPers ?? ColumnType.String,
'firstName': firstName ?? ColumnType.String,
'lastName': lastName ?? ColumnType.String,
'sex': sex ?? ColumnType.bool,
'dateOfBirth': dateOfBirth ?? ColumnType.DateTime,
};
Person.fromMap(Map<String, Object?> json, {bool isInt = true}) {
idPers = json['idPers'] as String?;
firstName = json['firstName'] as String?;
lastName = json['lastName'] as String?;
sex = boolean(json['sex'], isInt: isInt);
dateOfBirth = dateTime(json['dateOfBirth'] as String?);
}
Person fromMap(Map<String, Object?> json) => Person.fromMap(json);
}Alternatives
Packages that do the same job and could replace b012_data.
Works with
Packages commonly used together with b012_data: ones it builds on, ones built on it, and its own family.
- cryptob012_data depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- webb012_data depends on itLightweight bindings for browser APIs via JS interop
- path_providerb012_data depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- sqflite_commonb012_data depends on itDart wrapper on SQLite providing the common API for sqflite and desktop FFI implementations.
- sqlite3b012_data depends on itLightweight and convenient SQLite bindings for Dart using dart:ffi
- sqfliteb012_data depends on itSQLite plugin for Flutter supporting iOS, Android and MacOS.
- cryptographyb012_data depends on itCross‑platform cryptographic algorithms for Dart and Flutter.
- sqflite_common_ffib012_data depends on itFFI-based implementation of sqflite for desktop platforms and unit tests.