chore/cleanup #159
@ -35,7 +35,7 @@ class AlbumsScreen extends BlocScreen<AlbumBloc, AlbumEvent, AlbumState> {
 | 
			
		||||
      bloc..add(AlbumFetched());
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget onWrap(BuildContext context, Widget child) => AlbumsWrapperWidget(
 | 
			
		||||
  Widget parent(BuildContext context, Widget child) => AlbumsWrapperWidget(
 | 
			
		||||
        child: child,
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -43,7 +43,7 @@ class PhotoDetailsScreen
 | 
			
		||||
      bloc..load(photoId);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget onWrap(BuildContext context, Widget child) =>
 | 
			
		||||
  Widget parent(BuildContext context, Widget child) =>
 | 
			
		||||
      PhotoDetailsWrapperWidget(child: child);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
 | 
			
		||||
@ -37,7 +37,7 @@ class PhotosScreen extends BlocScreen<PhotoBloc, PhotoEvent, PhotoState> {
 | 
			
		||||
      bloc..add(PhotoFetched(albumId));
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget onWrap(BuildContext context, Widget child) => PhotosWrapperWidget(
 | 
			
		||||
  Widget parent(BuildContext context, Widget child) => PhotosWrapperWidget(
 | 
			
		||||
        child: child,
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -35,7 +35,7 @@ class EditProfileCubit extends FormDataCubitImpl {
 | 
			
		||||
        status: FormStatus.submissionInProgress,
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
    final user = (await authenticationRepository.getAccount()).ok;
 | 
			
		||||
    // final user = (await authenticationRepository.getAccount()).ok;
 | 
			
		||||
 | 
			
		||||
    final form = state.form;
 | 
			
		||||
    final email = form.valueOf<String?>(AuthFormField.email);
 | 
			
		||||
 | 
			
		||||
@ -20,6 +20,6 @@ import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:flutter_bloc/flutter_bloc.dart';
 | 
			
		||||
 | 
			
		||||
void main() {
 | 
			
		||||
  BlocOverrides.runZoned(() => runApp(const CounterRepositoryProviderPage()),
 | 
			
		||||
      blocObserver: CounterObserver());
 | 
			
		||||
  Bloc.observer = CounterObserver();
 | 
			
		||||
  runApp(const CounterRepositoryProviderPage());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -7,24 +7,24 @@ class ExampleCubit extends Cubit<CrudState> {
 | 
			
		||||
 | 
			
		||||
  FutureOr<void> run() async {
 | 
			
		||||
    while (true) {
 | 
			
		||||
      await Future.delayed(const Duration(seconds: 1));
 | 
			
		||||
      await Future<void>.delayed(const Duration(seconds: 1));
 | 
			
		||||
      emit(CrudLoading());
 | 
			
		||||
      await Future.delayed(const Duration(seconds: 1));
 | 
			
		||||
      await Future<void>.delayed(const Duration(seconds: 1));
 | 
			
		||||
      emit(const CrudError('Cubit Error'));
 | 
			
		||||
      await Future.delayed(const Duration(seconds: 1));
 | 
			
		||||
      await Future<void>.delayed(const Duration(seconds: 1));
 | 
			
		||||
      emit(const CrudLoaded<String>('DATA LOADED'));
 | 
			
		||||
      await Future.delayed(const Duration(seconds: 1));
 | 
			
		||||
      await Future<void>.delayed(const Duration(seconds: 1));
 | 
			
		||||
      emit(CrudInitial());
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  FutureOr<void> runList() async {
 | 
			
		||||
    while (true) {
 | 
			
		||||
      await Future.delayed(const Duration(seconds: 1));
 | 
			
		||||
      await Future<void>.delayed(const Duration(seconds: 1));
 | 
			
		||||
      emit(CrudLoading());
 | 
			
		||||
      await Future.delayed(const Duration(seconds: 1));
 | 
			
		||||
      await Future<void>.delayed(const Duration(seconds: 1));
 | 
			
		||||
      emit(const CrudError('Cubit Error'));
 | 
			
		||||
      await Future.delayed(const Duration(seconds: 1));
 | 
			
		||||
      await Future<void>.delayed(const Duration(seconds: 1));
 | 
			
		||||
      emit(
 | 
			
		||||
        const CrudListLoaded<String>([
 | 
			
		||||
          'DATA LOADED 1',
 | 
			
		||||
@ -33,7 +33,7 @@ class ExampleCubit extends Cubit<CrudState> {
 | 
			
		||||
          'DATA LOADED 4'
 | 
			
		||||
        ]),
 | 
			
		||||
      );
 | 
			
		||||
      await Future.delayed(const Duration(seconds: 1));
 | 
			
		||||
      await Future<void>.delayed(const Duration(seconds: 1));
 | 
			
		||||
      emit(CrudInitial());
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -21,10 +21,6 @@ import 'package:form_bloc_example/app/bloc_observer.dart';
 | 
			
		||||
 | 
			
		||||
Future<void> main() async {
 | 
			
		||||
  WidgetsFlutterBinding.ensureInitialized();
 | 
			
		||||
  BlocOverrides.runZoned(
 | 
			
		||||
    () => runApp(
 | 
			
		||||
      const App(),
 | 
			
		||||
    ),
 | 
			
		||||
    blocObserver: AppBlocObserver(),
 | 
			
		||||
  );
 | 
			
		||||
  Bloc.observer = AppBlocObserver();
 | 
			
		||||
  runApp(const App());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -66,7 +66,7 @@ Future<void> handleDigest(HttpRequest req) async {
 | 
			
		||||
Future<void> handleUnsafe(HttpRequest req) async {
 | 
			
		||||
  print(
 | 
			
		||||
    'Query parameters => '
 | 
			
		||||
    '${req.uri.queryParameters.toString()}',
 | 
			
		||||
    '${req.uri.queryParameters}',
 | 
			
		||||
  );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -82,8 +82,8 @@ class VerifyCode {
 | 
			
		||||
      VerifyCode.fromMap(json.decode(source) as Map<String, dynamic>);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String toString() =>
 | 
			
		||||
      'VerifyCode(email: $email, verificationCode: $verificationCode, action: $action)';
 | 
			
		||||
  String toString() => 'VerifyCode(email: $email, verificationCode: '
 | 
			
		||||
      '$verificationCode, action: $action)';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class Account {
 | 
			
		||||
@ -198,8 +198,8 @@ class TokenSuccess {
 | 
			
		||||
      TokenSuccess.fromMap(json.decode(source) as Map<String, dynamic>);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String toString() =>
 | 
			
		||||
      'TokenSuccess(accessToken: $accessToken, refreshToken: $refreshToken, account: $account)';
 | 
			
		||||
  String toString() => 'TokenSuccess(accessToken: $accessToken, refreshToken: '
 | 
			
		||||
      '$refreshToken, account: $account)';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class Login {
 | 
			
		||||
@ -353,19 +353,19 @@ void main(List<String> args) async {
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  await api.sendSignUpCode('git@pcl.ovh');
 | 
			
		||||
  final verifiedAccount = await api.verifyCode(
 | 
			
		||||
    VerifyCode(
 | 
			
		||||
      email: 'git@pcl.ovh',
 | 
			
		||||
      verificationCode: '000000000',
 | 
			
		||||
      action: EmailVerificationAction.signUp,
 | 
			
		||||
    ),
 | 
			
		||||
  );
 | 
			
		||||
  final registeredAccount = await api.signUp(
 | 
			
		||||
    SignUp(sessionId: verifiedAccount.sessionId ?? '', password: 'password'),
 | 
			
		||||
  );
 | 
			
		||||
  final signedInAccount = await api.signInWithPassword(
 | 
			
		||||
    Login(email: 'git@pcl.ovh', password: 'password'),
 | 
			
		||||
  );
 | 
			
		||||
  // final verifiedAccount = await api.verifyCode(
 | 
			
		||||
  //   VerifyCode(
 | 
			
		||||
  //     email: 'git@pcl.ovh',
 | 
			
		||||
  //     verificationCode: '000000000',
 | 
			
		||||
  //     action: EmailVerificationAction.signUp,
 | 
			
		||||
  //   ),
 | 
			
		||||
  // );
 | 
			
		||||
  // final registeredAccount = await api.signUp(
 | 
			
		||||
  //   SignUp(sessionId: verifiedAccount.sessionId ?? '', password: 'password'),
 | 
			
		||||
  // );
 | 
			
		||||
  // final signedInAccount = await api.signInWithPassword(
 | 
			
		||||
  //   Login(email: 'git@pcl.ovh', password: 'password'),
 | 
			
		||||
  // );
 | 
			
		||||
  final accountList = await api.getAccountList();
 | 
			
		||||
  print(accountList);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -45,7 +45,8 @@ import 'package:wyatt_http_client/src/utils/protocols.dart';
 | 
			
		||||
//   BaseResponse onResponse(BaseResponse response) {
 | 
			
		||||
//     final res = child?.onResponse(response) ?? response;
 | 
			
		||||
//     print(
 | 
			
		||||
//       'RequestMutator::OnResponse: ${res.statusCode} -> ${res.contentLength} bytes',
 | 
			
		||||
//       'RequestMutator::OnResponse: ${res.statusCode} -> ${res.contentLength}
 | 
			
		||||
// bytes',
 | 
			
		||||
//     );
 | 
			
		||||
//     return res;
 | 
			
		||||
//   }
 | 
			
		||||
@ -75,7 +76,8 @@ import 'package:wyatt_http_client/src/utils/protocols.dart';
 | 
			
		||||
//         if (response != null) return response;
 | 
			
		||||
 | 
			
		||||
//         return Future.sync(() => innerHandler(request))
 | 
			
		||||
//             .then((response) => responseHandler!(response), onError: onError);
 | 
			
		||||
//             .then((response) => responseHandler!(response), onError:
 | 
			
		||||
// onError);
 | 
			
		||||
//       });
 | 
			
		||||
//     };
 | 
			
		||||
//   };
 | 
			
		||||
 | 
			
		||||
@ -30,6 +30,8 @@ class Pipeline {
 | 
			
		||||
  /// Add a [Middleware] to this [Pipeline]
 | 
			
		||||
  Pipeline addMiddleware(Middleware middleware) {
 | 
			
		||||
    _middlewares.add(middleware);
 | 
			
		||||
    // TODO(hpcl): use Dart cascades instead of returning this
 | 
			
		||||
    // ignore: avoid_returning_this
 | 
			
		||||
    return this;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user