i_auth.dart 815 B

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