repository_base.dart 389 B

123456789101112131415
  1. import 'dart:async' show Future;
  2. import 'package:pb_authenticator_totp/totp.dart';
  3. /// Abstract class for loading/saving state from storage.
  4. abstract class RepositoryBase<T> {
  5. /// Load list of items from repository.
  6. Future<List<T>> loadItems();
  7. /// Replace list of items.
  8. Future replaceItems(List<T> state);
  9. /// Add an item to the list.
  10. Future<T> addItem(TotpItem item);
  11. }