up method

  1. @override
Future<void> up()
override

Adds the data.

Runs inside the app, so it can use your models, Auth, NyStorage and API services. Every storage and Backpack change made here is recorded. Seeding again runs it again; rolling back still returns to how the app was before the first run.

Implementation

@override
Future<void> up() async {
  final int count = await snapshot.apply();
  success('Imported $count ${count == 1 ? 'value' : 'values'}');
}