From 93db48966c420b077c495ac2a891f0a908d01bc7 Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Fri, 23 Jun 2023 05:24:11 +0200 Subject: [PATCH] Explicit import for Platform and kIsWeb (#1898) Following the ideas in flutter/website#7798 I have changed the imports needed for Platform and kIsWeb to be explicitly named. ## Pre-launch Checklist - [ ] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [ ] I signed the [CLA]. - [ ] I read the [Contributors Guide]. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/wiki/Chat [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md --- animations/lib/main.dart | 4 ++-- code_sharing/client/lib/main.dart | 2 +- form_app/lib/main.dart | 4 ++-- infinite_list/lib/main.dart | 4 ++-- isolate_example/lib/main.dart | 4 ++-- jsonexample/lib/main.dart | 4 ++-- navigation_and_routing/lib/main.dart | 4 ++-- provider_counter/lib/main.dart | 4 ++-- provider_shopper/lib/main.dart | 4 ++-- simplistic_calculator/lib/main.dart | 4 ++-- veggieseasons/lib/main.dart | 4 ++-- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/animations/lib/main.dart b/animations/lib/main.dart index 484a6eecf..9e2187f7b 100644 --- a/animations/lib/main.dart +++ b/animations/lib/main.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:window_size/window_size.dart'; diff --git a/code_sharing/client/lib/main.dart b/code_sharing/client/lib/main.dart index 1968546e4..2f70689fb 100644 --- a/code_sharing/client/lib/main.dart +++ b/code_sharing/client/lib/main.dart @@ -1,5 +1,5 @@ import 'dart:convert'; -import 'dart:io'; +import 'dart:io' show Platform; import 'package:http/http.dart' as http; import 'package:shared/shared.dart'; import 'package:flutter/material.dart'; diff --git a/form_app/lib/main.dart b/form_app/lib/main.dart index 7517b572e..d986de48d 100644 --- a/form_app/lib/main.dart +++ b/form_app/lib/main.dart @@ -2,9 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:window_size/window_size.dart'; diff --git a/infinite_list/lib/main.dart b/infinite_list/lib/main.dart index 9f25ac947..ba2bc32ce 100644 --- a/infinite_list/lib/main.dart +++ b/infinite_list/lib/main.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:window_size/window_size.dart'; diff --git a/isolate_example/lib/main.dart b/isolate_example/lib/main.dart index dd1e1c82d..6ee432951 100644 --- a/isolate_example/lib/main.dart +++ b/isolate_example/lib/main.dart @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'dart:io'; +import 'dart:io' show Platform; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:window_size/window_size.dart'; diff --git a/jsonexample/lib/main.dart b/jsonexample/lib/main.dart index 085b99519..0aaa28866 100644 --- a/jsonexample/lib/main.dart +++ b/jsonexample/lib/main.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:jsonexample/tab_pages.dart'; import 'package:window_size/window_size.dart'; diff --git a/navigation_and_routing/lib/main.dart b/navigation_and_routing/lib/main.dart index 4925b1fec..1236816da 100644 --- a/navigation_and_routing/lib/main.dart +++ b/navigation_and_routing/lib/main.dart @@ -2,9 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:url_strategy/url_strategy.dart'; import 'package:window_size/window_size.dart'; diff --git a/provider_counter/lib/main.dart b/provider_counter/lib/main.dart index 53cefc2dd..d60faebbd 100644 --- a/provider_counter/lib/main.dart +++ b/provider_counter/lib/main.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:window_size/window_size.dart'; diff --git a/provider_shopper/lib/main.dart b/provider_shopper/lib/main.dart index 8992e78ac..e20234925 100644 --- a/provider_shopper/lib/main.dart +++ b/provider_shopper/lib/main.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:provider/provider.dart'; diff --git a/simplistic_calculator/lib/main.dart b/simplistic_calculator/lib/main.dart index 953db5f17..7f8ecd0a6 100644 --- a/simplistic_calculator/lib/main.dart +++ b/simplistic_calculator/lib/main.dart @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; import 'package:auto_size_text/auto_size_text.dart'; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:flutter_layout_grid/flutter_layout_grid.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/veggieseasons/lib/main.dart b/veggieseasons/lib/main.dart index a09b0d8f5..4bd78bc5f 100644 --- a/veggieseasons/lib/main.dart +++ b/veggieseasons/lib/main.dart @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:io'; +import 'dart:io' show Platform; import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/services.dart' show DeviceOrientation, SystemChrome; import 'package:go_router/go_router.dart'; import 'package:provider/provider.dart';