mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Fixups (#2310)
Fixes #2301 --------- Co-authored-by: Brett Morgan <brett.morgan@gmail.com> Co-authored-by: Brett Morgan <brettmorgan@google.com>
This commit is contained in:
@@ -251,6 +251,7 @@ class PromptScreen extends StatelessWidget {
|
|||||||
child: MarketplaceButton(
|
child: MarketplaceButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await viewModel.submitPrompt().then((_) async {
|
await viewModel.submitPrompt().then((_) async {
|
||||||
|
if (!context.mounted) return;
|
||||||
if (viewModel.recipe != null) {
|
if (viewModel.recipe != null) {
|
||||||
bool? shouldSave = await showDialog<bool>(
|
bool? shouldSave = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class IconLoadingAnimator extends StatefulWidget {
|
|||||||
var rand = Random();
|
var rand = Random();
|
||||||
|
|
||||||
class _IconLoadingAnimatorState extends State<IconLoadingAnimator> {
|
class _IconLoadingAnimatorState extends State<IconLoadingAnimator> {
|
||||||
late List<IconData> notYetSeenIcons;
|
|
||||||
late IconData currentIcon;
|
late IconData currentIcon;
|
||||||
late Color currentColor;
|
late Color currentColor;
|
||||||
late Timer timer;
|
late Timer timer;
|
||||||
@@ -38,10 +37,8 @@ class _IconLoadingAnimatorState extends State<IconLoadingAnimator> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
notYetSeenIcons = widget.icons;
|
|
||||||
|
|
||||||
currentIcon =
|
currentIcon = widget.icons[rand.nextInt(widget.icons.length)];
|
||||||
notYetSeenIcons.removeAt(rand.nextInt(notYetSeenIcons.length));
|
|
||||||
currentColor = widget.colors[rand.nextInt(widget.colors.length)];
|
currentColor = widget.colors[rand.nextInt(widget.colors.length)];
|
||||||
|
|
||||||
timer = Timer.periodic(
|
timer = Timer.periodic(
|
||||||
@@ -53,10 +50,8 @@ class _IconLoadingAnimatorState extends State<IconLoadingAnimator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void nextIcon() {
|
void nextIcon() {
|
||||||
if (notYetSeenIcons.length == 1) notYetSeenIcons = widget.icons;
|
|
||||||
setState(() {
|
setState(() {
|
||||||
currentIcon =
|
currentIcon = widget.icons[rand.nextInt(widget.icons.length)];
|
||||||
notYetSeenIcons.removeAt(rand.nextInt(notYetSeenIcons.length));
|
|
||||||
currentColor = widget.colors[rand.nextInt(widget.colors.length)];
|
currentColor = widget.colors[rand.nextInt(widget.colors.length)];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
|||||||
var snackBar = const SnackBar(
|
var snackBar = const SnackBar(
|
||||||
content: Text('Main Isolate Done!'),
|
content: Text('Main Isolate Done!'),
|
||||||
);
|
);
|
||||||
|
if (!context.mounted) return;
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -106,6 +107,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
|||||||
var snackBar = const SnackBar(
|
var snackBar = const SnackBar(
|
||||||
content: Text('Secondary Isolate Done!'),
|
content: Text('Secondary Isolate Done!'),
|
||||||
);
|
);
|
||||||
|
if (!context.mounted) return;
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -8,61 +8,63 @@ source "$DIR/flutter_ci_script_shared.sh"
|
|||||||
flutter doctor -v
|
flutter doctor -v
|
||||||
|
|
||||||
declare -ar PROJECT_NAMES=(
|
declare -ar PROJECT_NAMES=(
|
||||||
"add_to_app/android_view/flutter_module_using_plugin"
|
"add_to_app/android_view/flutter_module_using_plugin"
|
||||||
"add_to_app/books/flutter_module_books"
|
"add_to_app/books/flutter_module_books"
|
||||||
"add_to_app/fullscreen/flutter_module"
|
"add_to_app/fullscreen/flutter_module"
|
||||||
"add_to_app/multiple_flutters/multiple_flutters_module"
|
"add_to_app/multiple_flutters/multiple_flutters_module"
|
||||||
"add_to_app/plugin/flutter_module_using_plugin"
|
"add_to_app/plugin/flutter_module_using_plugin"
|
||||||
"add_to_app/prebuilt_module/flutter_module"
|
"add_to_app/prebuilt_module/flutter_module"
|
||||||
"analysis_defaults"
|
"ai_recipe_generation"
|
||||||
"android_splash_screen"
|
"analysis_defaults"
|
||||||
"animations"
|
"android_splash_screen"
|
||||||
"asset_transformation"
|
"animations"
|
||||||
"background_isolate_channels"
|
"asset_transformation"
|
||||||
"code_sharing/client"
|
"background_isolate_channels"
|
||||||
"code_sharing/server"
|
"code_sharing/client"
|
||||||
"code_sharing/shared"
|
"code_sharing/server"
|
||||||
"context_menus"
|
"code_sharing/shared"
|
||||||
"deeplink_store_example"
|
"context_menus"
|
||||||
"desktop_photo_search/fluent_ui"
|
"deeplink_store_example"
|
||||||
"desktop_photo_search/material"
|
"desktop_photo_search/fluent_ui"
|
||||||
"experimental/federated_plugin/federated_plugin"
|
"desktop_photo_search/material"
|
||||||
"experimental/federated_plugin/federated_plugin/example"
|
"dynamic_theme"
|
||||||
"experimental/federated_plugin/federated_plugin_macos"
|
"experimental/federated_plugin/federated_plugin"
|
||||||
"experimental/federated_plugin/federated_plugin_platform_interface"
|
"experimental/federated_plugin/federated_plugin/example"
|
||||||
"experimental/federated_plugin/federated_plugin_web"
|
"experimental/federated_plugin/federated_plugin_macos"
|
||||||
"experimental/federated_plugin/federated_plugin_windows"
|
"experimental/federated_plugin/federated_plugin_platform_interface"
|
||||||
# TODO: ewindmill to talk to team about removing.
|
"experimental/federated_plugin/federated_plugin_web"
|
||||||
# Depends on package context_menus, which breaks with Material3 by default.
|
"experimental/federated_plugin/federated_plugin_windows"
|
||||||
# "experimental/linting_tool"
|
# TODO: ewindmill to talk to team about removing.
|
||||||
"experimental/pedometer"
|
# Depends on package context_menus, which breaks with Material3 by default.
|
||||||
"experimental/pedometer/example"
|
# "experimental/linting_tool"
|
||||||
"experimental/varfont_shader_puzzle"
|
"experimental/pedometer"
|
||||||
"experimental/web_dashboard"
|
"experimental/pedometer/example"
|
||||||
"flutter_maps_firestore"
|
"experimental/varfont_shader_puzzle"
|
||||||
"form_app"
|
"experimental/web_dashboard"
|
||||||
"game_template"
|
"flutter_maps_firestore"
|
||||||
"google_maps"
|
"form_app"
|
||||||
"infinite_list"
|
"game_template"
|
||||||
"ios_app_clip"
|
"gemini_tasks"
|
||||||
# Don't use 'BuildContext's across async gaps.
|
"google_maps"
|
||||||
# "isolate_example"
|
"infinite_list"
|
||||||
"material_3_demo"
|
"ios_app_clip"
|
||||||
"navigation_and_routing"
|
"isolate_example"
|
||||||
"place_tracker"
|
"material_3_demo"
|
||||||
"platform_channels"
|
"navigation_and_routing"
|
||||||
"platform_design"
|
"place_tracker"
|
||||||
"platform_view_swift"
|
"platform_channels"
|
||||||
"provider_counter"
|
"platform_design"
|
||||||
"provider_shopper"
|
"platform_view_swift"
|
||||||
"simple_shader"
|
"provider_counter"
|
||||||
"simplistic_calculator"
|
"provider_shopper"
|
||||||
"simplistic_editor"
|
"simple_shader"
|
||||||
"testing_app"
|
"simplistic_calculator"
|
||||||
"veggieseasons"
|
"simplistic_editor"
|
||||||
"web_embedding/element_embedding_demo"
|
"testing_app"
|
||||||
"web/_tool"
|
"veggieseasons"
|
||||||
"web/samples_index"
|
"web_embedding/element_embedding_demo"
|
||||||
|
"web/_tool"
|
||||||
|
"web/samples_index"
|
||||||
)
|
)
|
||||||
|
|
||||||
ci_projects "beta" "${PROJECT_NAMES[@]}"
|
ci_projects "beta" "${PROJECT_NAMES[@]}"
|
||||||
|
|||||||
@@ -8,63 +8,63 @@ source "$DIR/flutter_ci_script_shared.sh"
|
|||||||
flutter doctor -v
|
flutter doctor -v
|
||||||
|
|
||||||
declare -ar PROJECT_NAMES=(
|
declare -ar PROJECT_NAMES=(
|
||||||
"add_to_app/android_view/flutter_module_using_plugin"
|
"add_to_app/android_view/flutter_module_using_plugin"
|
||||||
"add_to_app/books/flutter_module_books"
|
"add_to_app/books/flutter_module_books"
|
||||||
"add_to_app/fullscreen/flutter_module"
|
"add_to_app/fullscreen/flutter_module"
|
||||||
"add_to_app/multiple_flutters/multiple_flutters_module"
|
"add_to_app/multiple_flutters/multiple_flutters_module"
|
||||||
"add_to_app/plugin/flutter_module_using_plugin"
|
"add_to_app/plugin/flutter_module_using_plugin"
|
||||||
"add_to_app/prebuilt_module/flutter_module"
|
"add_to_app/prebuilt_module/flutter_module"
|
||||||
# Don't use 'BuildContext's across async gaps.
|
"ai_recipe_generation"
|
||||||
# "ai_recipe_generation"
|
"analysis_defaults"
|
||||||
"analysis_defaults"
|
"android_splash_screen"
|
||||||
"android_splash_screen"
|
"animations"
|
||||||
"animations"
|
"asset_transformation"
|
||||||
"asset_transformation"
|
"background_isolate_channels"
|
||||||
"background_isolate_channels"
|
"code_sharing/client"
|
||||||
"code_sharing/client"
|
"code_sharing/server"
|
||||||
"code_sharing/server"
|
"code_sharing/shared"
|
||||||
"code_sharing/shared"
|
"context_menus"
|
||||||
"context_menus"
|
"deeplink_store_example"
|
||||||
"deeplink_store_example"
|
"desktop_photo_search/fluent_ui"
|
||||||
"desktop_photo_search/fluent_ui"
|
"desktop_photo_search/material"
|
||||||
"desktop_photo_search/material"
|
"dynamic_theme"
|
||||||
"experimental/federated_plugin/federated_plugin"
|
"experimental/federated_plugin/federated_plugin"
|
||||||
"experimental/federated_plugin/federated_plugin/example"
|
"experimental/federated_plugin/federated_plugin/example"
|
||||||
"experimental/federated_plugin/federated_plugin_macos"
|
"experimental/federated_plugin/federated_plugin_macos"
|
||||||
"experimental/federated_plugin/federated_plugin_platform_interface"
|
"experimental/federated_plugin/federated_plugin_platform_interface"
|
||||||
"experimental/federated_plugin/federated_plugin_web"
|
"experimental/federated_plugin/federated_plugin_web"
|
||||||
"experimental/federated_plugin/federated_plugin_windows"
|
"experimental/federated_plugin/federated_plugin_windows"
|
||||||
# TODO: ewindmill to talk to team about removing.
|
# TODO: ewindmill to talk to team about removing.
|
||||||
# Depends on package context_menus, which breaks with Material3 by default.
|
# Depends on package context_menus, which breaks with Material3 by default.
|
||||||
# "experimental/linting_tool"
|
# "experimental/linting_tool"
|
||||||
"experimental/pedometer"
|
"experimental/pedometer"
|
||||||
"experimental/pedometer/example"
|
"experimental/pedometer/example"
|
||||||
"experimental/varfont_shader_puzzle"
|
"experimental/varfont_shader_puzzle"
|
||||||
"experimental/web_dashboard"
|
"experimental/web_dashboard"
|
||||||
"flutter_maps_firestore"
|
"flutter_maps_firestore"
|
||||||
"form_app"
|
"form_app"
|
||||||
"game_template"
|
"game_template"
|
||||||
"google_maps"
|
"gemini_tasks"
|
||||||
"infinite_list"
|
"google_maps"
|
||||||
"ios_app_clip"
|
"infinite_list"
|
||||||
# Don't use 'BuildContext's across async gaps.
|
"ios_app_clip"
|
||||||
# "isolate_example"
|
"isolate_example"
|
||||||
"material_3_demo"
|
"material_3_demo"
|
||||||
"navigation_and_routing"
|
"navigation_and_routing"
|
||||||
"place_tracker"
|
"place_tracker"
|
||||||
"platform_channels"
|
"platform_channels"
|
||||||
"platform_design"
|
"platform_design"
|
||||||
"platform_view_swift"
|
"platform_view_swift"
|
||||||
"provider_counter"
|
"provider_counter"
|
||||||
"provider_shopper"
|
"provider_shopper"
|
||||||
"simple_shader"
|
"simple_shader"
|
||||||
"simplistic_calculator"
|
"simplistic_calculator"
|
||||||
"simplistic_editor"
|
"simplistic_editor"
|
||||||
"testing_app"
|
"testing_app"
|
||||||
"veggieseasons"
|
"veggieseasons"
|
||||||
"web_embedding/element_embedding_demo"
|
"web_embedding/element_embedding_demo"
|
||||||
"web/_tool"
|
"web/_tool"
|
||||||
"web/samples_index"
|
"web/samples_index"
|
||||||
)
|
)
|
||||||
|
|
||||||
ci_projects "master" "${PROJECT_NAMES[@]}"
|
ci_projects "master" "${PROJECT_NAMES[@]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user