ms_persist 0.1.0+1 copy "ms_persist: ^0.1.0+1" to clipboard
ms_persist: ^0.1.0+1 copied to clipboard

outdated

A mixin that help you on handling model as a CRUD, you just need implement 3 overrides

MS Persist #

A mixin that help you on handling model as a CRUD

Getting Started #

Is very simple to start use.

After set the lib in pubspec.yaml and run flutter pub get

import 'package:ms_persist/ms_persist.dart';

class YourModel with Persist<YourModel> {
  // .. a lot of another fields
  //TODO: implement field uuid
  @override
  String uuid;

  YourModel({this.uuid/*other fields*/});

  //TODO: implement buildModel
  @override
  YourModel buildModel(Map<String, dynamic> map){
    return YourModel(
      uuid: map['uuid'],
      );
  }

  //TODO: implement toMap
  @override
  Map<String, dynamic> toMap(){
    return {
      'uuid': this.uuid,
      //TODO: add here every field or extra data that you want to save
    };
  }
}

That's all folks!

I hope you enjoy this lib.

10
likes
0
pub points
32%
popularity

Publisher

verified publishermarcussoftware.info

A mixin that help you on handling model as a CRUD, you just need implement 3 overrides

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, path, path_provider, sembast, uuid

More

Packages that depend on ms_persist