i_auth.dart 1011 B

123456789101112131415161718192021222324252627
  1. import 'package:dartz/dartz.dart';
  2. import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
  3. import 'package:flowy_sdk/protobuf/flowy-folder-data-model/protobuf.dart';
  4. import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
  5. import 'package:flutter/material.dart';
  6. class NewUser {
  7. UserProfile profile;
  8. String workspaceId;
  9. NewUser({
  10. required this.profile,
  11. required this.workspaceId,
  12. });
  13. }
  14. abstract class IAuth {
  15. Future<Either<UserProfile, FlowyError>> signIn(String? email, String? password);
  16. Future<Either<UserProfile, FlowyError>> signUp(String? name, String? password, String? email);
  17. Future<Either<Unit, FlowyError>> signOut();
  18. }
  19. abstract class IAuthRouter {
  20. void pushWelcomeScreen(BuildContext context, UserProfile userProfile);
  21. void pushSignUpScreen(BuildContext context);
  22. void pushForgetPasswordScreen(BuildContext context);
  23. void pushHomeScreen(BuildContext context, UserProfile profile, CurrentWorkspaceSetting workspaceSetting);
  24. }