diff --git a/case_study/code_size/optimized/code_size_images/README.md b/case_study/code_size/optimized/code_size_images/README.md index 9e27825e48a..6b0ed8d5c7b 100644 --- a/case_study/code_size/optimized/code_size_images/README.md +++ b/case_study/code_size/optimized/code_size_images/README.md @@ -1,16 +1,3 @@ # code_size_images -A flutter project demonstrating code size issues with images - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +A Flutter project demonstrating code size issues with images diff --git a/case_study/code_size/optimized/code_size_images/lib/main.dart b/case_study/code_size/optimized/code_size_images/lib/main.dart index 5ab430eaf62..77a7e66d2c0 100644 --- a/case_study/code_size/optimized/code_size_images/lib/main.dart +++ b/case_study/code_size/optimized/code_size_images/lib/main.dart @@ -25,7 +25,7 @@ class MyHomePage extends StatefulWidget { const MyHomePage({Key? key}) : super(key: key); @override - _MyHomePageState createState() => _MyHomePageState(); + State createState() => _MyHomePageState(); } class _MyHomePageState extends State { diff --git a/case_study/code_size/optimized/code_size_images/pubspec.yaml b/case_study/code_size/optimized/code_size_images/pubspec.yaml index acc8555d8cc..5d0b4a5c716 100644 --- a/case_study/code_size/optimized/code_size_images/pubspec.yaml +++ b/case_study/code_size/optimized/code_size_images/pubspec.yaml @@ -1,24 +1,9 @@ name: code_size_images -description: A flutter project demonstrating code size issues with images - -# The following line prevents the package from being accidentally published to -# pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 +description: A Flutter project demonstrating code size issues with images. +publish_to: none environment: - sdk: '>=2.12.0 <4.0.0' + sdk: ^3.0.0 dependencies: flutter: @@ -28,38 +13,7 @@ dev_dependencies: flutter_test: sdk: flutter -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: uses-material-design: true - # The assets are compressed in this version of code_size_images. assets: - assets/ - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/case_study/code_size/optimized/code_size_package/README.md b/case_study/code_size/optimized/code_size_package/README.md index 19062afea50..f99ad9c5fea 100644 --- a/case_study/code_size/optimized/code_size_package/README.md +++ b/case_study/code_size/optimized/code_size_package/README.md @@ -1,16 +1,3 @@ # code_size_package -A flutter project demonstrating code size issues with packages. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +A Flutter project demonstrating code size issues with packages. diff --git a/case_study/code_size/optimized/code_size_package/lib/main.dart b/case_study/code_size/optimized/code_size_package/lib/main.dart index e3e9ad3dc98..0be9c940ded 100644 --- a/case_study/code_size/optimized/code_size_package/lib/main.dart +++ b/case_study/code_size/optimized/code_size_package/lib/main.dart @@ -27,7 +27,7 @@ class MyHomePage extends StatefulWidget { final String title; @override - _MyHomePageState createState() => _MyHomePageState(); + State createState() => _MyHomePageState(); } class _MyHomePageState extends State { diff --git a/case_study/code_size/optimized/code_size_package/pubspec.yaml b/case_study/code_size/optimized/code_size_package/pubspec.yaml index a24ef0b0e3f..e9d00b80c6e 100644 --- a/case_study/code_size/optimized/code_size_package/pubspec.yaml +++ b/case_study/code_size/optimized/code_size_package/pubspec.yaml @@ -1,12 +1,9 @@ name: code_size_package -description: A new Flutter project. - -publish_to: "none" - -version: 1.0.0+1 +description: A Flutter project demonstrating code size issues with packages. +publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ^3.0.0 dependencies: flutter: diff --git a/case_study/code_size/unoptimized/code_size_images/README.md b/case_study/code_size/unoptimized/code_size_images/README.md index 9e27825e48a..6b0ed8d5c7b 100644 --- a/case_study/code_size/unoptimized/code_size_images/README.md +++ b/case_study/code_size/unoptimized/code_size_images/README.md @@ -1,16 +1,3 @@ # code_size_images -A flutter project demonstrating code size issues with images - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +A Flutter project demonstrating code size issues with images diff --git a/case_study/code_size/unoptimized/code_size_images/lib/main.dart b/case_study/code_size/unoptimized/code_size_images/lib/main.dart index 5ab430eaf62..77a7e66d2c0 100644 --- a/case_study/code_size/unoptimized/code_size_images/lib/main.dart +++ b/case_study/code_size/unoptimized/code_size_images/lib/main.dart @@ -25,7 +25,7 @@ class MyHomePage extends StatefulWidget { const MyHomePage({Key? key}) : super(key: key); @override - _MyHomePageState createState() => _MyHomePageState(); + State createState() => _MyHomePageState(); } class _MyHomePageState extends State { diff --git a/case_study/code_size/unoptimized/code_size_images/pubspec.yaml b/case_study/code_size/unoptimized/code_size_images/pubspec.yaml index 66af1365cab..90b024f42fc 100644 --- a/case_study/code_size/unoptimized/code_size_images/pubspec.yaml +++ b/case_study/code_size/unoptimized/code_size_images/pubspec.yaml @@ -1,24 +1,9 @@ name: code_size_images -description: A flutter project demonstrating code size issues with images - -# The following line prevents the package from being accidentally published to -# pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 +description: A Flutter project demonstrating code size issues with images. +publish_to: none environment: - sdk: '>=2.12.0 <4.0.0' + sdk: ^3.0.0 dependencies: flutter: @@ -28,38 +13,8 @@ dev_dependencies: flutter_test: sdk: flutter -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: uses-material-design: true # The assets are not compressed in this version of code_size_images. assets: - - assets/ - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + - assets/ diff --git a/case_study/code_size/unoptimized/code_size_package/README.md b/case_study/code_size/unoptimized/code_size_package/README.md index 19062afea50..f99ad9c5fea 100644 --- a/case_study/code_size/unoptimized/code_size_package/README.md +++ b/case_study/code_size/unoptimized/code_size_package/README.md @@ -1,16 +1,3 @@ # code_size_package -A flutter project demonstrating code size issues with packages. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +A Flutter project demonstrating code size issues with packages. diff --git a/case_study/code_size/unoptimized/code_size_package/lib/main.dart b/case_study/code_size/unoptimized/code_size_package/lib/main.dart index cd500f5dfe0..b2bda32bdd9 100644 --- a/case_study/code_size/unoptimized/code_size_package/lib/main.dart +++ b/case_study/code_size/unoptimized/code_size_package/lib/main.dart @@ -24,7 +24,7 @@ class MyHomePage extends StatefulWidget { final String title; @override - _MyHomePageState createState() => _MyHomePageState(); + State createState() => _MyHomePageState(); } class _MyHomePageState extends State { diff --git a/case_study/code_size/unoptimized/code_size_package/pubspec.yaml b/case_study/code_size/unoptimized/code_size_package/pubspec.yaml index a02d9afae7c..dc50089904a 100644 --- a/case_study/code_size/unoptimized/code_size_package/pubspec.yaml +++ b/case_study/code_size/unoptimized/code_size_package/pubspec.yaml @@ -1,12 +1,9 @@ name: code_size_package -description: A new Flutter project. - -publish_to: "none" - -version: 1.0.0+1 +description: A Flutter project demonstrating code size issues with packages. +publish_to: none environment: - sdk: '>=2.12.0 <4.0.0' + sdk: ^3.0.0 dependencies: flutter: diff --git a/case_study/memory_leaks/images_1/README.md b/case_study/memory_leaks/images_1/README.md index 7eeaf53cde5..8e0f0b2e9a2 100644 --- a/case_study/memory_leaks/images_1/README.md +++ b/case_study/memory_leaks/images_1/README.md @@ -32,7 +32,7 @@ Press the Snapshot button to collect information about all objects in the Dart V -When complete a Heat Map will appear. Turn off the Heat Map swtich: +When complete a Heat Map will appear. Turn off the Heat Map switch: @@ -44,7 +44,7 @@ Press the Analyze button to analyze the current Snapshot -After the snashot analysis a child row inside of > Analysis will be added titled "Snapshot ..." with the timetime stamp of the snapshot e.g., "Snapshot Jun 09 12:23:44". +After the snapshot analysis a child row inside of > Analysis will be added titled "Snapshot ..." with the timestamp of the snapshot e.g., "Snapshot Jun 09 12:23:44". @@ -153,7 +153,3 @@ The parameters cacheWidth or cacheHeight indicates to the engine that the image Read [[Image.network Documentation](https://api.flutter.dev/flutter/widgets/Image/Image.network.html)]. - -## Getting Started - -For help getting started with Flutter, view online [documentation](http://flutter.io/). diff --git a/case_study/memory_leaks/images_1/analysis_options.yaml b/case_study/memory_leaks/images_1/analysis_options.yaml index 61b6c4de17c..f9b303465f1 100644 --- a/case_study/memory_leaks/images_1/analysis_options.yaml +++ b/case_study/memory_leaks/images_1/analysis_options.yaml @@ -1,29 +1 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/case_study/memory_leaks/images_1/lib/main.dart b/case_study/memory_leaks/images_1/lib/main.dart index 2854ad23740..80c64fe1da5 100644 --- a/case_study/memory_leaks/images_1/lib/main.dart +++ b/case_study/memory_leaks/images_1/lib/main.dart @@ -10,7 +10,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); // This widget is the root of your application. @override @@ -29,12 +29,12 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - const MyHomePage({Key? key, this.title = ""}) : super(key: key); + const MyHomePage({super.key, this.title = ""}); final String title; @override - MyHomePageState createState() => MyHomePageState(); + State createState() => MyHomePageState(); } int globalObjectId = 0; @@ -97,7 +97,7 @@ class MyHomePageState extends State developer.log('$loadingState, $imageUrl'); - // Progress spinnger. + // Progress spinner. return Center( child: CircularProgressIndicator( value: expectedTotalBytes != null @@ -176,7 +176,7 @@ class MyHomePageState extends State } class SecondScreen extends MyHomePage { - const SecondScreen({Key? key}) : super(key: key); + const SecondScreen({super.key}); } // Loaded images. key is ImageUrl and value is the ImageChunkEvent (total and cumulative bytes loaded). diff --git a/case_study/memory_leaks/images_1/pubspec.yaml b/case_study/memory_leaks/images_1/pubspec.yaml index aff28fc9f52..bcd5928cb87 100644 --- a/case_study/memory_leaks/images_1/pubspec.yaml +++ b/case_study/memory_leaks/images_1/pubspec.yaml @@ -1,31 +1,11 @@ name: memory_leaks_images -description: A new Flutter project. +description: Flutter image memory leak example for a DevTools case study. -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 +publish_to: none environment: - sdk: ">=2.17.0-182.2.beta <3.0.0" + sdk: ^3.0.0 -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter @@ -33,52 +13,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^3.0.1 - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^1.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/case_study/memory_leaks/images_1/web/README.md b/case_study/memory_leaks/images_1/web/README.md index 7eeaf53cde5..05bf1b6565d 100644 --- a/case_study/memory_leaks/images_1/web/README.md +++ b/case_study/memory_leaks/images_1/web/README.md @@ -32,7 +32,7 @@ Press the Snapshot button to collect information about all objects in the Dart V -When complete a Heat Map will appear. Turn off the Heat Map swtich: +When complete a Heat Map will appear. Turn off the Heat Map switch: @@ -44,7 +44,7 @@ Press the Analyze button to analyze the current Snapshot -After the snashot analysis a child row inside of > Analysis will be added titled "Snapshot ..." with the timetime stamp of the snapshot e.g., "Snapshot Jun 09 12:23:44". +After the snapshot analysis a child row inside of > Analysis will be added titled "Snapshot ..." with the timestamp of the snapshot e.g., "Snapshot Jun 09 12:23:44". diff --git a/case_study/memory_leaks/leaking_counter_1/analysis_options.yaml b/case_study/memory_leaks/leaking_counter_1/analysis_options.yaml index 61b6c4de17c..f9b303465f1 100644 --- a/case_study/memory_leaks/leaking_counter_1/analysis_options.yaml +++ b/case_study/memory_leaks/leaking_counter_1/analysis_options.yaml @@ -1,29 +1 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/case_study/memory_leaks/leaking_counter_1/pubspec.yaml b/case_study/memory_leaks/leaking_counter_1/pubspec.yaml index 1d99c0587c4..796dbc2a6b0 100644 --- a/case_study/memory_leaks/leaking_counter_1/pubspec.yaml +++ b/case_study/memory_leaks/leaking_counter_1/pubspec.yaml @@ -1,33 +1,11 @@ name: leaking_counter_1 description: A new Flutter project. -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +publish_to: none environment: - sdk: '>=2.18.0-271.7.beta <4.0.0' + sdk: ^3.0.0 -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter @@ -35,52 +13,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^3.0.1 - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^2.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/case_study/memory_leaks/memory_leak_app/README.md b/case_study/memory_leaks/memory_leak_app/README.md index acaef7c56ff..78cdfa2a52c 100644 --- a/case_study/memory_leaks/memory_leak_app/README.md +++ b/case_study/memory_leaks/memory_leak_app/README.md @@ -2,11 +2,6 @@ A material design widget that displays a horizontal row of tabs. -Read [[Documentation](https://docs.flutter.io/flutter/material/TabBar-class.html)] [[Material Design Spec](https://material.io/guidelines/components/tabs.html)] +Read ([Documentation](https://api.flutter.dev/flutter/material/TabBar-class.html)) ([Material Design Spec](https://m2.material.io/components/tabs)) - - -## Getting Started - -For help getting started with Flutter, view online [documentation](http://flutter.io/). \ No newline at end of file diff --git a/case_study/memory_leaks/memory_leak_app/lib/about.dart b/case_study/memory_leaks/memory_leak_app/lib/about.dart index 14a83d077ea..113ab2bd278 100644 --- a/case_study/memory_leaks/memory_leak_app/lib/about.dart +++ b/case_study/memory_leaks/memory_leak_app/lib/about.dart @@ -8,7 +8,7 @@ import 'common.dart'; class About extends StatefulWidget { @override - AboutState createState() => AboutState(); + State createState() => AboutState(); } class AboutState extends State { diff --git a/case_study/memory_leaks/memory_leak_app/lib/logging.dart b/case_study/memory_leaks/memory_leak_app/lib/logging.dart index a9fe62fb0ab..7444fd63830 100644 --- a/case_study/memory_leaks/memory_leak_app/lib/logging.dart +++ b/case_study/memory_leaks/memory_leak_app/lib/logging.dart @@ -110,11 +110,11 @@ class TimeModel { void _updateLog() { now = DateTime.now(); - final _year = now.year; + final year = now.year; /// Due to a bug, need to verify the date has the current year before /// returning a date and time. - if (_year < 2019) { + if (year < 2019) { return; } diff --git a/case_study/memory_leaks/memory_leak_app/lib/main.dart b/case_study/memory_leaks/memory_leak_app/lib/main.dart index 6115b75e483..84d58a2a357 100644 --- a/case_study/memory_leaks/memory_leak_app/lib/main.dart +++ b/case_study/memory_leaks/memory_leak_app/lib/main.dart @@ -27,7 +27,7 @@ void main() { class MyHome extends StatefulWidget { @override - MyHomeState createState() => MyHomeState(); + State createState() => MyHomeState(); } /// Setup Tabs diff --git a/case_study/memory_leaks/memory_leak_app/lib/restful_servers.dart b/case_study/memory_leaks/memory_leak_app/lib/restful_servers.dart index f3ed728ee25..c4bcce7137b 100644 --- a/case_study/memory_leaks/memory_leak_app/lib/restful_servers.dart +++ b/case_study/memory_leaks/memory_leak_app/lib/restful_servers.dart @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// All Restful Servers are defined here. +/// The RESTful APIs used by the app. +library; /// All servers with RestfulAPI implement this base. abstract class RestfulAPI { @@ -21,7 +22,7 @@ abstract class RestfulAPI { class StarWars extends RestfulAPI { StarWars([String name = starWarsPeople]) { _defaultUri = _friendlyNames[name]!; - _activefriendlyName = name; + _activeFriendlyName = name; } static const String starWarsFilms = 'StarWars Films'; @@ -40,13 +41,13 @@ class StarWars extends RestfulAPI { '$starWarsVehicles': 'https://swapi.co/api/vehicles', }; - late final String _activefriendlyName; + late final String _activeFriendlyName; late final String _defaultUri; static List get friendlyNames => _friendlyNames.keys.toList(); @override - String get activeFriendlyName => _activefriendlyName; + String get activeFriendlyName => _activeFriendlyName; @override String uri() => _defaultUri; @@ -93,7 +94,7 @@ class CityInformation { String state = '???'; } -/// openewathermap APIs +/// OpenWeatherMap APIs /// /// Docs on Restful APIs https://openweathermap.org/current#data /// diff --git a/case_study/memory_leaks/memory_leak_app/lib/tabs/http_data.dart b/case_study/memory_leaks/memory_leak_app/lib/tabs/http_data.dart index 53988af4874..fbecb2ad8ba 100644 --- a/case_study/memory_leaks/memory_leak_app/lib/tabs/http_data.dart +++ b/case_study/memory_leaks/memory_leak_app/lib/tabs/http_data.dart @@ -16,7 +16,7 @@ import 'settings.dart'; /// Create a stateful widget class MyGetHttpData extends StatefulWidget { @override - MyGetHttpDataState createState() => MyGetHttpDataState(); + State createState() => MyGetHttpDataState(); } // Create the state for our stateful widget diff --git a/case_study/memory_leaks/memory_leak_app/lib/tabs/logger.dart b/case_study/memory_leaks/memory_leak_app/lib/tabs/logger.dart index f311695742b..1c13d5eb77c 100644 --- a/case_study/memory_leaks/memory_leak_app/lib/tabs/logger.dart +++ b/case_study/memory_leaks/memory_leak_app/lib/tabs/logger.dart @@ -14,7 +14,7 @@ class Logger extends StatefulWidget { final Logging _logging = Logging.logging; @override - LoggerState createState() => LoggerState(_logging); + State createState() => LoggerState(_logging); } class LoggerState extends State { diff --git a/case_study/memory_leaks/memory_leak_app/lib/tabs/settings.dart b/case_study/memory_leaks/memory_leak_app/lib/tabs/settings.dart index d286620287c..3b27adb9f62 100644 --- a/case_study/memory_leaks/memory_leak_app/lib/tabs/settings.dart +++ b/case_study/memory_leaks/memory_leak_app/lib/tabs/settings.dart @@ -20,7 +20,7 @@ class Settings extends StatefulWidget { final RestfulAPI restfulRoot; @override - SettingsState createState() { + State createState() { state = SettingsState(); return state; } diff --git a/case_study/memory_leaks/memory_leak_app/pubspec.yaml b/case_study/memory_leaks/memory_leak_app/pubspec.yaml index 7dbc3fdb473..18055fa2a69 100644 --- a/case_study/memory_leaks/memory_leak_app/pubspec.yaml +++ b/case_study/memory_leaks/memory_leak_app/pubspec.yaml @@ -1,62 +1,18 @@ name: memory_leak -description: A new Flutter project. +description: Flutter memory leak example app to serve as a DevTools case study. environment: - sdk: '>=2.15.0 <4.0.0' + sdk: ^3.0.0 dependencies: flutter: sdk: flutter + http: ^1.1.0 + intl: any dev_dependencies: flutter_test: sdk: flutter - intl: ^0.18.0 - http: ^0.13.5 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the Icons class. uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.io/assets-and-images/. - - # To add assets from package dependencies, first ensure the asset - # is in the lib/ directory of the dependency. Then, - # refer to the asset with a path prefixed with - # `packages/PACKAGE_NAME/`. The `lib/` is implied, do not - # include `lib/` in the asset path. - # - # Here is an example: - # - # assets: - # - packages/PACKAGE_NAME/path/to/asset - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 diff --git a/case_study/platform_channel/README.md b/case_study/platform_channel/README.md index 52cbe801f41..e234f35f885 100644 --- a/case_study/platform_channel/README.md +++ b/case_study/platform_channel/README.md @@ -1,16 +1,3 @@ # platform_channel A Flutter example that uses a platform channel - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/case_study/platform_channel/lib/channel_demo.dart b/case_study/platform_channel/lib/channel_demo.dart index 1aa9cce793b..2312175ebc5 100644 --- a/case_study/platform_channel/lib/channel_demo.dart +++ b/case_study/platform_channel/lib/channel_demo.dart @@ -5,7 +5,7 @@ import 'package:flutter/services.dart'; class ChannelDemo extends StatefulWidget { @override - _ChannelDemoState createState() => _ChannelDemoState(); + State createState() => _ChannelDemoState(); } class _ChannelDemoState extends State { diff --git a/case_study/platform_channel/pubspec.yaml b/case_study/platform_channel/pubspec.yaml index 389d5d57956..cc5d459ff19 100644 --- a/case_study/platform_channel/pubspec.yaml +++ b/case_study/platform_channel/pubspec.yaml @@ -1,20 +1,10 @@ name: platform_channel -description: A Flutter example that uses a platform channel +description: A Flutter example that uses a platform channel. -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html version: 1.0.0+1 environment: - sdk: '>=2.15.0 <4.0.0' + sdk: ^3.0.0 dependencies: flutter: @@ -24,45 +14,5 @@ dev_dependencies: flutter_test: sdk: flutter - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages