From f9f8c3ad6a3a3e4ddecda49807066aeae4787223 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Mon, 6 Feb 2023 21:03:21 +0600 Subject: [PATCH 01/20] text and popup (#25116) --- .../frontend/assets/translations/en.yaml | 6 +- .../pages/tour/widgets/solution_button.dart | 66 ++++++++++++++++++- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/learning/tour-of-beam/frontend/assets/translations/en.yaml b/learning/tour-of-beam/frontend/assets/translations/en.yaml index e1a9530fe314..bb427ab28071 100644 --- a/learning/tour-of-beam/frontend/assets/translations/en.yaml +++ b/learning/tour-of-beam/frontend/assets/translations/en.yaml @@ -18,6 +18,7 @@ ui: about: About Tour of Beam builtWith: Built with Apache Beam + cancel: Cancel continueGitHub: Continue with GitHub continueGoogle: Continue with Google copyright: © The Apache Software Foundation @@ -27,7 +28,6 @@ ui: reportIssue: Report Issue in GitHub signIn: Sign in signOut: Sign out - solution: Solution toWebsite: To Apache Beam website pages: @@ -38,7 +38,11 @@ pages: startTour: Start your tour title: Welcome to the Tour of Beam! tour: + assignment: Assignment completeUnit: Complete Unit + showSolution: Show + solution: Solution + solveYourself: Before revealing the solution, try solving the challenge on your own. Remember, the more you practice, the better you will become. Give it a shot and see how far you can get. summaryTitle: Table of Contents dialogs: diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart index 5318e6514288..00225f25249e 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart @@ -19,8 +19,10 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:playground_components/playground_components.dart'; import '../../../assets/assets.gen.dart'; +import '../../../constants/sizes.dart'; import '../state.dart'; class SolutionButton extends StatelessWidget { @@ -42,9 +44,69 @@ class SolutionButton extends StatelessWidget { : null, ), ), - onPressed: tourNotifier.toggleShowingSolution, + onPressed: () { + showDialog( + context: context, + builder: (context) => Dialog( + backgroundColor: Colors.transparent, + child: _Popup(tourNotifier: tourNotifier), + ), + ); + }, icon: SvgPicture.asset(Assets.svg.solution), - label: const Text('ui.solution').tr(), + label: Text( + tourNotifier.isShowingSolution + ? 'pages.tour.assignment' + : 'pages.tour.solution', + ).tr(), + ), + ); + } +} + +class _Popup extends StatelessWidget { + final TourNotifier tourNotifier; + + const _Popup({ + required this.tourNotifier, + }); + + @override + Widget build(BuildContext context) { + return OverlayBody( + child: Container( + width: TobSizes.hintPopupWidth, + padding: const EdgeInsets.all(BeamSizes.size16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'pages.tour.solveYourself', + style: Theme.of(context).textTheme.headlineMedium, + ).tr(), + const SizedBox(height: BeamSizes.size8), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text('ui.cancel').tr(), + ), + const SizedBox(width: BeamSizes.size8), + TextButton( + onPressed: () { + tourNotifier.toggleShowingSolution(); + Navigator.pop(context); + }, + child: const Text('pages.tour.showSolution').tr(), + ), + ], + ), + ], + ), ), ); } From eda0bfec9a04d2a26d923085410dde66fb3fe235 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Mon, 6 Feb 2023 22:39:12 +0600 Subject: [PATCH 02/20] delete my account (#25255) --- .../frontend/assets/translations/en.yaml | 4 +- .../frontend/lib/auth/notifier.dart | 11 ++- .../lib/components/profile/user_menu.dart | 24 +++++- .../frontend/lib/constants/sizes.dart | 1 - .../tour-of-beam/frontend/lib/locator.dart | 16 ++-- .../lib/pages/tour/widgets/hints.dart | 2 +- .../pages/tour/widgets/solution_button.dart | 58 ++------------ .../lib/repositories/client/client.dart | 2 + .../client/cloud_functions_client.dart | 13 ++++ .../lib/playground_components.dart | 1 + .../lib/src/constants/sizes.dart | 1 + .../lib/src/widgets/dialogs/alert_dialog.dart | 78 +++++++++++++++++++ 12 files changed, 147 insertions(+), 64 deletions(-) create mode 100644 playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart diff --git a/learning/tour-of-beam/frontend/assets/translations/en.yaml b/learning/tour-of-beam/frontend/assets/translations/en.yaml index bb427ab28071..12cfe9aeb552 100644 --- a/learning/tour-of-beam/frontend/assets/translations/en.yaml +++ b/learning/tour-of-beam/frontend/assets/translations/en.yaml @@ -23,7 +23,8 @@ ui: continueGoogle: Continue with Google copyright: © The Apache Software Foundation hint: Hint - deleteAccount: Delete my account + deleteMyAccount: Delete my account + deleteTobAccount: Delete my Tour of Beam account privacyPolicy: Privacy Policy reportIssue: Report Issue in GitHub signIn: Sign in @@ -47,6 +48,7 @@ pages: dialogs: signInIf: If you would like to save your progress and track completed modules + deleteAccountWarning: Are you sure you want to delete your Tour of Beam account? This will permanently erase your learning progress. complexity: basic: Basic level diff --git a/learning/tour-of-beam/frontend/lib/auth/notifier.dart b/learning/tour-of-beam/frontend/lib/auth/notifier.dart index 2eb7be819f39..636b6540d646 100644 --- a/learning/tour-of-beam/frontend/lib/auth/notifier.dart +++ b/learning/tour-of-beam/frontend/lib/auth/notifier.dart @@ -22,8 +22,12 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart'; import 'package:flutter/material.dart'; +import '../repositories/client/client.dart'; + class AuthNotifier extends ChangeNotifier { - AuthNotifier() { + final TobClient client; + + AuthNotifier({required this.client}) { FirebaseAuth.instance.authStateChanges().listen((user) { notifyListeners(); }); @@ -42,4 +46,9 @@ class AuthNotifier extends ChangeNotifier { Future logOut() async { await FirebaseAuth.instance.signOut(); } + + Future deleteAccount() async { + await client.postDeleteUserProgress(); + await FirebaseAuth.instance.currentUser?.delete(); + } } diff --git a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart index 5fb49fa7192b..94dc350adc7f 100644 --- a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart +++ b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart @@ -125,9 +125,29 @@ class _Buttons extends StatelessWidget { ), const BeamDivider(), _IconLabel( - onTap: () {}, + onTap: () { + closeOverlayCallback(); + showDialog( + context: context, + builder: (context) => Dialog( + backgroundColor: Colors.transparent, + child: BeamAlertDialog( + continueLabel: 'ui.deleteMyAccount'.tr(), + title: 'ui.deleteTobAccount'.tr(), + body: 'dialogs.deleteAccountWarning'.tr(), + onContinue: () { + authNotifier.deleteAccount().then( + (_) { + Navigator.pop(context); + }, + ); + }, + ), + ), + ); + }, iconPath: Assets.svg.profileDelete, - label: 'ui.deleteAccount'.tr(), + label: 'ui.deleteMyAccount'.tr(), ), ], ); diff --git a/learning/tour-of-beam/frontend/lib/constants/sizes.dart b/learning/tour-of-beam/frontend/lib/constants/sizes.dart index fd0eec3b97d1..53ad1c7c2d03 100644 --- a/learning/tour-of-beam/frontend/lib/constants/sizes.dart +++ b/learning/tour-of-beam/frontend/lib/constants/sizes.dart @@ -19,7 +19,6 @@ class TobSizes { static const double footerHeight = 35; static const double authOverlayWidth = 260; - static const double hintPopupWidth = 420; } class ScreenSizes { diff --git a/learning/tour-of-beam/frontend/lib/locator.dart b/learning/tour-of-beam/frontend/lib/locator.dart index 7bdb0406edd0..44ff02f0b324 100644 --- a/learning/tour-of-beam/frontend/lib/locator.dart +++ b/learning/tour-of-beam/frontend/lib/locator.dart @@ -31,6 +31,8 @@ import 'router/page_factory.dart'; import 'router/route_information_parser.dart'; import 'state.dart'; +final _client = CloudFunctionsTobClient(); + Future initializeServiceLocator() async { _initializeAuth(); _initializeState(); @@ -38,17 +40,15 @@ Future initializeServiceLocator() async { } void _initializeAuth() { - GetIt.instance.registerSingleton(AuthNotifier()); + GetIt.instance.registerSingleton(AuthNotifier(client: _client)); } void _initializeCaches() { - final client = CloudFunctionsTobClient(); - - GetIt.instance.registerSingleton(client); - GetIt.instance.registerSingleton(ContentTreeCache(client: client)); - GetIt.instance.registerSingleton(SdkCache(client: client)); - GetIt.instance.registerSingleton(UnitContentCache(client: client)); - GetIt.instance.registerSingleton(UnitProgressCache(client: client)); + GetIt.instance.registerSingleton(_client); + GetIt.instance.registerSingleton(ContentTreeCache(client: _client)); + GetIt.instance.registerSingleton(SdkCache(client: _client)); + GetIt.instance.registerSingleton(UnitContentCache(client: _client)); + GetIt.instance.registerSingleton(UnitProgressCache(client: _client)); } void _initializeState() { diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart index 4ae39f99e5df..dc045f447f3b 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart @@ -63,7 +63,7 @@ class _Popup extends StatelessWidget { Widget build(BuildContext context) { return OverlayBody( child: Container( - width: TobSizes.hintPopupWidth, + width: BeamSizes.popupWidth, padding: const EdgeInsets.all(BeamSizes.size16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart index 00225f25249e..ead733280d25 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart @@ -22,7 +22,6 @@ import 'package:flutter_svg/svg.dart'; import 'package:playground_components/playground_components.dart'; import '../../../assets/assets.gen.dart'; -import '../../../constants/sizes.dart'; import '../state.dart'; class SolutionButton extends StatelessWidget { @@ -49,7 +48,14 @@ class SolutionButton extends StatelessWidget { context: context, builder: (context) => Dialog( backgroundColor: Colors.transparent, - child: _Popup(tourNotifier: tourNotifier), + child: BeamAlertDialog( + continueLabel: 'pages.tour.showSolution'.tr(), + title: 'pages.tour.solveYourself'.tr(), + onContinue: () { + tourNotifier.toggleShowingSolution(); + Navigator.pop(context); + }, + ), ), ); }, @@ -63,51 +69,3 @@ class SolutionButton extends StatelessWidget { ); } } - -class _Popup extends StatelessWidget { - final TourNotifier tourNotifier; - - const _Popup({ - required this.tourNotifier, - }); - - @override - Widget build(BuildContext context) { - return OverlayBody( - child: Container( - width: TobSizes.hintPopupWidth, - padding: const EdgeInsets.all(BeamSizes.size16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - 'pages.tour.solveYourself', - style: Theme.of(context).textTheme.headlineMedium, - ).tr(), - const SizedBox(height: BeamSizes.size8), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - onPressed: () { - Navigator.pop(context); - }, - child: const Text('ui.cancel').tr(), - ), - const SizedBox(width: BeamSizes.size8), - TextButton( - onPressed: () { - tourNotifier.toggleShowingSolution(); - Navigator.pop(context); - }, - child: const Text('pages.tour.showSolution').tr(), - ), - ], - ), - ], - ), - ), - ); - } -} diff --git a/learning/tour-of-beam/frontend/lib/repositories/client/client.dart b/learning/tour-of-beam/frontend/lib/repositories/client/client.dart index 66fd4a996316..419962271a02 100644 --- a/learning/tour-of-beam/frontend/lib/repositories/client/client.dart +++ b/learning/tour-of-beam/frontend/lib/repositories/client/client.dart @@ -31,4 +31,6 @@ abstract class TobClient { Future getUserProgress(String sdkId); Future postUnitComplete(String sdkId, String id); + + Future postDeleteUserProgress(); } diff --git a/learning/tour-of-beam/frontend/lib/repositories/client/cloud_functions_client.dart b/learning/tour-of-beam/frontend/lib/repositories/client/cloud_functions_client.dart index 8986de435290..5138948881cf 100644 --- a/learning/tour-of-beam/frontend/lib/repositories/client/cloud_functions_client.dart +++ b/learning/tour-of-beam/frontend/lib/repositories/client/cloud_functions_client.dart @@ -101,4 +101,17 @@ class CloudFunctionsTobClient extends TobClient { }, ); } + + @override + Future postDeleteUserProgress() async { + final token = await GetIt.instance.get().getToken(); + await http.post( + Uri.parse( + '$cloudFunctionsBaseUrl/postDeleteProgress', + ), + headers: { + HttpHeaders.authorizationHeader: 'Bearer $token', + }, + ); + } } diff --git a/playground/frontend/playground_components/lib/playground_components.dart b/playground/frontend/playground_components/lib/playground_components.dart index 5cc842e554af..524cb03b7c89 100644 --- a/playground/frontend/playground_components/lib/playground_components.dart +++ b/playground/frontend/playground_components/lib/playground_components.dart @@ -60,6 +60,7 @@ export 'src/util/string.dart'; export 'src/widgets/bubble.dart'; export 'src/widgets/clickable.dart'; export 'src/widgets/complexity.dart'; +export 'src/widgets/dialogs/alert_dialog.dart'; export 'src/widgets/divider.dart'; export 'src/widgets/header_icon_button.dart'; export 'src/widgets/loading_error.dart'; diff --git a/playground/frontend/playground_components/lib/src/constants/sizes.dart b/playground/frontend/playground_components/lib/src/constants/sizes.dart index d98ccd044881..8a85dfb61e23 100644 --- a/playground/frontend/playground_components/lib/src/constants/sizes.dart +++ b/playground/frontend/playground_components/lib/src/constants/sizes.dart @@ -43,6 +43,7 @@ class BeamSizes { static const double loadingIndicator = 40; static const double splitViewSeparator = BeamSizes.size8; static const double tabBarHeight = 50; + static const double popupWidth = 420; } class BeamBorderRadius { diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart new file mode 100644 index 000000000000..a188a537c11e --- /dev/null +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; + +import '../../../playground_components.dart'; + +class BeamAlertDialog extends StatelessWidget { + final String? body; + final String continueLabel; + final VoidCallback onContinue; + final String title; + + const BeamAlertDialog({ + this.body, + required this.continueLabel, + required this.onContinue, + required this.title, + }); + + @override + Widget build(BuildContext context) { + return OverlayBody( + child: Container( + width: BeamSizes.popupWidth, + padding: const EdgeInsets.all(BeamSizes.size16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + title, + style: Theme.of(context).textTheme.headlineMedium, + ), + if (body != null) + Padding( + padding: const EdgeInsets.only(top: BeamSizes.size8), + child: Text(body!), + ), + const SizedBox(height: BeamSizes.size8), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + // TODO(nausharipov): review: translate in PGC? + child: const Text('Cancel'), + ), + const SizedBox(width: BeamSizes.size8), + TextButton( + onPressed: onContinue, + child: Text(continueLabel), + ), + ], + ), + ], + ), + ), + ); + } +} From d67cf474ceb5932b996438953536a87a355a6077 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Mon, 6 Feb 2023 22:51:55 +0600 Subject: [PATCH 03/20] pre-review fixes (#25255) --- .../frontend/lib/components/profile/user_menu.dart | 2 +- .../frontend/lib/pages/tour/widgets/hints.dart | 1 - .../frontend/lib/pages/tour/widgets/solution_button.dart | 7 ++----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart index 94dc350adc7f..2f0cc83aed8d 100644 --- a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart +++ b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart @@ -132,9 +132,9 @@ class _Buttons extends StatelessWidget { builder: (context) => Dialog( backgroundColor: Colors.transparent, child: BeamAlertDialog( + body: 'dialogs.deleteAccountWarning'.tr(), continueLabel: 'ui.deleteMyAccount'.tr(), title: 'ui.deleteTobAccount'.tr(), - body: 'dialogs.deleteAccountWarning'.tr(), onContinue: () { authNotifier.deleteAccount().then( (_) { diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart index dc045f447f3b..57d9cfacf73d 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart @@ -22,7 +22,6 @@ import 'package:flutter_svg/svg.dart'; import 'package:playground_components/playground_components.dart'; import '../../../assets/assets.gen.dart'; -import '../../../constants/sizes.dart'; import 'markdown/tob_markdown.dart'; class HintsWidget extends StatelessWidget { diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart index ead733280d25..96a05b1b7ea1 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart @@ -44,6 +44,7 @@ class SolutionButton extends StatelessWidget { ), ), onPressed: () { + // TODO(nausharipov): resolve the conflict with save user code showDialog( context: context, builder: (context) => Dialog( @@ -60,11 +61,7 @@ class SolutionButton extends StatelessWidget { ); }, icon: SvgPicture.asset(Assets.svg.solution), - label: Text( - tourNotifier.isShowingSolution - ? 'pages.tour.assignment' - : 'pages.tour.solution', - ).tr(), + label: const Text('ui.solution').tr(), ), ); } From bc4d930945bc76e261c7a815ff54961b862032ca Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Mon, 6 Feb 2023 23:05:50 +0600 Subject: [PATCH 04/20] todo (#25255) --- .../lib/src/widgets/popups/alert_dialog.dart | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 playground/frontend/playground_components/lib/src/widgets/popups/alert_dialog.dart diff --git a/playground/frontend/playground_components/lib/src/widgets/popups/alert_dialog.dart b/playground/frontend/playground_components/lib/src/widgets/popups/alert_dialog.dart new file mode 100644 index 000000000000..cd2af67de267 --- /dev/null +++ b/playground/frontend/playground_components/lib/src/widgets/popups/alert_dialog.dart @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; + +import '../../../playground_components.dart'; + +// TODO(nausharipov): review: dialog or popup? +class BeamAlertDialog extends StatelessWidget { + final String? body; + final String continueLabel; + final VoidCallback onContinue; + final String title; + + const BeamAlertDialog({ + this.body, + required this.continueLabel, + required this.onContinue, + required this.title, + }); + + @override + Widget build(BuildContext context) { + return OverlayBody( + child: Container( + width: BeamSizes.popupWidth, + padding: const EdgeInsets.all(BeamSizes.size16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + title, + style: Theme.of(context).textTheme.headlineMedium, + ), + if (body != null) + Padding( + padding: const EdgeInsets.only(top: BeamSizes.size8), + child: Text(body!), + ), + const SizedBox(height: BeamSizes.size8), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + // TODO(nausharipov): review: translate in PGC? + child: const Text('Cancel'), + ), + const SizedBox(width: BeamSizes.size8), + TextButton( + onPressed: onContinue, + child: Text(continueLabel), + ), + ], + ), + ], + ), + ), + ); + } +} From 17b8c429d59842e04f2ff6b072fd9f0674e56a9f Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Tue, 7 Feb 2023 14:51:56 +0600 Subject: [PATCH 05/20] comment fixes (#25255) --- .../lib/components/profile/user_menu.dart | 25 +++--- .../pages/tour/widgets/solution_button.dart | 17 ++-- .../assets/translations/en.yaml | 4 +- .../lib/src/widgets/dialogs/alert_dialog.dart | 75 +++++++++--------- .../lib/src/widgets/popups/alert_dialog.dart | 79 ------------------- 5 files changed, 60 insertions(+), 140 deletions(-) delete mode 100644 playground/frontend/playground_components/lib/src/widgets/popups/alert_dialog.dart diff --git a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart index 2f0cc83aed8d..4e5aa574b348 100644 --- a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart +++ b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart @@ -129,20 +129,17 @@ class _Buttons extends StatelessWidget { closeOverlayCallback(); showDialog( context: context, - builder: (context) => Dialog( - backgroundColor: Colors.transparent, - child: BeamAlertDialog( - body: 'dialogs.deleteAccountWarning'.tr(), - continueLabel: 'ui.deleteMyAccount'.tr(), - title: 'ui.deleteTobAccount'.tr(), - onContinue: () { - authNotifier.deleteAccount().then( - (_) { - Navigator.pop(context); - }, - ); - }, - ), + builder: (context) => BeamAlertDialog( + text: 'dialogs.deleteAccountWarning'.tr(), + continueLabel: 'ui.deleteMyAccount'.tr(), + title: 'ui.deleteTobAccount'.tr(), + onContinue: () { + authNotifier.deleteAccount().then( + (_) { + Navigator.pop(context); + }, + ); + }, ), ); }, diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart index 96a05b1b7ea1..7d78861ce310 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart @@ -47,16 +47,13 @@ class SolutionButton extends StatelessWidget { // TODO(nausharipov): resolve the conflict with save user code showDialog( context: context, - builder: (context) => Dialog( - backgroundColor: Colors.transparent, - child: BeamAlertDialog( - continueLabel: 'pages.tour.showSolution'.tr(), - title: 'pages.tour.solveYourself'.tr(), - onContinue: () { - tourNotifier.toggleShowingSolution(); - Navigator.pop(context); - }, - ), + builder: (context) => BeamAlertDialog( + continueLabel: 'pages.tour.showSolution'.tr(), + title: 'pages.tour.solveYourself'.tr(), + onContinue: () { + tourNotifier.toggleShowingSolution(); + Navigator.pop(context); + }, ), ); }, diff --git a/playground/frontend/playground_components/assets/translations/en.yaml b/playground/frontend/playground_components/assets/translations/en.yaml index 3c6b720c6941..702b34a9d789 100644 --- a/playground/frontend/playground_components/assets/translations/en.yaml +++ b/playground/frontend/playground_components/assets/translations/en.yaml @@ -15,6 +15,9 @@ # specific language governing permissions and limitations # under the License. +dialogs: + cancel: Cancel + errors: error: 'Error' loading: 'Error while loading.' @@ -35,7 +38,6 @@ intents: reset: 'Reset Code' widgets: - codeEditor: label: 'Code Text Area' diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart index a188a537c11e..77d6d3e33f45 100644 --- a/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart @@ -16,61 +16,64 @@ * limitations under the License. */ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import '../../../playground_components.dart'; class BeamAlertDialog extends StatelessWidget { - final String? body; + final String? text; final String continueLabel; final VoidCallback onContinue; final String title; const BeamAlertDialog({ - this.body, required this.continueLabel, required this.onContinue, required this.title, + this.text, }); @override Widget build(BuildContext context) { - return OverlayBody( - child: Container( - width: BeamSizes.popupWidth, - padding: const EdgeInsets.all(BeamSizes.size16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - title, - style: Theme.of(context).textTheme.headlineMedium, - ), - if (body != null) - Padding( - padding: const EdgeInsets.only(top: BeamSizes.size8), - child: Text(body!), + return Dialog( + backgroundColor: Colors.transparent, + child: OverlayBody( + child: Container( + width: BeamSizes.popupWidth, + padding: const EdgeInsets.all(BeamSizes.size16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + title, + style: Theme.of(context).textTheme.headlineMedium, ), - const SizedBox(height: BeamSizes.size8), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - onPressed: () { - Navigator.pop(context); - }, - // TODO(nausharipov): review: translate in PGC? - child: const Text('Cancel'), + if (text != null) + Padding( + padding: const EdgeInsets.only(top: BeamSizes.size8), + child: Text(text!), ), - const SizedBox(width: BeamSizes.size8), - TextButton( - onPressed: onContinue, - child: Text(continueLabel), - ), - ], - ), - ], + const SizedBox(height: BeamSizes.size8), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text('dialogs.cancel').tr(), + ), + const SizedBox(width: BeamSizes.size8), + TextButton( + onPressed: onContinue, + child: Text(continueLabel), + ), + ], + ), + ], + ), ), ), ); diff --git a/playground/frontend/playground_components/lib/src/widgets/popups/alert_dialog.dart b/playground/frontend/playground_components/lib/src/widgets/popups/alert_dialog.dart deleted file mode 100644 index cd2af67de267..000000000000 --- a/playground/frontend/playground_components/lib/src/widgets/popups/alert_dialog.dart +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'package:flutter/material.dart'; - -import '../../../playground_components.dart'; - -// TODO(nausharipov): review: dialog or popup? -class BeamAlertDialog extends StatelessWidget { - final String? body; - final String continueLabel; - final VoidCallback onContinue; - final String title; - - const BeamAlertDialog({ - this.body, - required this.continueLabel, - required this.onContinue, - required this.title, - }); - - @override - Widget build(BuildContext context) { - return OverlayBody( - child: Container( - width: BeamSizes.popupWidth, - padding: const EdgeInsets.all(BeamSizes.size16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - title, - style: Theme.of(context).textTheme.headlineMedium, - ), - if (body != null) - Padding( - padding: const EdgeInsets.only(top: BeamSizes.size8), - child: Text(body!), - ), - const SizedBox(height: BeamSizes.size8), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - onPressed: () { - Navigator.pop(context); - }, - // TODO(nausharipov): review: translate in PGC? - child: const Text('Cancel'), - ), - const SizedBox(width: BeamSizes.size8), - TextButton( - onPressed: onContinue, - child: Text(continueLabel), - ), - ], - ), - ], - ), - ), - ); - } -} From 2ab46ec1199414d3a2335d2d00523f15446a5124 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Wed, 8 Feb 2023 19:07:00 +0600 Subject: [PATCH 06/20] GitHub auth untested (#25255) --- .../frontend/lib/components/login/content.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/learning/tour-of-beam/frontend/lib/components/login/content.dart b/learning/tour-of-beam/frontend/lib/components/login/content.dart index ae1fe80fa028..88f1d2b1a3c1 100644 --- a/learning/tour-of-beam/frontend/lib/components/login/content.dart +++ b/learning/tour-of-beam/frontend/lib/components/login/content.dart @@ -84,10 +84,13 @@ class _BrandedLoginButtons extends StatelessWidget { required this.onLoggedIn, }); + Future _logIn(AuthProvider authProvider) async { + await GetIt.instance.get().logIn(authProvider); + onLoggedIn(); + } + @override Widget build(BuildContext context) { - final authNotifier = GetIt.instance.get(); - final isLightTheme = Theme.of(context).brightness == Brightness.light; final textStyle = MaterialStatePropertyAll(Theme.of(context).textTheme.bodyMedium); @@ -124,16 +127,17 @@ class _BrandedLoginButtons extends StatelessWidget { return Column( children: [ ElevatedButton.icon( - onPressed: () {}, + onPressed: () { + _logIn(GithubAuthProvider()); + }, style: isLightTheme ? githubLightButtonStyle : darkButtonStyle, icon: SvgPicture.asset(Assets.svg.githubLogo), label: const Text('ui.continueGitHub').tr(), ), const SizedBox(height: BeamSizes.size16), ElevatedButton.icon( - onPressed: () async { - await authNotifier.logIn(GoogleAuthProvider()); - onLoggedIn(); + onPressed: () { + _logIn(GoogleAuthProvider()); }, style: isLightTheme ? googleLightButtonStyle : darkButtonStyle, icon: SvgPicture.asset(Assets.svg.googleLogo), From eda3f16254e6bebb503359efd2c62a4b0bd48091 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Thu, 9 Feb 2023 14:39:43 +0600 Subject: [PATCH 07/20] showProgressOverlay (#25255) --- .../lib/components/profile/user_menu.dart | 10 ++--- .../lib/playground_components.dart | 3 +- .../lib/src/widgets/overlay/opener.dart | 6 ++- .../lib/src/widgets/overlay/overlays.dart | 44 +++++++++++++++++++ .../overlay/{dismissible.dart => widget.dart} | 15 ++++--- 5 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart rename playground/frontend/playground_components/lib/src/widgets/overlay/{dismissible.dart => widget.dart} (80%) diff --git a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart index 4e5aa574b348..e85232766d49 100644 --- a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart +++ b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart @@ -133,11 +133,11 @@ class _Buttons extends StatelessWidget { text: 'dialogs.deleteAccountWarning'.tr(), continueLabel: 'ui.deleteMyAccount'.tr(), title: 'ui.deleteTobAccount'.tr(), - onContinue: () { - authNotifier.deleteAccount().then( - (_) { - Navigator.pop(context); - }, + onContinue: () async { + Navigator.pop(context); + await BeamOverlays.showProgressOverlay( + context, + authNotifier.deleteAccount, ); }, ), diff --git a/playground/frontend/playground_components/lib/playground_components.dart b/playground/frontend/playground_components/lib/playground_components.dart index 524cb03b7c89..3d14b1821e90 100644 --- a/playground/frontend/playground_components/lib/playground_components.dart +++ b/playground/frontend/playground_components/lib/playground_components.dart @@ -71,8 +71,9 @@ export 'src/widgets/output/output_area.dart'; export 'src/widgets/output/output_tab.dart'; export 'src/widgets/output/output_tabs.dart'; export 'src/widgets/overlay/body.dart'; -export 'src/widgets/overlay/dismissible.dart'; export 'src/widgets/overlay/opener.dart'; +export 'src/widgets/overlay/overlays.dart'; +export 'src/widgets/overlay/widget.dart'; export 'src/widgets/reset_button.dart'; export 'src/widgets/run_or_cancel_button.dart'; export 'src/widgets/shortcut_tooltip.dart'; diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/opener.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/opener.dart index cb4e107f5f02..48edf2ef664b 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/opener.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/opener.dart @@ -19,17 +19,19 @@ import 'package:flutter/material.dart'; import '../../controllers/public_notifier.dart'; -import 'dismissible.dart'; +import 'widget.dart'; void openOverlay({ required BuildContext context, required PublicNotifier closeNotifier, required Positioned positioned, + bool isDismissible = true, }) { final overlay = OverlayEntry( builder: (context) { - return DismissibleOverlay( + return BeamOverlay( close: closeNotifier.notifyPublic, + isDismissible: isDismissible, child: positioned, ); }, diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart new file mode 100644 index 000000000000..f2780128176a --- /dev/null +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; + +import '../../../playground_components.dart'; + +class BeamOverlays { + // TODO(nausharipov) review: add label? + // TODO(nausharipov) review: add grey-ish background? + static Future showProgressOverlay( + BuildContext context, + Future Function() future, + ) async { + final closeNotifier = PublicNotifier(); + openOverlay( + context: context, + closeNotifier: closeNotifier, + isDismissible: false, + positioned: const Positioned.fill( + child: Align( + child: CircularProgressIndicator(), + ), + ), + ); + await future(); + closeNotifier.notifyPublic(); + } +} diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/dismissible.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/widget.dart similarity index 80% rename from playground/frontend/playground_components/lib/src/widgets/overlay/dismissible.dart rename to playground/frontend/playground_components/lib/src/widgets/overlay/widget.dart index e32e55c56a71..12e5405ae0c5 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/dismissible.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/widget.dart @@ -18,24 +18,27 @@ import 'package:flutter/material.dart'; -class DismissibleOverlay extends StatelessWidget { +class BeamOverlay extends StatelessWidget { final VoidCallback close; final Positioned child; + final bool isDismissible; - const DismissibleOverlay({ + const BeamOverlay({ required this.close, required this.child, + required this.isDismissible, }); @override Widget build(BuildContext context) { return Stack( children: [ - Positioned.fill( - child: GestureDetector( - onTap: close, + if (isDismissible) + Positioned.fill( + child: GestureDetector( + onTap: close, + ), ), - ), child, ], ); From 8c3e4b5205e257edf2efc6e2faf44d2d9a15d7ab Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Thu, 9 Feb 2023 14:40:07 +0600 Subject: [PATCH 08/20] toastNotifier todo (#25255) --- learning/tour-of-beam/frontend/lib/auth/notifier.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/learning/tour-of-beam/frontend/lib/auth/notifier.dart b/learning/tour-of-beam/frontend/lib/auth/notifier.dart index 636b6540d646..871ddf8a67a8 100644 --- a/learning/tour-of-beam/frontend/lib/auth/notifier.dart +++ b/learning/tour-of-beam/frontend/lib/auth/notifier.dart @@ -21,6 +21,7 @@ import 'dart:async'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart'; import 'package:flutter/material.dart'; +import 'package:playground_components/playground_components.dart'; import '../repositories/client/client.dart'; @@ -40,7 +41,12 @@ class AuthNotifier extends ChangeNotifier { } Future logIn(AuthProvider authProvider) async { - await FirebaseAuth.instance.signInWithPopup(authProvider); + try { + await FirebaseAuth.instance.signInWithPopup(authProvider); + } on Exception catch (e) { + // TODO(nausharipov) review: why toasts are not shown in ToB? + PlaygroundComponents.toastNotifier.addException(e); + } } Future logOut() async { From f1a2cecd9369dfe98cd1fa635fa1aef700f0a3a5 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Thu, 9 Feb 2023 19:54:12 +0600 Subject: [PATCH 09/20] comment fixes (#25255) --- .../lib/src/widgets/overlay/overlays.dart | 10 +++++----- .../lib/src/widgets/overlay/widget.dart | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart index f2780128176a..d56309c1f5cc 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart @@ -21,8 +21,6 @@ import 'package:flutter/material.dart'; import '../../../playground_components.dart'; class BeamOverlays { - // TODO(nausharipov) review: add label? - // TODO(nausharipov) review: add grey-ish background? static Future showProgressOverlay( BuildContext context, Future Function() future, @@ -32,9 +30,11 @@ class BeamOverlays { context: context, closeNotifier: closeNotifier, isDismissible: false, - positioned: const Positioned.fill( - child: Align( - child: CircularProgressIndicator(), + positioned: Positioned.fill( + child: Container( + alignment: Alignment.center, + color: Theme.of(context).dialogBackgroundColor.withOpacity(0.2), + child: const CircularProgressIndicator(), ), ), ); diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/widget.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/widget.dart index 12e5405ae0c5..ba410d4eb55a 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/widget.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/widget.dart @@ -20,13 +20,13 @@ import 'package:flutter/material.dart'; class BeamOverlay extends StatelessWidget { final VoidCallback close; - final Positioned child; final bool isDismissible; + final Positioned child; const BeamOverlay({ required this.close, - required this.child, required this.isDismissible, + required this.child, }); @override From a2f43bf4d5850032306192490bc485e8e70aaa45 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Thu, 9 Feb 2023 20:00:04 +0600 Subject: [PATCH 10/20] BeamRouterDelegate for showing toasts (#25255) --- learning/tour-of-beam/frontend/lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learning/tour-of-beam/frontend/lib/main.dart b/learning/tour-of-beam/frontend/lib/main.dart index b5cc5d64a9c4..b82d1498ab37 100644 --- a/learning/tour-of-beam/frontend/lib/main.dart +++ b/learning/tour-of-beam/frontend/lib/main.dart @@ -42,7 +42,7 @@ void main() async { const englishLocale = Locale('en'); final pageStack = GetIt.instance.get(); - final routerDelegate = PageStackRouterDelegate(pageStack); + final routerDelegate = BeamRouterDelegate(pageStack); final routeInformationParser = TobRouteInformationParser(); final backButtonDispatcher = PageStackBackButtonDispatcher(pageStack); From 09a5526aa9f415081914e60b0737ceeef2686502 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Thu, 9 Feb 2023 20:08:48 +0600 Subject: [PATCH 11/20] addException in deleteAccount (#25255) --- learning/tour-of-beam/frontend/lib/auth/notifier.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/learning/tour-of-beam/frontend/lib/auth/notifier.dart b/learning/tour-of-beam/frontend/lib/auth/notifier.dart index 871ddf8a67a8..87c129b234d9 100644 --- a/learning/tour-of-beam/frontend/lib/auth/notifier.dart +++ b/learning/tour-of-beam/frontend/lib/auth/notifier.dart @@ -44,7 +44,6 @@ class AuthNotifier extends ChangeNotifier { try { await FirebaseAuth.instance.signInWithPopup(authProvider); } on Exception catch (e) { - // TODO(nausharipov) review: why toasts are not shown in ToB? PlaygroundComponents.toastNotifier.addException(e); } } @@ -54,7 +53,11 @@ class AuthNotifier extends ChangeNotifier { } Future deleteAccount() async { - await client.postDeleteUserProgress(); - await FirebaseAuth.instance.currentUser?.delete(); + try { + await client.postDeleteUserProgress(); + await FirebaseAuth.instance.currentUser?.delete(); + } on Exception catch (e) { + PlaygroundComponents.toastNotifier.addException(e); + } } } From fde6ace2e43ecc559426e733faea49dbb491ec7b Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Thu, 9 Feb 2023 21:18:15 +0600 Subject: [PATCH 12/20] showOverlay (#25255) --- .../tour-of-beam/frontend/lib/components/login/button.dart | 2 +- .../frontend/lib/components/profile/avatar.dart | 2 +- .../lib/src/widgets/overlay/opener.dart | 6 +++--- .../lib/src/widgets/overlay/overlays.dart | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/learning/tour-of-beam/frontend/lib/components/login/button.dart b/learning/tour-of-beam/frontend/lib/components/login/button.dart index 2fb2038d6bfd..6ecf2ba5da3b 100644 --- a/learning/tour-of-beam/frontend/lib/components/login/button.dart +++ b/learning/tour-of-beam/frontend/lib/components/login/button.dart @@ -30,7 +30,7 @@ class LoginButton extends StatelessWidget { return TextButton( onPressed: () { final closeNotifier = PublicNotifier(); - openOverlay( + showOverlay( context: context, closeNotifier: closeNotifier, positioned: Positioned( diff --git a/learning/tour-of-beam/frontend/lib/components/profile/avatar.dart b/learning/tour-of-beam/frontend/lib/components/profile/avatar.dart index d4b88584dab6..d6e6621e97f0 100644 --- a/learning/tour-of-beam/frontend/lib/components/profile/avatar.dart +++ b/learning/tour-of-beam/frontend/lib/components/profile/avatar.dart @@ -32,7 +32,7 @@ class Avatar extends StatelessWidget { return GestureDetector( onTap: () { final closeNotifier = PublicNotifier(); - openOverlay( + showOverlay( context: context, closeNotifier: closeNotifier, positioned: Positioned( diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/opener.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/opener.dart index 48edf2ef664b..0615705e61e0 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/opener.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/opener.dart @@ -21,17 +21,17 @@ import 'package:flutter/material.dart'; import '../../controllers/public_notifier.dart'; import 'widget.dart'; -void openOverlay({ +void showOverlay({ required BuildContext context, required PublicNotifier closeNotifier, required Positioned positioned, - bool isDismissible = true, + bool barrierDismissible = true, }) { final overlay = OverlayEntry( builder: (context) { return BeamOverlay( close: closeNotifier.notifyPublic, - isDismissible: isDismissible, + isDismissible: barrierDismissible, child: positioned, ); }, diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart index d56309c1f5cc..2abf53e49263 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart @@ -26,10 +26,10 @@ class BeamOverlays { Future Function() future, ) async { final closeNotifier = PublicNotifier(); - openOverlay( + showOverlay( context: context, closeNotifier: closeNotifier, - isDismissible: false, + barrierDismissible: false, positioned: Positioned.fill( child: Container( alignment: Alignment.center, From 6005103ac778669665518c7312ed726a27c99d8d Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Fri, 10 Feb 2023 15:13:54 +0600 Subject: [PATCH 13/20] addressing review comments (#25255) --- .../frontend/assets/translations/en.yaml | 4 +- .../lib/components/profile/user_menu.dart | 8 +- .../lib/pages/tour/widgets/hints.dart | 4 +- .../pages/tour/widgets/solution_button.dart | 29 ++++--- .../lib/playground_components.dart | 2 +- .../src/widgets/dialogs/action_approval.dart | 84 +++++++++++++++++++ .../lib/src/widgets/dialogs/alert_dialog.dart | 81 ------------------ .../lib/src/widgets/overlay/overlays.dart | 2 + 8 files changed, 112 insertions(+), 102 deletions(-) create mode 100644 playground/frontend/playground_components/lib/src/widgets/dialogs/action_approval.dart delete mode 100644 playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart diff --git a/learning/tour-of-beam/frontend/assets/translations/en.yaml b/learning/tour-of-beam/frontend/assets/translations/en.yaml index 12cfe9aeb552..50824aeebaec 100644 --- a/learning/tour-of-beam/frontend/assets/translations/en.yaml +++ b/learning/tour-of-beam/frontend/assets/translations/en.yaml @@ -22,7 +22,6 @@ ui: continueGitHub: Continue with GitHub continueGoogle: Continue with Google copyright: © The Apache Software Foundation - hint: Hint deleteMyAccount: Delete my account deleteTobAccount: Delete my Tour of Beam account privacyPolicy: Privacy Policy @@ -41,7 +40,8 @@ pages: tour: assignment: Assignment completeUnit: Complete Unit - showSolution: Show + hint: Hint + showSolution: Show the solution solution: Solution solveYourself: Before revealing the solution, try solving the challenge on your own. Remember, the more you practice, the better you will become. Give it a shot and see how far you can get. summaryTitle: Table of Contents diff --git a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart index e85232766d49..9d6285200fcd 100644 --- a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart +++ b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart @@ -129,11 +129,11 @@ class _Buttons extends StatelessWidget { closeOverlayCallback(); showDialog( context: context, - builder: (context) => BeamAlertDialog( - text: 'dialogs.deleteAccountWarning'.tr(), - continueLabel: 'ui.deleteMyAccount'.tr(), + builder: (context) => ActionApprovalDialog( + actionLabel: 'ui.deleteMyAccount'.tr(), + bodyText: 'dialogs.deleteAccountWarning'.tr(), title: 'ui.deleteTobAccount'.tr(), - onContinue: () async { + onActionPressed: () async { Navigator.pop(context); await BeamOverlays.showProgressOverlay( context, diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart index 57d9cfacf73d..218624365bef 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/hints.dart @@ -46,7 +46,7 @@ class HintsWidget extends StatelessWidget { } }, icon: SvgPicture.asset(Assets.svg.hint), - label: const Text('ui.hint').tr(), + label: const Text('pages.tour.hint').tr(), ); } } @@ -69,7 +69,7 @@ class _Popup extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Text( - 'ui.hint', + 'pages.tour.hint', style: Theme.of(context).textTheme.headlineLarge, ).tr(), const SizedBox(height: BeamSizes.size8), diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart index 7d78861ce310..248c7fe4a121 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart @@ -45,20 +45,25 @@ class SolutionButton extends StatelessWidget { ), onPressed: () { // TODO(nausharipov): resolve the conflict with save user code - showDialog( - context: context, - builder: (context) => BeamAlertDialog( - continueLabel: 'pages.tour.showSolution'.tr(), - title: 'pages.tour.solveYourself'.tr(), - onContinue: () { - tourNotifier.toggleShowingSolution(); - Navigator.pop(context); - }, - ), - ); + if (tourNotifier.isShowingSolution) { + tourNotifier.toggleShowingSolution(); + } else { + showDialog( + context: context, + builder: (context) => ActionApprovalDialog( + bodyText: 'pages.tour.solveYourself'.tr(), + actionLabel: 'pages.tour.showSolution'.tr(), + title: 'pages.tour.solution'.tr(), + onActionPressed: () { + Navigator.pop(context); + tourNotifier.toggleShowingSolution(); + }, + ), + ); + } }, icon: SvgPicture.asset(Assets.svg.solution), - label: const Text('ui.solution').tr(), + label: const Text('pages.tour.solution').tr(), ), ); } diff --git a/playground/frontend/playground_components/lib/playground_components.dart b/playground/frontend/playground_components/lib/playground_components.dart index 3d14b1821e90..d87a2b482167 100644 --- a/playground/frontend/playground_components/lib/playground_components.dart +++ b/playground/frontend/playground_components/lib/playground_components.dart @@ -60,7 +60,7 @@ export 'src/util/string.dart'; export 'src/widgets/bubble.dart'; export 'src/widgets/clickable.dart'; export 'src/widgets/complexity.dart'; -export 'src/widgets/dialogs/alert_dialog.dart'; +export 'src/widgets/dialogs/action_approval.dart'; export 'src/widgets/divider.dart'; export 'src/widgets/header_icon_button.dart'; export 'src/widgets/loading_error.dart'; diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/action_approval.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/action_approval.dart new file mode 100644 index 000000000000..c02880917cb0 --- /dev/null +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/action_approval.dart @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; + +import '../../../playground_components.dart'; + +/// Dialog to approve or cancel user actions. +class ActionApprovalDialog extends StatelessWidget { + final String actionLabel; + final VoidCallback onActionPressed; + final String title; + final String? bodyText; + + const ActionApprovalDialog({ + required this.actionLabel, + required this.onActionPressed, + required this.title, + this.bodyText, + }); + + @override + Widget build(BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: OverlayBody( + child: Container( + width: BeamSizes.popupWidth, + padding: const EdgeInsets.all(BeamSizes.size16), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + title, + style: Theme.of(context).textTheme.headlineMedium, + ), + if (bodyText != null) + Padding( + padding: const EdgeInsets.only(top: BeamSizes.size8), + child: Text(bodyText!), + ), + const SizedBox(height: BeamSizes.size8), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text('dialogs.cancel').tr(), + ), + const SizedBox(width: BeamSizes.size8), + TextButton( + onPressed: onActionPressed, + child: Text(actionLabel), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart deleted file mode 100644 index 77d6d3e33f45..000000000000 --- a/playground/frontend/playground_components/lib/src/widgets/dialogs/alert_dialog.dart +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; - -import '../../../playground_components.dart'; - -class BeamAlertDialog extends StatelessWidget { - final String? text; - final String continueLabel; - final VoidCallback onContinue; - final String title; - - const BeamAlertDialog({ - required this.continueLabel, - required this.onContinue, - required this.title, - this.text, - }); - - @override - Widget build(BuildContext context) { - return Dialog( - backgroundColor: Colors.transparent, - child: OverlayBody( - child: Container( - width: BeamSizes.popupWidth, - padding: const EdgeInsets.all(BeamSizes.size16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - title, - style: Theme.of(context).textTheme.headlineMedium, - ), - if (text != null) - Padding( - padding: const EdgeInsets.only(top: BeamSizes.size8), - child: Text(text!), - ), - const SizedBox(height: BeamSizes.size8), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - onPressed: () { - Navigator.pop(context); - }, - child: const Text('dialogs.cancel').tr(), - ), - const SizedBox(width: BeamSizes.size8), - TextButton( - onPressed: onContinue, - child: Text(continueLabel), - ), - ], - ), - ], - ), - ), - ), - ); - } -} diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart index 2abf53e49263..40812704867d 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart @@ -20,7 +20,9 @@ import 'package:flutter/material.dart'; import '../../../playground_components.dart'; +/// Shows different types of overlays. class BeamOverlays { + /// Undismissable overlay of a progress indicator. static Future showProgressOverlay( BuildContext context, Future Function() future, From 440d0b04e913d368bdb8bc46f018dee74eca5a63 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Fri, 10 Feb 2023 21:17:03 +0600 Subject: [PATCH 14/20] addressing review comments (#25255) --- .../lib/components/profile/user_menu.dart | 36 ++++++++------- .../pages/tour/widgets/solution_button.dart | 19 ++++---- .../lib/playground_components.dart | 2 +- .../{action_approval.dart => confirm.dart} | 44 +++++++++++++------ .../lib/src/widgets/overlay/overlays.dart | 8 ++-- 5 files changed, 62 insertions(+), 47 deletions(-) rename playground/frontend/playground_components/lib/src/widgets/dialogs/{action_approval.dart => confirm.dart} (72%) diff --git a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart index 9d6285200fcd..af735b17078e 100644 --- a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart +++ b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart @@ -89,13 +89,18 @@ class _Info extends StatelessWidget { } } -class _Buttons extends StatelessWidget { +class _Buttons extends StatefulWidget { final VoidCallback closeOverlayCallback; const _Buttons({ required this.closeOverlayCallback, }); + @override + State<_Buttons> createState() => _ButtonsState(); +} + +class _ButtonsState extends State<_Buttons> { @override Widget build(BuildContext context) { final authNotifier = GetIt.instance.get(); @@ -118,30 +123,27 @@ class _Buttons extends StatelessWidget { _IconLabel( onTap: () async { await authNotifier.logOut(); - closeOverlayCallback(); + widget.closeOverlayCallback(); }, iconPath: Assets.svg.profileLogout, label: 'ui.signOut'.tr(), ), const BeamDivider(), _IconLabel( - onTap: () { - closeOverlayCallback(); - showDialog( + onTap: () async { + widget.closeOverlayCallback(); + final confirmed = await ConfirmDialog.show( context: context, - builder: (context) => ActionApprovalDialog( - actionLabel: 'ui.deleteMyAccount'.tr(), - bodyText: 'dialogs.deleteAccountWarning'.tr(), - title: 'ui.deleteTobAccount'.tr(), - onActionPressed: () async { - Navigator.pop(context); - await BeamOverlays.showProgressOverlay( - context, - authNotifier.deleteAccount, - ); - }, - ), + confirmButtonText: 'ui.deleteMyAccount'.tr(), + subtitle: 'dialogs.deleteAccountWarning'.tr(), + title: 'ui.deleteTobAccount'.tr(), ); + if (confirmed && mounted) { + await BeamOverlays.showProgressOverlay( + this.context, + authNotifier.deleteAccount(), + ); + } }, iconPath: Assets.svg.profileDelete, label: 'ui.deleteMyAccount'.tr(), diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart index 248c7fe4a121..dd4f909efc58 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/widgets/solution_button.dart @@ -43,23 +43,20 @@ class SolutionButton extends StatelessWidget { : null, ), ), - onPressed: () { + onPressed: () async { // TODO(nausharipov): resolve the conflict with save user code if (tourNotifier.isShowingSolution) { tourNotifier.toggleShowingSolution(); } else { - showDialog( + final confirmed = await ConfirmDialog.show( context: context, - builder: (context) => ActionApprovalDialog( - bodyText: 'pages.tour.solveYourself'.tr(), - actionLabel: 'pages.tour.showSolution'.tr(), - title: 'pages.tour.solution'.tr(), - onActionPressed: () { - Navigator.pop(context); - tourNotifier.toggleShowingSolution(); - }, - ), + confirmButtonText: 'pages.tour.showSolution'.tr(), + subtitle: 'pages.tour.solveYourself'.tr(), + title: 'pages.tour.solution'.tr(), ); + if (confirmed) { + tourNotifier.toggleShowingSolution(); + } } }, icon: SvgPicture.asset(Assets.svg.solution), diff --git a/playground/frontend/playground_components/lib/playground_components.dart b/playground/frontend/playground_components/lib/playground_components.dart index d87a2b482167..412988c7aa09 100644 --- a/playground/frontend/playground_components/lib/playground_components.dart +++ b/playground/frontend/playground_components/lib/playground_components.dart @@ -60,7 +60,7 @@ export 'src/util/string.dart'; export 'src/widgets/bubble.dart'; export 'src/widgets/clickable.dart'; export 'src/widgets/complexity.dart'; -export 'src/widgets/dialogs/action_approval.dart'; +export 'src/widgets/dialogs/confirm.dart'; export 'src/widgets/divider.dart'; export 'src/widgets/header_icon_button.dart'; export 'src/widgets/loading_error.dart'; diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/action_approval.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart similarity index 72% rename from playground/frontend/playground_components/lib/src/widgets/dialogs/action_approval.dart rename to playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart index c02880917cb0..a750aa06a1de 100644 --- a/playground/frontend/playground_components/lib/src/widgets/dialogs/action_approval.dart +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart @@ -21,20 +21,34 @@ import 'package:flutter/material.dart'; import '../../../playground_components.dart'; -/// Dialog to approve or cancel user actions. -class ActionApprovalDialog extends StatelessWidget { - final String actionLabel; - final VoidCallback onActionPressed; +class ConfirmDialog extends StatelessWidget { + final String confirmButtonText; + final String title; - final String? bodyText; + final String? subtitle; - const ActionApprovalDialog({ - required this.actionLabel, - required this.onActionPressed, + const ConfirmDialog({ + required this.confirmButtonText, required this.title, - this.bodyText, + this.subtitle, }); + static Future show({ + required BuildContext context, + required String title, + required String? subtitle, + required String confirmButtonText, + }) async { + return await showDialog( + context: context, + builder: (context) => ConfirmDialog( + confirmButtonText: confirmButtonText, + title: title, + subtitle: subtitle, + ), + ); + } + @override Widget build(BuildContext context) { return Dialog( @@ -52,10 +66,10 @@ class ActionApprovalDialog extends StatelessWidget { title, style: Theme.of(context).textTheme.headlineMedium, ), - if (bodyText != null) + if (subtitle != null) Padding( padding: const EdgeInsets.only(top: BeamSizes.size8), - child: Text(bodyText!), + child: Text(subtitle!), ), const SizedBox(height: BeamSizes.size8), Row( @@ -63,14 +77,16 @@ class ActionApprovalDialog extends StatelessWidget { children: [ TextButton( onPressed: () { - Navigator.pop(context); + Navigator.pop(context, false); }, child: const Text('dialogs.cancel').tr(), ), const SizedBox(width: BeamSizes.size8), TextButton( - onPressed: onActionPressed, - child: Text(actionLabel), + onPressed: () { + Navigator.pop(context, true); + }, + child: Text(confirmButtonText), ), ], ), diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart index 40812704867d..cc2ab19bb81a 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart @@ -20,12 +20,12 @@ import 'package:flutter/material.dart'; import '../../../playground_components.dart'; -/// Shows different types of overlays. +/// Groups common overlays. class BeamOverlays { - /// Undismissable overlay of a progress indicator. + /// Shows an overlay until future completes. static Future showProgressOverlay( BuildContext context, - Future Function() future, + Future future, ) async { final closeNotifier = PublicNotifier(); showOverlay( @@ -40,7 +40,7 @@ class BeamOverlays { ), ), ); - await future(); + await future; closeNotifier.notifyPublic(); } } From 12882fbce983e26547c06bc23e10f35adde87e2b Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Fri, 10 Feb 2023 21:46:08 +0600 Subject: [PATCH 15/20] addressing review (#25255) --- .../playground_components/lib/src/widgets/dialogs/confirm.dart | 2 +- .../lib/src/widgets/overlay/overlays.dart | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart index a750aa06a1de..424b1624be0f 100644 --- a/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart @@ -36,8 +36,8 @@ class ConfirmDialog extends StatelessWidget { static Future show({ required BuildContext context, required String title, - required String? subtitle, required String confirmButtonText, + String? subtitle, }) async { return await showDialog( context: context, diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart index cc2ab19bb81a..28539d9aabab 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart +++ b/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart @@ -22,7 +22,8 @@ import '../../../playground_components.dart'; /// Groups common overlays. class BeamOverlays { - /// Shows an overlay until future completes. + /// Shows an overlay with [CircularProgressIndicator] + /// until [future] completes. static Future showProgressOverlay( BuildContext context, Future future, From 7626f8fef3ea42ba792cf3a9869dfb36a827191c Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Mon, 13 Feb 2023 22:40:25 +0600 Subject: [PATCH 16/20] pop progress dialog with navigatorKey (#25255) --- .../lib/components/profile/user_menu.dart | 20 +++---- .../tour-of-beam/frontend/lib/locator.dart | 15 +++--- learning/tour-of-beam/frontend/lib/main.dart | 2 +- .../frontend/lib/pages/tour/state.dart | 4 +- .../lib/playground_components.dart | 2 +- .../overlays.dart => dialogs/progress.dart} | 54 +++++++++++-------- 6 files changed, 52 insertions(+), 45 deletions(-) rename playground/frontend/playground_components/lib/src/widgets/{overlay/overlays.dart => dialogs/progress.dart} (53%) diff --git a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart index af735b17078e..f3f633b0028f 100644 --- a/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart +++ b/learning/tour-of-beam/frontend/lib/components/profile/user_menu.dart @@ -89,18 +89,13 @@ class _Info extends StatelessWidget { } } -class _Buttons extends StatefulWidget { +class _Buttons extends StatelessWidget { final VoidCallback closeOverlayCallback; const _Buttons({ required this.closeOverlayCallback, }); - @override - State<_Buttons> createState() => _ButtonsState(); -} - -class _ButtonsState extends State<_Buttons> { @override Widget build(BuildContext context) { final authNotifier = GetIt.instance.get(); @@ -123,7 +118,7 @@ class _ButtonsState extends State<_Buttons> { _IconLabel( onTap: () async { await authNotifier.logOut(); - widget.closeOverlayCallback(); + closeOverlayCallback(); }, iconPath: Assets.svg.profileLogout, label: 'ui.signOut'.tr(), @@ -131,17 +126,18 @@ class _ButtonsState extends State<_Buttons> { const BeamDivider(), _IconLabel( onTap: () async { - widget.closeOverlayCallback(); + closeOverlayCallback(); final confirmed = await ConfirmDialog.show( context: context, confirmButtonText: 'ui.deleteMyAccount'.tr(), subtitle: 'dialogs.deleteAccountWarning'.tr(), title: 'ui.deleteTobAccount'.tr(), ); - if (confirmed && mounted) { - await BeamOverlays.showProgressOverlay( - this.context, - authNotifier.deleteAccount(), + if (confirmed) { + ProgressDialog.show( + future: authNotifier.deleteAccount(), + navigatorKey: + GetIt.instance.get().navigatorKey!, ); } }, diff --git a/learning/tour-of-beam/frontend/lib/locator.dart b/learning/tour-of-beam/frontend/lib/locator.dart index 44ff02f0b324..4c11cab0a7f8 100644 --- a/learning/tour-of-beam/frontend/lib/locator.dart +++ b/learning/tour-of-beam/frontend/lib/locator.dart @@ -18,6 +18,7 @@ import 'package:app_state/app_state.dart'; import 'package:get_it/get_it.dart'; +import 'package:playground_components/playground_components.dart'; import 'auth/notifier.dart'; import 'cache/content_tree.dart'; @@ -52,12 +53,12 @@ void _initializeCaches() { } void _initializeState() { - GetIt.instance.registerSingleton(AppNotifier()); - GetIt.instance.registerSingleton( - PageStack( - bottomPage: WelcomePage(), - createPage: PageFactory.createPage, - routeInformationParser: TobRouteInformationParser(), - ), + final pageStack = PageStack( + bottomPage: WelcomePage(), + createPage: PageFactory.createPage, + routeInformationParser: TobRouteInformationParser(), ); + GetIt.instance.registerSingleton(AppNotifier()); + GetIt.instance.registerSingleton(pageStack); + GetIt.instance.registerSingleton(BeamRouterDelegate(pageStack)); } diff --git a/learning/tour-of-beam/frontend/lib/main.dart b/learning/tour-of-beam/frontend/lib/main.dart index b82d1498ab37..4a532300baf8 100644 --- a/learning/tour-of-beam/frontend/lib/main.dart +++ b/learning/tour-of-beam/frontend/lib/main.dart @@ -42,7 +42,7 @@ void main() async { const englishLocale = Locale('en'); final pageStack = GetIt.instance.get(); - final routerDelegate = BeamRouterDelegate(pageStack); + final routerDelegate = GetIt.instance.get(); final routeInformationParser = TobRouteInformationParser(); final backButtonDispatcher = PageStackBackButtonDispatcher(pageStack); diff --git a/learning/tour-of-beam/frontend/lib/pages/tour/state.dart b/learning/tour-of-beam/frontend/lib/pages/tour/state.dart index 19646be75431..59d88e8e31c7 100644 --- a/learning/tour-of-beam/frontend/lib/pages/tour/state.dart +++ b/learning/tour-of-beam/frontend/lib/pages/tour/state.dart @@ -214,11 +214,11 @@ class TourNotifier extends ChangeNotifier with PageStateMixin { } @override - void dispose() { + Future dispose() async { _unitContentCache.removeListener(_onUnitChanged); contentTreeController.removeListener(_onUnitChanged); _appNotifier.removeListener(_onAppNotifierChanged); _authNotifier.removeListener(_onUnitProgressChanged); - super.dispose(); + await super.dispose(); } } diff --git a/playground/frontend/playground_components/lib/playground_components.dart b/playground/frontend/playground_components/lib/playground_components.dart index 412988c7aa09..a7bad3493da2 100644 --- a/playground/frontend/playground_components/lib/playground_components.dart +++ b/playground/frontend/playground_components/lib/playground_components.dart @@ -61,6 +61,7 @@ export 'src/widgets/bubble.dart'; export 'src/widgets/clickable.dart'; export 'src/widgets/complexity.dart'; export 'src/widgets/dialogs/confirm.dart'; +export 'src/widgets/dialogs/progress.dart'; export 'src/widgets/divider.dart'; export 'src/widgets/header_icon_button.dart'; export 'src/widgets/loading_error.dart'; @@ -72,7 +73,6 @@ export 'src/widgets/output/output_tab.dart'; export 'src/widgets/output/output_tabs.dart'; export 'src/widgets/overlay/body.dart'; export 'src/widgets/overlay/opener.dart'; -export 'src/widgets/overlay/overlays.dart'; export 'src/widgets/overlay/widget.dart'; export 'src/widgets/reset_button.dart'; export 'src/widgets/run_or_cancel_button.dart'; diff --git a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart similarity index 53% rename from playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart rename to playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart index 28539d9aabab..56c12d39a510 100644 --- a/playground/frontend/playground_components/lib/src/widgets/overlay/overlays.dart +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart @@ -16,32 +16,42 @@ * limitations under the License. */ +import 'dart:async'; + import 'package:flutter/material.dart'; -import '../../../playground_components.dart'; +class ProgressDialog extends StatelessWidget { + const ProgressDialog(); + + static void show({ + required Future future, + required GlobalKey navigatorKey, + }) { + var shown = true; + unawaited( + showDialog( + context: navigatorKey.currentContext!, + builder: (_) => const ProgressDialog(), + ).whenComplete(() { + shown = false; + }), + ); + unawaited( + future.whenComplete(() { + if (shown) { + navigatorKey.currentState!.pop(); + } + }), + ); + } -/// Groups common overlays. -class BeamOverlays { - /// Shows an overlay with [CircularProgressIndicator] - /// until [future] completes. - static Future showProgressOverlay( - BuildContext context, - Future future, - ) async { - final closeNotifier = PublicNotifier(); - showOverlay( - context: context, - closeNotifier: closeNotifier, - barrierDismissible: false, - positioned: Positioned.fill( - child: Container( - alignment: Alignment.center, - color: Theme.of(context).dialogBackgroundColor.withOpacity(0.2), - child: const CircularProgressIndicator(), - ), + @override + Widget build(BuildContext context) { + return const Dialog( + backgroundColor: Colors.transparent, + child: Center( + child: CircularProgressIndicator(), ), ); - await future; - closeNotifier.notifyPublic(); } } From 2cb7c585da3ebe0fb599dca5ce6887bfa0f65310 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Mon, 13 Feb 2023 22:50:18 +0600 Subject: [PATCH 17/20] updated to app_state 0.9.2 (#25255) --- learning/tour-of-beam/frontend/pubspec.lock | 2 +- learning/tour-of-beam/frontend/pubspec.yaml | 2 +- playground/frontend/playground_components/pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/learning/tour-of-beam/frontend/pubspec.lock b/learning/tour-of-beam/frontend/pubspec.lock index 258b6cabd254..b322c64aac72 100644 --- a/learning/tour-of-beam/frontend/pubspec.lock +++ b/learning/tour-of-beam/frontend/pubspec.lock @@ -35,7 +35,7 @@ packages: name: app_state url: "https://pub.dartlang.org" source: hosted - version: "0.8.4" + version: "0.9.2" archive: dependency: transitive description: diff --git a/learning/tour-of-beam/frontend/pubspec.yaml b/learning/tour-of-beam/frontend/pubspec.yaml index ee3b6ae3d77e..88655ad0b665 100644 --- a/learning/tour-of-beam/frontend/pubspec.yaml +++ b/learning/tour-of-beam/frontend/pubspec.yaml @@ -27,7 +27,7 @@ environment: flutter: '>=3.3.2' dependencies: - app_state: ^0.8.4 + app_state: ^0.9.2 collection: ^1.16.0 easy_localization: ^3.0.1 easy_localization_ext: ^0.1.0 diff --git a/playground/frontend/playground_components/pubspec.yaml b/playground/frontend/playground_components/pubspec.yaml index a87ac0f2a23a..b51a1d47d846 100644 --- a/playground/frontend/playground_components/pubspec.yaml +++ b/playground/frontend/playground_components/pubspec.yaml @@ -26,7 +26,7 @@ environment: dependencies: aligned_dialog: ^0.0.6 - app_state: ^0.8.4 + app_state: ^0.9.2 collection: ^1.16.0 easy_localization: ^3.0.1 easy_localization_ext: ^0.1.1 From a5110e4ef360e3957c3e539ec11fb5a0124838f7 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Tue, 14 Feb 2023 11:00:55 +0600 Subject: [PATCH 18/20] progress dialog is undismissible (#25255) --- .../playground_components/lib/src/widgets/dialogs/progress.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart index 56c12d39a510..0d2742015b4c 100644 --- a/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart @@ -30,6 +30,7 @@ class ProgressDialog extends StatelessWidget { var shown = true; unawaited( showDialog( + barrierDismissible: false, context: navigatorKey.currentContext!, builder: (_) => const ProgressDialog(), ).whenComplete(() { From 3f3747cfa0d48e0a5df367894269a0840b615156 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Tue, 14 Feb 2023 18:28:43 +0600 Subject: [PATCH 19/20] comment fixes (#25255) --- .../playground_components/lib/src/widgets/dialogs/confirm.dart | 2 ++ .../playground_components/lib/src/widgets/dialogs/progress.dart | 1 + 2 files changed, 3 insertions(+) diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart index 424b1624be0f..7f5edeb3b1be 100644 --- a/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/confirm.dart @@ -62,6 +62,7 @@ class ConfirmDialog extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ + // Text( title, style: Theme.of(context).textTheme.headlineMedium, @@ -71,6 +72,7 @@ class ConfirmDialog extends StatelessWidget { padding: const EdgeInsets.only(top: BeamSizes.size8), child: Text(subtitle!), ), + const SizedBox(height: BeamSizes.size8), Row( mainAxisAlignment: MainAxisAlignment.end, diff --git a/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart b/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart index 0d2742015b4c..4f513a783bd4 100644 --- a/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart +++ b/playground/frontend/playground_components/lib/src/widgets/dialogs/progress.dart @@ -23,6 +23,7 @@ import 'package:flutter/material.dart'; class ProgressDialog extends StatelessWidget { const ProgressDialog(); + /// Shows a dialog with [CircularProgressIndicator] until [future] completes. static void show({ required Future future, required GlobalKey navigatorKey, From 6b8ba1afc7155f2357ca3a5c5f23394f770e2ae7 Mon Sep 17 00:00:00 2001 From: "darkhan.nausharipov" Date: Wed, 22 Feb 2023 21:41:34 +0600 Subject: [PATCH 20/20] flutter v3.7 support (#25255) --- learning/tour-of-beam/frontend/pubspec.lock | 622 ++++++++++++++------ learning/tour-of-beam/frontend/pubspec.yaml | 12 +- 2 files changed, 437 insertions(+), 197 deletions(-) diff --git a/learning/tour-of-beam/frontend/pubspec.lock b/learning/tour-of-beam/frontend/pubspec.lock index b322c64aac72..3945f04584aa 100644 --- a/learning/tour-of-beam/frontend/pubspec.lock +++ b/learning/tour-of-beam/frontend/pubspec.lock @@ -5,322 +5,424 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "4897882604d919befd350648c7f91926a9d5de99e67b455bf0917cc2362f4bb8" + url: "https://pub.dev" source: hosted - version: "46.0.0" + version: "47.0.0" _flutterfire_internals: dependency: transitive description: name: _flutterfire_internals - url: "https://pub.dartlang.org" + sha256: "3ff770dfff04a67b0863dff205a0936784de1b87a5e99b11c693fc10e66a9ce3" + url: "https://pub.dev" source: hosted version: "1.0.12" aligned_dialog: dependency: transitive description: name: aligned_dialog - url: "https://pub.dartlang.org" + sha256: c6ce4f82a5ab35dde2c48caa436eab4da9d6a4238802f67312c878394caf055d + url: "https://pub.dev" source: hosted version: "0.0.6" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "690e335554a8385bc9d787117d9eb52c0c03ee207a607e593de3c9d71b1cfe80" + url: "https://pub.dev" source: hosted - version: "4.6.0" + version: "4.7.0" app_state: dependency: "direct main" description: name: app_state - url: "https://pub.dartlang.org" + sha256: "4824dc181bb5ba35595af6a9a78c9c96e7e4c58ede164e64cce34c75fabf244a" + url: "https://pub.dev" source: hosted version: "0.9.2" archive: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: "80e5141fafcb3361653ce308776cfd7d45e6e9fbb429e14eec571382c0c5fecb" + url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.3.2" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 + url: "https://pub.dev" source: hosted version: "2.3.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.10.0" autotrie: dependency: transitive description: name: autotrie - url: "https://pub.dartlang.org" + sha256: "55da6faefb53cfcb0abb2f2ca8636123fb40e35286bb57440d2cf467568188f8" + url: "https://pub.dev" source: hosted version: "2.0.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "29a03af98de60b4eb9136acd56608a54e989f6da238a80af739415b05589d6df" + url: "https://pub.dev" source: hosted version: "2.3.0" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: "5b7355c14258f5e7df24bad1566f7b991de3e54aeacfb94e1a65e5233d9739c1" + url: "https://pub.dev" source: hosted version: "1.1.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "6bc5544ea6ce4428266e7ea680e945c68806c4aae2da0eb5e9ccf38df8d6acbf" + url: "https://pub.dev" source: hosted version: "3.1.0" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "9aae031a54ab0beebc30a888c93e900d15ae2fd8883d031dbfbd5ebdb57f5a4c" + url: "https://pub.dev" source: hosted version: "2.0.9" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: "56942f8114731d1e79942cd981cfef29501937ff1bccf4dbdce0273f31f13640" + url: "https://pub.dev" source: hosted version: "2.2.0" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: f4d6244cc071ba842c296cb1c4ee1b31596b9f924300647ac7a1445493471a3f + url: "https://pub.dev" source: hosted version: "7.2.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: d7a9cd57c215bdf8d502772447aa6b52a8ab3f956d25d5fdea6ef1df2d2dad60 + url: "https://pub.dev" source: hosted version: "8.4.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted version: "1.2.1" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 + url: "https://pub.dev" source: hosted version: "2.0.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: "43743b95913fd28b95184eb1bed7e4bd85b802b8fad0a52522702dbeda4ee3d5" + url: "https://pub.dev" source: hosted version: "4.2.0" collection: dependency: "direct main" description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" color: dependency: transitive description: name: color - url: "https://pub.dartlang.org" + sha256: ddcdf1b3badd7008233f5acffaf20ca9f5dc2cd0172b75f68f24526a5f5725cb + url: "https://pub.dev" source: hosted version: "3.0.0" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + sha256: "3f8fe4e504c2d33696dac671a54909743bc6a902a9bb0902306f7a2aed7e528e" + url: "https://pub.dev" + source: hosted + version: "2.3.9" + connectivity_plus_linux: + dependency: transitive + description: + name: connectivity_plus_linux + sha256: "3caf859d001f10407b8e48134c761483e4495ae38094ffcca97193f6c271f5e2" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + connectivity_plus_macos: + dependency: transitive + description: + name: connectivity_plus_macos + sha256: "488d2de1e47e1224ad486e501b20b088686ba1f4ee9c4420ecbc3b9824f0b920" + url: "https://pub.dev" + source: hosted + version: "1.2.6" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a + url: "https://pub.dev" + source: hosted + version: "1.2.4" + connectivity_plus_web: + dependency: transitive + description: + name: connectivity_plus_web + sha256: "81332be1b4baf8898fed17bb4fdef27abb7c6fd990bf98c54fd978478adf2f1a" + url: "https://pub.dev" + source: hosted + version: "1.2.5" + connectivity_plus_windows: + dependency: transitive + description: + name: connectivity_plus_windows + sha256: "535b0404b4d5605c4dd8453d67e5d6d2ea0dd36e3b477f50f31af51b0aeab9dd" + url: "https://pub.dev" + source: hosted + version: "1.2.2" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "196284f26f69444b7f5c50692b55ec25da86d9e500451dc09333bf2e3ad69259" + url: "https://pub.dev" source: hosted version: "3.0.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted version: "3.0.2" csv: dependency: transitive description: name: csv - url: "https://pub.dartlang.org" + sha256: "18aef53ab72181a0b5384562d18c8cbd57e941e24cb8e54eb41409d3d8abdc6d" + url: "https://pub.dev" source: hosted version: "5.0.1" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "8aff82f9b26fd868992e5430335a9d773bfef01e1d852d7ba71bf4c5d9349351" + url: "https://pub.dev" source: hosted version: "2.2.3" dartx: dependency: transitive description: name: dartx - url: "https://pub.dartlang.org" + sha256: "45d7176701f16c5a5e00a4798791c1964bc231491b879369c818dd9a9c764871" + url: "https://pub.dev" source: hosted version: "1.1.0" + dbus: + dependency: transitive + description: + name: dbus + sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + url: "https://pub.dev" + source: hosted + version: "0.7.8" easy_localization: dependency: "direct main" description: name: easy_localization - url: "https://pub.dartlang.org" + sha256: "6a2e99fa0bfe5765bf4c6ca9b137d5de2c75593007178c5e4cd2ae985f870080" + url: "https://pub.dev" source: hosted version: "3.0.1" easy_localization_ext: dependency: "direct main" description: name: easy_localization_ext - url: "https://pub.dartlang.org" + sha256: "7a5ff2595436141f2e4873b69576ff33034fe23fef252fa592b2575be3fba33a" + url: "https://pub.dev" source: hosted version: "0.1.1" easy_localization_loader: dependency: "direct main" description: name: easy_localization_loader - url: "https://pub.dartlang.org" + sha256: "89e70b2516123d639e8e68b8dd08fc07c8b83b0cfee17c642165e7e8807ebc86" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1+1" easy_logger: dependency: transitive description: name: easy_logger - url: "https://pub.dartlang.org" + sha256: c764a6e024846f33405a2342caf91c62e357c24b02c04dbc712ef232bf30ffb7 + url: "https://pub.dev" source: hosted version: "0.0.2" enum_map: dependency: transitive description: name: enum_map - url: "https://pub.dartlang.org" + sha256: "0dfe18306d2e9b0e9d381f5e11aac4c8255d5f5eddc68b0ab037f7d00aa36126" + url: "https://pub.dev" source: hosted version: "0.2.1" equatable: dependency: "direct main" description: name: equatable - url: "https://pub.dartlang.org" + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" source: hosted version: "2.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + url: "https://pub.dev" source: hosted version: "2.0.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" firebase_auth: dependency: "direct main" description: name: firebase_auth - url: "https://pub.dartlang.org" + sha256: "721b90fe1a0966add31b47a490672954ac4fe45cfe721fd8a11ffbf4c166f611" + url: "https://pub.dev" source: hosted version: "4.1.4" firebase_auth_platform_interface: dependency: "direct main" description: name: firebase_auth_platform_interface - url: "https://pub.dartlang.org" + sha256: "325d934e21826b3e7030f5018ef61927e2083b4c4fb25218ddef6ffc0012b717" + url: "https://pub.dev" source: hosted version: "6.11.7" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - url: "https://pub.dartlang.org" + sha256: "1a7fe4aafed9b29229aa1de6910e0631be94633b4a235e739cc2830a0f110361" + url: "https://pub.dev" source: hosted version: "5.1.3" firebase_core: dependency: "direct main" description: name: firebase_core - url: "https://pub.dartlang.org" + sha256: c129209ba55f3d4272c89fb4a4994c15bea77fb6de63a82d45fb6bc5c94e4355 + url: "https://pub.dev" source: hosted version: "2.4.1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - url: "https://pub.dartlang.org" + sha256: "5fab93f5b354648efa62e7cc829c90efb68c8796eecf87e0888cae2d5f3accd4" + url: "https://pub.dev" source: hosted version: "4.5.2" firebase_core_web: dependency: transitive description: name: firebase_core_web - url: "https://pub.dartlang.org" + sha256: "18b35ce111b0a4266abf723c825bcf9d4e2519d13638cc7f06f2a8dd960c75bc" + url: "https://pub.dev" source: hosted version: "2.1.0" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" + url: "https://pub.dev" source: hosted version: "1.0.1" flutter: @@ -332,9 +434,10 @@ packages: dependency: transitive description: name: flutter_code_editor - url: "https://pub.dartlang.org" + sha256: "2e48e2a09c4205991787f299cd101f66f28e6845f882df543ae0f4260f9e2c67" + url: "https://pub.dev" source: hosted - version: "0.2.5" + version: "0.2.9" flutter_driver: dependency: transitive description: flutter @@ -344,28 +447,32 @@ packages: dependency: transitive description: name: flutter_gen_core - url: "https://pub.dartlang.org" + sha256: e74db9fc706ce43ef0dfd4b296fcfa10f84c4d862b9b68a087e7c703f97c7a0a + url: "https://pub.dev" source: hosted - version: "4.3.0" + version: "5.2.0" flutter_gen_runner: dependency: "direct dev" description: name: flutter_gen_runner - url: "https://pub.dartlang.org" + sha256: "434511d7c3f7bb5c67d89a16451056093953bebf7afa8336baeceddfc6fe2a21" + url: "https://pub.dev" source: hosted - version: "4.3.0" + version: "5.2.0" flutter_highlight: dependency: transitive description: name: flutter_highlight - url: "https://pub.dartlang.org" + sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c" + url: "https://pub.dev" source: hosted version: "0.7.0" flutter_issue_108697_workaround: dependency: transitive description: name: flutter_issue_108697_workaround - url: "https://pub.dartlang.org" + sha256: "71401a9196e1e8ed7a6463b8ab8ea6bf8d8cc719783c4be309553d64d8c353ec" + url: "https://pub.dev" source: hosted version: "0.1.2" flutter_localizations: @@ -377,16 +484,18 @@ packages: dependency: "direct main" description: name: flutter_markdown - url: "https://pub.dartlang.org" + sha256: "7b25c10de1fea883f3c4f9b8389506b54053cd00807beab69fd65c8653a2711f" + url: "https://pub.dev" source: hosted - version: "0.6.12" + version: "0.6.14" flutter_svg: dependency: "direct main" description: name: flutter_svg - url: "https://pub.dartlang.org" + sha256: "97c5b291b4fd34ae4f55d6a4c05841d4d0ed94952e033c5a6529e1b47b4d2a29" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -401,14 +510,16 @@ packages: dependency: transitive description: name: fluttertoast - url: "https://pub.dartlang.org" + sha256: "7a738eddad04c7b27a1ecfecd12e8ecd4b188cdd2d91c252a02a4aba65838c9d" + url: "https://pub.dev" source: hosted version: "8.1.1" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "4f4a162323c86ffc1245765cfe138872b8f069deb42f7dbb36115fa27f31469b" + url: "https://pub.dev" source: hosted version: "2.1.3" fuchsia_remote_debug_protocol: @@ -420,119 +531,144 @@ packages: dependency: "direct main" description: name: get_it - url: "https://pub.dartlang.org" + sha256: "290fde3a86072e4b37dbb03c07bec6126f0ecc28dad403c12ffe2e5a2d751ab7" + url: "https://pub.dev" source: hosted version: "7.2.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: c51b4fdfee4d281f49b8c957f1add91b815473597f76bcf07377987f66a55729 + url: "https://pub.dev" source: hosted version: "2.1.0" google_fonts: dependency: "direct main" description: name: google_fonts - url: "https://pub.dartlang.org" + sha256: "927573f2e8a8d65c17931e21918ad0ab0666b1b636537de7c4932bdb487b190f" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "4.0.3" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d9af2f1fa192f2629a266d038ee9307b0abe729a4f1b454dd21b414f5e7d381" + url: "https://pub.dev" + source: hosted + version: "0.2.0" google_sign_in: dependency: "direct main" description: name: google_sign_in - url: "https://pub.dartlang.org" + sha256: "4f7177a6116738b0c54230a864f1d44d5d2bbec3e43b4d00c16735e32bb8e8da" + url: "https://pub.dev" source: hosted - version: "5.4.2" + version: "6.0.0" google_sign_in_android: dependency: transitive description: name: google_sign_in_android - url: "https://pub.dartlang.org" + sha256: "41187ee48f8f3f7588cb932a5ab3cc8c83f354d1d50c750f61b240efac1b33d2" + url: "https://pub.dev" source: hosted version: "6.1.4" google_sign_in_ios: dependency: transitive description: name: google_sign_in_ios - url: "https://pub.dartlang.org" + sha256: "1116aff5e87f89837b052a81abe6259be7c4dd418275786864d27b74cb2a4e70" + url: "https://pub.dev" source: hosted version: "5.5.1" google_sign_in_platform_interface: dependency: transitive description: name: google_sign_in_platform_interface - url: "https://pub.dartlang.org" + sha256: "61306213c76bb8170c3aa20017df296c0131c24d7f6c0cc7e2eeaeac34c9f457" + url: "https://pub.dev" source: hosted version: "2.3.0" google_sign_in_web: dependency: transitive description: name: google_sign_in_web - url: "https://pub.dartlang.org" + sha256: a33778787257c348f1ec8f0ab51bc680af7dc224ad7a71fb5a5d49177dca3c49 + url: "https://pub.dev" source: hosted - version: "0.10.2" + version: "0.11.0" googleapis_auth: dependency: transitive description: name: googleapis_auth - url: "https://pub.dartlang.org" + sha256: "127b1bbd32170ab8312f503bd57f1d654d8e4039ddfbc63c027d3f7ade0eff74" + url: "https://pub.dev" source: hosted version: "1.3.1" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: ae0b3d956ff324c6f8671f08dcb2dbd71c99cdbf2aa3ca63a14190c47aa6679c + url: "https://pub.dev" source: hosted version: "2.1.0" grpc: dependency: transitive description: name: grpc - url: "https://pub.dartlang.org" + sha256: "3e8e04c6277059b66d67951143842097e52bbf3f2c6fca2e67d3607b48d5c3ab" + url: "https://pub.dev" source: hosted version: "3.0.2" highlight: dependency: transitive description: name: highlight - url: "https://pub.dartlang.org" + sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21" + url: "https://pub.dev" source: hosted version: "0.7.0" hive: dependency: transitive description: name: hive - url: "https://pub.dartlang.org" + sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" + url: "https://pub.dev" source: hosted version: "2.2.3" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + url: "https://pub.dev" source: hosted version: "0.13.5" http2: dependency: transitive description: name: http2 - url: "https://pub.dartlang.org" + sha256: feb9fbe4790be90fef454eb930368c40ae56df598b3e9b9c10cc216d68f75720 + url: "https://pub.dev" source: hosted version: "2.0.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: db3060f22889f3d9d55f6a217565486737037eec3609f7f3eca4d0c67ee0d8a0 + url: "https://pub.dev" source: hosted version: "4.0.1" integration_test: @@ -544,189 +680,216 @@ packages: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + url: "https://pub.dev" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.5" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: "3520fa844009431b5d4491a5a778603520cdc399ab3406332dcc50f93547258c" + url: "https://pub.dev" source: hosted version: "4.7.0" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.dartlang.org" + sha256: "581006a34721ff9b9cbc2ba6aab4c81ee9a9f345e9f046f9feef5732417cfe4b" + url: "https://pub.dev" source: hosted version: "6.4.1" keyed_collection_widgets: dependency: transitive description: name: keyed_collection_widgets - url: "https://pub.dartlang.org" + sha256: "9db2df4c4897c35fe167bdca82d307d81baa4161c3118da3f06ab4fd2d75291b" + url: "https://pub.dev" source: hosted version: "0.4.3" linked_scroll_controller: dependency: transitive description: name: linked_scroll_controller - url: "https://pub.dartlang.org" + sha256: e6020062bcf4ffc907ee7fd090fa971e65d8dfaac3c62baf601a3ced0b37986a + url: "https://pub.dev" source: hosted version: "0.2.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" + url: "https://pub.dev" source: hosted version: "1.0.2" markdown: dependency: "direct main" description: name: markdown - url: "https://pub.dartlang.org" + sha256: b3c60dee8c2af50ad0e6e90cceba98e47718a6ee0a7a6772c77846a0cc21f78b + url: "https://pub.dev" source: hosted - version: "6.0.1" + version: "7.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted version: "1.8.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: dab22e92b41aa1255ea90ddc4bc2feaf35544fd0728e209638cad041a6e3928a + url: "https://pub.dev" source: hosted version: "1.0.2" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted version: "1.8.2" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" path_provider: dependency: transitive description: name: path_provider - url: "https://pub.dartlang.org" + sha256: "050e8e85e4b7fecdf2bb3682c1c64c4887a183720c802d323de8a5fd76d372dd" + url: "https://pub.dev" source: hosted version: "2.0.11" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + sha256: "833c8bcb182b515cd872c113e29aaaffd29a1c720259dd2f65ab35ed5e0db748" + url: "https://pub.dev" source: hosted version: "2.0.17" path_provider_ios: dependency: transitive description: name: path_provider_ios - url: "https://pub.dartlang.org" + sha256: "03d639406f5343478352433f00d3c4394d52dac8df3d847869c5e2333e0bbce8" + url: "https://pub.dev" source: hosted version: "2.0.11" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 + url: "https://pub.dev" source: hosted version: "2.1.7" path_provider_macos: dependency: transitive description: name: path_provider_macos - url: "https://pub.dartlang.org" + sha256: "2a97e7fbb7ae9dcd0dfc1220a78e9ec3e71da691912e617e8715ff2a13086ae8" + url: "https://pub.dev" source: hosted version: "2.0.6" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "27dc7a224fcd07444cb5e0e60423ccacea3e13cf00fc5282ac2c918132da931d" + url: "https://pub.dev" source: hosted version: "2.0.4" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: "999d3dc2ac03ca3f8433018efa40b73558fa4f9759bf8383a217861d120c7d74" + url: "https://pub.dev" source: hosted version: "2.1.0" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.1.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted version: "3.1.0" playground_components: @@ -740,140 +903,160 @@ packages: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + url: "https://pub.dev" source: hosted version: "2.1.3" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted version: "1.5.1" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" protobuf: dependency: transitive description: name: protobuf - url: "https://pub.dartlang.org" + sha256: "01dd9bd0fa02548bf2ceee13545d4a0ec6046459d847b6b061d8a27237108a08" + url: "https://pub.dev" source: hosted version: "2.1.0" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + sha256: "8d7d4c2df46d6a6270a4e10404bfecb18a937e3e00f710c260d0a10415ce6b7b" + url: "https://pub.dev" source: hosted version: "6.0.3" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "816c1a640e952d213ddd223b3e7aafae08cd9f8e1f6864eed304cc13b0272b07" + url: "https://pub.dev" source: hosted version: "2.1.1" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" + url: "https://pub.dev" source: hosted version: "1.2.1" quiver: dependency: transitive description: name: quiver - url: "https://pub.dartlang.org" + sha256: "93982981971e812c94d4a6fa3a57b89f9ec12b38b6380cd3c1370c3b01e4580e" + url: "https://pub.dev" source: hosted version: "3.1.0" rxdart: dependency: transitive description: name: rxdart - url: "https://pub.dartlang.org" + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + url: "https://pub.dev" source: hosted version: "0.27.7" scrollable_positioned_list: dependency: transitive description: name: scrollable_positioned_list - url: "https://pub.dartlang.org" + sha256: ca7fcaa743db712d4f7b1580526f494d0093c77a721a65705ee51fbeac7a2bd3 + url: "https://pub.dev" source: hosted version: "0.3.5" shared_preferences: dependency: "direct main" description: name: shared_preferences - url: "https://pub.dartlang.org" + sha256: "76917b7d4b9526b2ba416808a7eb9fb2863c1a09cf63ec85f1453da240fa818a" + url: "https://pub.dev" source: hosted version: "2.0.15" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - url: "https://pub.dartlang.org" + sha256: "853801ce6ba7429ec4e923e37317f32a57c903de50b8c33ffcfbdb7e6f0dd39c" + url: "https://pub.dev" source: hosted version: "2.0.12" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios - url: "https://pub.dartlang.org" + sha256: "585a14cefec7da8c9c2fb8cd283a3bb726b4155c0952afe6a0caaa7b2272de34" + url: "https://pub.dev" source: hosted version: "2.1.1" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - url: "https://pub.dartlang.org" + sha256: "28aefc1261746e7bad3d09799496054beb84e8c4ffcdfed7734e17b4ada459a5" + url: "https://pub.dev" source: hosted version: "2.1.1" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos - url: "https://pub.dartlang.org" + sha256: fbb94bf296576f49be37a1496d5951796211a8db0aa22cc0d68c46440dad808c + url: "https://pub.dev" source: hosted version: "2.0.4" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" + sha256: "992f0fdc46d0a3c0ac2e5859f2de0e577bbe51f78a77ee8f357cbe626a2ad32d" + url: "https://pub.dev" source: hosted version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - url: "https://pub.dartlang.org" + sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958 + url: "https://pub.dev" source: hosted version: "2.0.4" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - url: "https://pub.dartlang.org" + sha256: "97f7ab9a7da96d9cf19581f5de520ceb529548498bd6b5e0ccd02d68a0d15eba" + url: "https://pub.dev" source: hosted version: "2.1.1" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: "8ec607599dd0a78931a5114cdac7d609b6dbbf479a38acc9a6dba024b2a30ea0" + url: "https://pub.dev" source: hosted version: "1.3.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "6db16374bc3497d21aa0eebe674d3db9fdf82082aac0f04dc7b44e4af5b08afc" + url: "https://pub.dev" source: hosted version: "1.0.2" sky_engine: @@ -885,233 +1068,290 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: "85f8c7d6425dff95475db618404732f034c87fe23efe05478cea50520a2517a3" + url: "https://pub.dev" source: hosted version: "1.2.5" source_helper: dependency: transitive description: name: source_helper - url: "https://pub.dartlang.org" + sha256: "3b67aade1d52416149c633ba1bb36df44d97c6b51830c2198e934e3fca87ca1f" + url: "https://pub.dev" source: hosted version: "1.3.3" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e + url: "https://pub.dev" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" sync_http: dependency: transitive description: name: sync_http - url: "https://pub.dartlang.org" + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" source: hosted version: "0.3.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.4.16" time: dependency: transitive description: name: time - url: "https://pub.dartlang.org" + sha256: "267028bb7b3e87bbfd66876c6389d7101e4b14eb94fe863d3e008e497ca07844" + url: "https://pub.dev" source: hosted version: "2.1.2" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: c386d07d7f5efc613479a7c4d9d64b03710b03cfaa7e8ad5f2bfb295a1f0dfad + url: "https://pub.dev" source: hosted version: "1.0.0" total_lints: dependency: "direct dev" description: name: total_lints - url: "https://pub.dartlang.org" + sha256: "8da9ee8d6a8e7c28e5e25bc6f35fb2102eaa7151044d7fabfa11c293ad8b4281" + url: "https://pub.dev" source: hosted version: "2.17.4" tuple: dependency: transitive description: name: tuple - url: "https://pub.dartlang.org" + sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa" + url: "https://pub.dev" source: hosted version: "2.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" source: hosted version: "1.3.1" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + sha256: "4f0d5f9bf7efba3da5a7ff03bd33cc898c84bac978c068e1c94483828e709592" + url: "https://pub.dev" source: hosted version: "6.1.5" url_launcher_android: dependency: transitive description: name: url_launcher_android - url: "https://pub.dartlang.org" + sha256: "1ccd353c1bff66b49863527c02759f4d06b92744bd9777c96a00ca6a9e8e1d2f" + url: "https://pub.dev" source: hosted version: "6.0.17" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - url: "https://pub.dartlang.org" + sha256: "6ba7dddee26c9fae27c9203c424631109d73c8fa26cfa7bc3e35e751cb87f62e" + url: "https://pub.dev" source: hosted version: "6.0.17" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + sha256: "360fa359ab06bcb4f7c5cd3123a2a9a4d3364d4575d27c4b33468bd4497dd094" + url: "https://pub.dev" source: hosted version: "3.0.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + sha256: a9b3ea9043eabfaadfa3fb89de67a11210d85569086d22b3854484beab8b3978 + url: "https://pub.dev" source: hosted version: "3.0.1" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + sha256: "80b860b31a11ebbcbe51b8fe887efc204f3af91522f3b51bcda4622d276d2120" + url: "https://pub.dev" source: hosted version: "2.1.0" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + sha256: "15fd9dbb306d5efce57dcf62dcb1ae045fbf74079ab4464a950e099bf5800deb" + url: "https://pub.dev" source: hosted version: "2.0.12" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + sha256: e3c3b16d3104260c10eea3b0e34272aaa57921f83148b0619f74c2eced9b7ef1 + url: "https://pub.dev" source: hosted version: "3.0.1" url_strategy: dependency: "direct main" description: name: url_strategy - url: "https://pub.dartlang.org" + sha256: "42b68b42a9864c4d710401add17ad06e28f1c1d5500c93b98c431f6b0ea4ab87" + url: "https://pub.dev" source: hosted version: "0.2.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "254348b40251c995cf8301ac715486c8cfa0a93b7fdc4dbd495a30f04db1fb44" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "143c290b762646c696c63be5d976bde7379ea892cb6868ddc5a17cbc56e71411" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "3190cc26d9ebda686bafb9721bb6a74c6d358700f4fc978a0f2cba6912daff86" + url: "https://pub.dev" + source: hosted + version: "1.1.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 + url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "9.4.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 + url: "https://pub.dev" source: hosted version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "3a969ddcc204a3e34e863d204b29c0752716f78b6f9cc8235083208d268a4ccd" + url: "https://pub.dev" source: hosted version: "2.2.0" webdriver: dependency: transitive description: name: webdriver - url: "https://pub.dartlang.org" + sha256: ef67178f0cc7e32c1494645b11639dd1335f1d18814aa8435113a92e9ef9d841 + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.1" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: "6b75ac2ddd42f5c226fdaf4498a2b04071c06f1f2b8f7ab1c3f77cc7f2285ff1" + url: "https://pub.dev" source: hosted version: "2.7.0" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: "060b6e1c891d956f72b5ac9463466c37cce3fa962a921532fc001e86fe93438e" + url: "https://pub.dev" source: hosted version: "0.2.0+1" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + url: "https://pub.dev" source: hosted - version: "5.4.1" + version: "6.2.2" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted version: "3.1.1" sdks: - dart: ">=2.18.1 <3.0.0" - flutter: ">=3.3.2" + dart: ">=2.19.2 <3.0.0" + flutter: ">=3.7.3" diff --git a/learning/tour-of-beam/frontend/pubspec.yaml b/learning/tour-of-beam/frontend/pubspec.yaml index 88655ad0b665..34656acecec2 100644 --- a/learning/tour-of-beam/frontend/pubspec.yaml +++ b/learning/tour-of-beam/frontend/pubspec.yaml @@ -23,7 +23,7 @@ publish_to: 'none' version: 0.1.0 environment: - sdk: '>=2.18.1 <3.0.0' + sdk: '>=2.19.2 <4.0.0' flutter: '>=3.3.2' dependencies: @@ -38,13 +38,13 @@ dependencies: firebase_core: ^2.1.1 flutter: { sdk: flutter } flutter_markdown: ^0.6.12 - flutter_svg: ^1.0.3 + flutter_svg: ^2.0.1 get_it: ^7.2.0 - google_fonts: ^3.0.1 - google_sign_in: ^5.4.2 + google_fonts: ^4.0.3 + google_sign_in: ^6.0.0 http: ^0.13.5 json_annotation: ^4.7.0 - markdown: ^6.0.1 + markdown: ^7.0.1 playground_components: { path: ../../../playground/frontend/playground_components } provider: ^6.0.3 shared_preferences: ^2.0.15 @@ -53,7 +53,7 @@ dependencies: dev_dependencies: build_runner: ^2.2.0 - flutter_gen_runner: ^4.3.0 + flutter_gen_runner: ^5.2.0 flutter_test: { sdk: flutter } integration_test: { sdk: flutter } json_serializable: ^6.4.1