diff --git a/packages/wyatt_architecture/example/lib/presentation/features/albums/state_management/albums_screen.dart b/packages/wyatt_architecture/example/lib/presentation/features/albums/state_management/albums_screen.dart index 2aae70fd..b180827e 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/albums/state_management/albums_screen.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/albums/state_management/albums_screen.dart @@ -35,7 +35,7 @@ class AlbumsScreen extends BlocScreen { bloc..add(AlbumFetched()); @override - Widget onWrap(BuildContext context, Widget child) => AlbumsWrapperWidget( + Widget parent(BuildContext context, Widget child) => AlbumsWrapperWidget( child: child, ); diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photo_details/state_management/photo_details_screen.dart b/packages/wyatt_architecture/example/lib/presentation/features/photo_details/state_management/photo_details_screen.dart index 4cbc2e83..98a41c54 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photo_details/state_management/photo_details_screen.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photo_details/state_management/photo_details_screen.dart @@ -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 diff --git a/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/photos_screen.dart b/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/photos_screen.dart index 57ceef4e..bf9352dd 100644 --- a/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/photos_screen.dart +++ b/packages/wyatt_architecture/example/lib/presentation/features/photos/state_management/photos_screen.dart @@ -37,7 +37,7 @@ class PhotosScreen extends BlocScreen { bloc..add(PhotoFetched(albumId)); @override - Widget onWrap(BuildContext context, Widget child) => PhotosWrapperWidget( + Widget parent(BuildContext context, Widget child) => PhotosWrapperWidget( child: child, ); diff --git a/packages/wyatt_authentication_bloc/example/lib/presentation/features/edit_profile/blocs/edit_profile_cubit.dart b/packages/wyatt_authentication_bloc/example/lib/presentation/features/edit_profile/blocs/edit_profile_cubit.dart index c92aa597..40063f4c 100644 --- a/packages/wyatt_authentication_bloc/example/lib/presentation/features/edit_profile/blocs/edit_profile_cubit.dart +++ b/packages/wyatt_authentication_bloc/example/lib/presentation/features/edit_profile/blocs/edit_profile_cubit.dart @@ -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(AuthFormField.email); diff --git a/packages/wyatt_bloc_helper/example/lib/main.dart b/packages/wyatt_bloc_helper/example/lib/main.dart index a707077c..3d825120 100644 --- a/packages/wyatt_bloc_helper/example/lib/main.dart +++ b/packages/wyatt_bloc_helper/example/lib/main.dart @@ -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()); } diff --git a/packages/wyatt_bloc_layout/example/lib/bloc/example_cubit.dart b/packages/wyatt_bloc_layout/example/lib/bloc/example_cubit.dart index 6ae6a19b..80c20d1a 100644 --- a/packages/wyatt_bloc_layout/example/lib/bloc/example_cubit.dart +++ b/packages/wyatt_bloc_layout/example/lib/bloc/example_cubit.dart @@ -7,24 +7,24 @@ class ExampleCubit extends Cubit { FutureOr run() async { while (true) { - await Future.delayed(const Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); emit(CrudLoading()); - await Future.delayed(const Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); emit(const CrudError('Cubit Error')); - await Future.delayed(const Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); emit(const CrudLoaded('DATA LOADED')); - await Future.delayed(const Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); emit(CrudInitial()); } } FutureOr runList() async { while (true) { - await Future.delayed(const Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); emit(CrudLoading()); - await Future.delayed(const Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); emit(const CrudError('Cubit Error')); - await Future.delayed(const Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); emit( const CrudListLoaded([ 'DATA LOADED 1', @@ -33,7 +33,7 @@ class ExampleCubit extends Cubit { 'DATA LOADED 4' ]), ); - await Future.delayed(const Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); emit(CrudInitial()); } } diff --git a/packages/wyatt_form_bloc/example/lib/main.dart b/packages/wyatt_form_bloc/example/lib/main.dart index 42275ce9..28a8f3d9 100644 --- a/packages/wyatt_form_bloc/example/lib/main.dart +++ b/packages/wyatt_form_bloc/example/lib/main.dart @@ -21,10 +21,6 @@ import 'package:form_bloc_example/app/bloc_observer.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - BlocOverrides.runZoned( - () => runApp( - const App(), - ), - blocObserver: AppBlocObserver(), - ); + Bloc.observer = AppBlocObserver(); + runApp(const App()); } diff --git a/packages/wyatt_http_client/example/http_client_example.dart b/packages/wyatt_http_client/example/http_client_example.dart index 3787f1c8..43009540 100644 --- a/packages/wyatt_http_client/example/http_client_example.dart +++ b/packages/wyatt_http_client/example/http_client_example.dart @@ -66,7 +66,7 @@ Future handleDigest(HttpRequest req) async { Future handleUnsafe(HttpRequest req) async { print( 'Query parameters => ' - '${req.uri.queryParameters.toString()}', + '${req.uri.queryParameters}', ); } diff --git a/packages/wyatt_http_client/example/http_client_fastapi_example.dart b/packages/wyatt_http_client/example/http_client_fastapi_example.dart index a671d464..b9a900fd 100644 --- a/packages/wyatt_http_client/example/http_client_fastapi_example.dart +++ b/packages/wyatt_http_client/example/http_client_fastapi_example.dart @@ -82,8 +82,8 @@ class VerifyCode { VerifyCode.fromMap(json.decode(source) as Map); @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); @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 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); } diff --git a/packages/wyatt_http_client/example/pipeline.dart b/packages/wyatt_http_client/example/pipeline.dart index 334fc509..7f261f39 100644 --- a/packages/wyatt_http_client/example/pipeline.dart +++ b/packages/wyatt_http_client/example/pipeline.dart @@ -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); // }); // }; // }; diff --git a/packages/wyatt_http_client/lib/src/pipeline.dart b/packages/wyatt_http_client/lib/src/pipeline.dart index ae4029ec..3cebc400 100644 --- a/packages/wyatt_http_client/lib/src/pipeline.dart +++ b/packages/wyatt_http_client/lib/src/pipeline.dart @@ -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; }