mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-09-06 15:23:48 +00:00
42 lines
1.2 KiB
Dart
42 lines
1.2 KiB
Dart
import 'package:dartz/dartz.dart';
|
|
import 'package:flowy_sdk/protobuf/flowy-workspace/app_create.pb.dart';
|
|
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
|
|
import 'package:app_flowy/home/domain/i_app.dart';
|
|
import 'package:app_flowy/home/infrastructure/app_repo.dart';
|
|
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
|
|
|
|
export 'package:app_flowy/home/domain/i_app.dart';
|
|
|
|
class IAppImpl extends IApp {
|
|
AppRepository repo;
|
|
IAppImpl({
|
|
required this.repo,
|
|
});
|
|
|
|
@override
|
|
Future<Either<App, WorkspaceError>> createApp(
|
|
{required String name, String? desc}) {
|
|
return repo.createApp(name, desc ?? "");
|
|
}
|
|
|
|
@override
|
|
Future<Either<List<App>, WorkspaceError>> getApps(
|
|
{required String workspaceId}) {
|
|
return repo.getApps(workspaceId: workspaceId);
|
|
}
|
|
|
|
@override
|
|
Future<Either<List<View>, WorkspaceError>> getViews({required String appId}) {
|
|
return repo.getViews(appId: appId);
|
|
}
|
|
|
|
@override
|
|
Future<Either<View, WorkspaceError>> createView(
|
|
{required String appId,
|
|
required String name,
|
|
String? desc,
|
|
required ViewTypeIdentifier viewType}) {
|
|
return repo.createView(appId, name, desc ?? "", viewType);
|
|
}
|
|
}
|