truesight_core 2312.17.1 truesight_core: ^2312.17.1 copied to clipboard
Core functions for TrueSight packages
Core functions for TrueSight packages.
Features #
- Json serialization
- Repository pattern
- Backend-compatible data structures
Getting started #
This package can be installed in any Dart application.
Để cài đặt:
flutter pub add truesight_core
Usage #
Json serialization #
import 'package:truesight_core/truesight_core.dart';
class User extends DataModel {
JsonNumber id = JsonNumber("id");
JsonString name = JsonString("name");
JsonBoolean isAdmin = JsonBoolean("isAdmin");
JsonDate birthday = JsonDate("birthday");
JsonList<User> members = JsonList<User>("members");
JsonObject<User> manager = JsonObject<User>("manager");
}
Repository pattern #
import 'package:truesight_core/truesight_core.dart';
class UserRepository extends Repository {
}
Backend-compatible data structures #
class DataFilter {
int skip = 0;
int take = 10;
String? orderBy;
OrderType? orderType;
}
enum OrderType {
asc,
desc,
}
Additional information #
Nothing here.