i_auth.dart 914 B

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