i_app.dart 779 B

12345678910111213141516171819202122
  1. import 'package:flowy_sdk/protobuf/flowy-workspace/protobuf.dart';
  2. import 'package:dartz/dartz.dart';
  3. typedef AppUpdatedCallback = void Function(String name, String desc);
  4. typedef AppCreateViewCallback = void Function(Either<List<View>, WorkspaceError> viewsOrFailed);
  5. typedef AppDeleteViewCallback = void Function(Either<List<View>, WorkspaceError> viewsOrFailed);
  6. abstract class IApp {
  7. Future<Either<List<View>, WorkspaceError>> getViews();
  8. Future<Either<View, WorkspaceError>> createView({required String name, String? desc, required ViewType viewType});
  9. }
  10. abstract class IAppListenr {
  11. void start(
  12. {AppCreateViewCallback? addViewCallback,
  13. AppDeleteViewCallback? deleteViewCallback,
  14. AppUpdatedCallback? updatedCallback});
  15. Future<void> stop();
  16. }