Skip to content

Commit 81330e5

Browse files
committed
fixed
1 parent 2809557 commit 81330e5

18 files changed

+38
-30
lines changed

lib/app.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class MyApp extends StatelessWidget {
6969
accentColor: const Color(0xFF00e676),
7070
),
7171
routes: routes,
72+
debugShowCheckedModeBanner: false,
7273
),
7374
);
7475
}

lib/data/user_repository_imp.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ class UserRepositoryImpl implements UserRepository {
175175
///
176176
Single<Result<T>> _execute<T>(Future<T> Function() factory) =>
177177
Single.fromCallable(factory)
178-
.doOnError(
179-
_handleUnauthenticatedError) // TODO(single): remove singleOrError
180-
.singleOrError()
178+
.doOnError(_handleUnauthenticatedError)
181179
.map<Result<T>>((value) => Success<T>(value))
182180
.onErrorReturnWith(_errorToResult);
183181

lib/domain/usecases/change_password_use_case.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class ChangePasswordUseCase {
66

77
const ChangePasswordUseCase(this._userRepository);
88

9-
Stream<Result<void>> call({
9+
Stream<Result_Unit> call({
1010
required String password,
1111
required String newPassword,
1212
}) =>

lib/domain/usecases/login_use_case.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class LoginUseCase {
66

77
const LoginUseCase(this._userRepository);
88

9-
Stream<Result<void>> call({
9+
Stream<Result_Unit> call({
1010
required String email,
1111
required String password,
1212
}) =>

lib/domain/usecases/logout_use_case.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class LogoutUseCase {
66

77
const LogoutUseCase(this._userRepository);
88

9-
Stream<Result<void>> call() => _userRepository.logout();
9+
Stream<Result_Unit> call() => _userRepository.logout();
1010
}

lib/domain/usecases/register_use_case.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class RegisterUseCase {
66

77
const RegisterUseCase(this._userRepository);
88

9-
Stream<Result<void>> call({
9+
Stream<Result_Unit> call({
1010
required String name,
1111
required String email,
1212
required String password,

lib/domain/usecases/reset_password_use_case.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class ResetPasswordUseCase {
66

77
const ResetPasswordUseCase(this._userRepository);
88

9-
Stream<Result<void>> call({
9+
Stream<Result_Unit> call({
1010
required String email,
1111
required String token,
1212
required String newPassword,

lib/domain/usecases/send_reset_password_email_use_case.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class SendResetPasswordEmailUseCase {
66

77
const SendResetPasswordEmailUseCase(this._userRepository);
88

9-
Stream<Result<void>> call(String email) =>
9+
Stream<Result_Unit> call(String email) =>
1010
_userRepository.sendResetPasswordEmail(email);
1111
}

lib/domain/usecases/upload_image_use_case.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ class UploadImageUseCase {
88

99
const UploadImageUseCase(this._userRepository);
1010

11-
Stream<Result<void>> call(File image) => _userRepository.uploadImage(image);
11+
Stream<Result_Unit> call(File image) => _userRepository.uploadImage(image);
1212
}

lib/pages/home/change_password/change_password_bloc.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:node_auth/utils/result.dart';
99
import 'package:node_auth/utils/streams.dart';
1010
import 'package:node_auth/utils/type_defs.dart';
1111
import 'package:rxdart/rxdart.dart';
12+
import 'package:rxdart_ext/rxdart_ext.dart';
1213
import 'package:tuple/tuple.dart';
1314

1415
bool _isValidPassword(String password) {
@@ -66,6 +67,7 @@ class ChangePasswordBloc extends DisposeCallbackBaseBloc {
6667

6768
final changePasswordState$ = submitChangePasswordS.stream
6869
.withLatestFrom(isValidSubmit$, (_, bool isValid) => isValid)
70+
.debug()
6971
.where((isValid) => isValid)
7072
.withLatestFrom(both$, (_, Tuple2<String, String> both) => both)
7173
.exhaustMap((both) => _performChangePassword(changePassword, both))
@@ -116,7 +118,11 @@ class ChangePasswordBloc extends DisposeCallbackBaseBloc {
116118
}.debug();
117119

118120
return ChangePasswordBloc._(
119-
dispose: DisposeBag([...subscriptions, ...controllers]).dispose,
121+
dispose: DisposeBag([
122+
...subscriptions,
123+
...controllers,
124+
changePasswordState$.connect(),
125+
]).dispose,
120126
changePassword: () => submitChangePasswordS.add(null),
121127
changePasswordState$: changePasswordState$,
122128
passwordChanged: passwordS.add,
@@ -132,7 +138,7 @@ class ChangePasswordBloc extends DisposeCallbackBaseBloc {
132138
) {
133139
print('[DEBUG] change password both=$both');
134140

135-
ChangePasswordState resultToState(Result<void> result) {
141+
ChangePasswordState resultToState(Result_Unit result) {
136142
print('[DEBUG] change password result=$result');
137143

138144
return result.fold(

0 commit comments

Comments
 (0)