Skip to content

Commit

Permalink
Fixups (#2310)
Browse files Browse the repository at this point in the history
Fixes #2301

---------

Co-authored-by: Brett Morgan <[email protected]>
Co-authored-by: Brett Morgan <[email protected]>
  • Loading branch information
3 people committed May 29, 2024
1 parent 3af60eb commit 0cfd119
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ class PromptScreen extends StatelessWidget {
child: MarketplaceButton(
onPressed: () async {
await viewModel.submitPrompt().then((_) async {
if (!context.mounted) return;
if (viewModel.recipe != null) {
bool? shouldSave = await showDialog<bool>(
context: context,
Expand Down
9 changes: 2 additions & 7 deletions ai_recipe_generation/lib/widgets/icon_loading_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,15 @@ class IconLoadingAnimator extends StatefulWidget {
var rand = Random();

class _IconLoadingAnimatorState extends State<IconLoadingAnimator> {
late List<IconData> notYetSeenIcons;
late IconData currentIcon;
late Color currentColor;
late Timer timer;

@override
void initState() {
super.initState();
notYetSeenIcons = widget.icons;

currentIcon =
notYetSeenIcons.removeAt(rand.nextInt(notYetSeenIcons.length));
currentIcon = widget.icons[rand.nextInt(widget.icons.length)];
currentColor = widget.colors[rand.nextInt(widget.colors.length)];

timer = Timer.periodic(
Expand All @@ -53,10 +50,8 @@ class _IconLoadingAnimatorState extends State<IconLoadingAnimator> {
}

void nextIcon() {
if (notYetSeenIcons.length == 1) notYetSeenIcons = widget.icons;
setState(() {
currentIcon =
notYetSeenIcons.removeAt(rand.nextInt(notYetSeenIcons.length));
currentIcon = widget.icons[rand.nextInt(widget.icons.length)];
currentColor = widget.colors[rand.nextInt(widget.colors.length)];
});
}
Expand Down
2 changes: 2 additions & 0 deletions isolate_example/lib/performance_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class _PerformancePageState extends State<PerformancePage> {
var snackBar = const SnackBar(
content: Text('Main Isolate Done!'),
);
if (!context.mounted) return;
ScaffoldMessenger.of(context).showSnackBar(snackBar);
});

Expand All @@ -106,6 +107,7 @@ class _PerformancePageState extends State<PerformancePage> {
var snackBar = const SnackBar(
content: Text('Secondary Isolate Done!'),
);
if (!context.mounted) return;
ScaffoldMessenger.of(context).showSnackBar(snackBar);
});

Expand Down
112 changes: 57 additions & 55 deletions tool/flutter_ci_script_beta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,61 +8,63 @@ source "$DIR/flutter_ci_script_shared.sh"
flutter doctor -v

declare -ar PROJECT_NAMES=(
"add_to_app/android_view/flutter_module_using_plugin"
"add_to_app/books/flutter_module_books"
"add_to_app/fullscreen/flutter_module"
"add_to_app/multiple_flutters/multiple_flutters_module"
"add_to_app/plugin/flutter_module_using_plugin"
"add_to_app/prebuilt_module/flutter_module"
"analysis_defaults"
"android_splash_screen"
"animations"
"asset_transformation"
"background_isolate_channels"
"code_sharing/client"
"code_sharing/server"
"code_sharing/shared"
"context_menus"
"deeplink_store_example"
"desktop_photo_search/fluent_ui"
"desktop_photo_search/material"
"experimental/federated_plugin/federated_plugin"
"experimental/federated_plugin/federated_plugin/example"
"experimental/federated_plugin/federated_plugin_macos"
"experimental/federated_plugin/federated_plugin_platform_interface"
"experimental/federated_plugin/federated_plugin_web"
"experimental/federated_plugin/federated_plugin_windows"
# TODO: ewindmill to talk to team about removing.
# Depends on package context_menus, which breaks with Material3 by default.
# "experimental/linting_tool"
"experimental/pedometer"
"experimental/pedometer/example"
"experimental/varfont_shader_puzzle"
"experimental/web_dashboard"
"flutter_maps_firestore"
"form_app"
"game_template"
"google_maps"
"infinite_list"
"ios_app_clip"
# Don't use 'BuildContext's across async gaps.
# "isolate_example"
"material_3_demo"
"navigation_and_routing"
"place_tracker"
"platform_channels"
"platform_design"
"platform_view_swift"
"provider_counter"
"provider_shopper"
"simple_shader"
"simplistic_calculator"
"simplistic_editor"
"testing_app"
"veggieseasons"
"web_embedding/element_embedding_demo"
"web/_tool"
"web/samples_index"
"add_to_app/android_view/flutter_module_using_plugin"
"add_to_app/books/flutter_module_books"
"add_to_app/fullscreen/flutter_module"
"add_to_app/multiple_flutters/multiple_flutters_module"
"add_to_app/plugin/flutter_module_using_plugin"
"add_to_app/prebuilt_module/flutter_module"
"ai_recipe_generation"
"analysis_defaults"
"android_splash_screen"
"animations"
"asset_transformation"
"background_isolate_channels"
"code_sharing/client"
"code_sharing/server"
"code_sharing/shared"
"context_menus"
"deeplink_store_example"
"desktop_photo_search/fluent_ui"
"desktop_photo_search/material"
"dynamic_theme"
"experimental/federated_plugin/federated_plugin"
"experimental/federated_plugin/federated_plugin/example"
"experimental/federated_plugin/federated_plugin_macos"
"experimental/federated_plugin/federated_plugin_platform_interface"
"experimental/federated_plugin/federated_plugin_web"
"experimental/federated_plugin/federated_plugin_windows"
# TODO: ewindmill to talk to team about removing.
# Depends on package context_menus, which breaks with Material3 by default.
# "experimental/linting_tool"
"experimental/pedometer"
"experimental/pedometer/example"
"experimental/varfont_shader_puzzle"
"experimental/web_dashboard"
"flutter_maps_firestore"
"form_app"
"game_template"
"gemini_tasks"
"google_maps"
"infinite_list"
"ios_app_clip"
"isolate_example"
"material_3_demo"
"navigation_and_routing"
"place_tracker"
"platform_channels"
"platform_design"
"platform_view_swift"
"provider_counter"
"provider_shopper"
"simple_shader"
"simplistic_calculator"
"simplistic_editor"
"testing_app"
"veggieseasons"
"web_embedding/element_embedding_demo"
"web/_tool"
"web/samples_index"
)

ci_projects "beta" "${PROJECT_NAMES[@]}"
Expand Down
114 changes: 57 additions & 57 deletions tool/flutter_ci_script_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,63 @@ source "$DIR/flutter_ci_script_shared.sh"
flutter doctor -v

declare -ar PROJECT_NAMES=(
"add_to_app/android_view/flutter_module_using_plugin"
"add_to_app/books/flutter_module_books"
"add_to_app/fullscreen/flutter_module"
"add_to_app/multiple_flutters/multiple_flutters_module"
"add_to_app/plugin/flutter_module_using_plugin"
"add_to_app/prebuilt_module/flutter_module"
# Don't use 'BuildContext's across async gaps.
# "ai_recipe_generation"
"analysis_defaults"
"android_splash_screen"
"animations"
"asset_transformation"
"background_isolate_channels"
"code_sharing/client"
"code_sharing/server"
"code_sharing/shared"
"context_menus"
"deeplink_store_example"
"desktop_photo_search/fluent_ui"
"desktop_photo_search/material"
"experimental/federated_plugin/federated_plugin"
"experimental/federated_plugin/federated_plugin/example"
"experimental/federated_plugin/federated_plugin_macos"
"experimental/federated_plugin/federated_plugin_platform_interface"
"experimental/federated_plugin/federated_plugin_web"
"experimental/federated_plugin/federated_plugin_windows"
# TODO: ewindmill to talk to team about removing.
# Depends on package context_menus, which breaks with Material3 by default.
# "experimental/linting_tool"
"experimental/pedometer"
"experimental/pedometer/example"
"experimental/varfont_shader_puzzle"
"experimental/web_dashboard"
"flutter_maps_firestore"
"form_app"
"game_template"
"google_maps"
"infinite_list"
"ios_app_clip"
# Don't use 'BuildContext's across async gaps.
# "isolate_example"
"material_3_demo"
"navigation_and_routing"
"place_tracker"
"platform_channels"
"platform_design"
"platform_view_swift"
"provider_counter"
"provider_shopper"
"simple_shader"
"simplistic_calculator"
"simplistic_editor"
"testing_app"
"veggieseasons"
"web_embedding/element_embedding_demo"
"web/_tool"
"web/samples_index"
"add_to_app/android_view/flutter_module_using_plugin"
"add_to_app/books/flutter_module_books"
"add_to_app/fullscreen/flutter_module"
"add_to_app/multiple_flutters/multiple_flutters_module"
"add_to_app/plugin/flutter_module_using_plugin"
"add_to_app/prebuilt_module/flutter_module"
"ai_recipe_generation"
"analysis_defaults"
"android_splash_screen"
"animations"
"asset_transformation"
"background_isolate_channels"
"code_sharing/client"
"code_sharing/server"
"code_sharing/shared"
"context_menus"
"deeplink_store_example"
"desktop_photo_search/fluent_ui"
"desktop_photo_search/material"
"dynamic_theme"
"experimental/federated_plugin/federated_plugin"
"experimental/federated_plugin/federated_plugin/example"
"experimental/federated_plugin/federated_plugin_macos"
"experimental/federated_plugin/federated_plugin_platform_interface"
"experimental/federated_plugin/federated_plugin_web"
"experimental/federated_plugin/federated_plugin_windows"
# TODO: ewindmill to talk to team about removing.
# Depends on package context_menus, which breaks with Material3 by default.
# "experimental/linting_tool"
"experimental/pedometer"
"experimental/pedometer/example"
"experimental/varfont_shader_puzzle"
"experimental/web_dashboard"
"flutter_maps_firestore"
"form_app"
"game_template"
"gemini_tasks"
"google_maps"
"infinite_list"
"ios_app_clip"
"isolate_example"
"material_3_demo"
"navigation_and_routing"
"place_tracker"
"platform_channels"
"platform_design"
"platform_view_swift"
"provider_counter"
"provider_shopper"
"simple_shader"
"simplistic_calculator"
"simplistic_editor"
"testing_app"
"veggieseasons"
"web_embedding/element_embedding_demo"
"web/_tool"
"web/samples_index"
)

ci_projects "master" "${PROJECT_NAMES[@]}"
Expand Down

0 comments on commit 0cfd119

Please sign in to comment.