diff --git a/analysis_defaults/lib/flutter.yaml b/analysis_defaults/lib/flutter.yaml index 869a3ffb10a..4d4b00ed0db 100644 --- a/analysis_defaults/lib/flutter.yaml +++ b/analysis_defaults/lib/flutter.yaml @@ -6,15 +6,567 @@ analyzer: strict-inference: true 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.dev/lints. + # + # 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_types_on_closure_parameters: true + # Disallows the use of print statements. + # Encourages the use of proper logging mechanisms. + avoid_print: true + # This is right: + # logger.info('Message'); + # This is wrong: + # print('Message'); + + # Prevents renaming method parameters. + # Keeps parameter names consistent across overridden methods. + avoid_renaming_method_parameters: true + # This is right: + # void method({int value}) {} + # This is wrong: + # void method({int v}) {} + + # Prevents using types as parameter names. + # Avoids confusion and maintains clarity in code. + avoid_types_as_parameter_names: true + # This is right: + # void method({int count}) {} + # This is wrong: + # void method({int int}) {} + + # Disallows unused constructor parameters. + # Ensures all parameters in constructors are utilized. + avoid_unused_constructor_parameters: true + # This is right: + # class MyClass { + # MyClass(this.value); + # final int value; + # } + # This is wrong: + # class MyClass { + # MyClass(this.value); + # final int unusedValue; + # } + + # Avoids using void in async functions. + # Functions should return Future instead of void. avoid_void_async: true + # This is right: + # Future asyncMethod() async {} + # This is wrong: + # void asyncMethod() async {} + + # Ensures that classes with mutable fields do not override equals and hashCode. + avoid_equals_and_hash_code_on_mutable_classes: true + # This is right: + # class MyClass { + # int value; + # } + # This is wrong: + # class MyClass { + # int value; + # @override + # bool operator ==(Object other) => other is MyClass && other.value == value; + # @override + # int get hashCode => value.hashCode; + # } + + + # Prevents the use of private typedef functions, encouraging better code readability. + avoid_private_typedef_functions: true + # This is right: + # typedef MyCallback = void Function(); + # This is wrong: + # typedef _MyCallback = void Function(); + + + # Discourages the use of relative imports for files in lib/, favoring package imports. + avoid_relative_lib_imports: true + # This is right: + # import 'package:my_package/my_file.dart'; + # This is wrong: + # import '../my_file.dart'; + + # Encourages the use of efficient asynchronous IO operations. + avoid_slow_async_io: true + # This is right: + # await File('file.txt').readAsString(); + # This is wrong: + # File('file.txt').openRead().listen((data) {}); + + # Prevents the use of web-specific libraries in Flutter apps that are not web-based. + avoid_web_libraries_in_flutter: true + # This is right: + # import 'package:flutter/material.dart'; + # This is wrong: + # import 'dart:html'; + + + # Ensures that only future-returning expressions are awaited. + await_only_futures: true + # This is right: + # await myFuture; + # This is wrong: + # await nonFuture; + + # Ensures that nullable types are not cast to non-nullable types without checks. + cast_nullable_to_non_nullable: true + # This is right: + # String? nullableValue; + # String value = nullableValue ?? 'default'; + # This is wrong: + # String? nullableValue; + # String value = nullableValue!; + + # Ensures that collection methods are called with the correct type. + collection_methods_unrelated_type: true + # This is right: + # list.remove('item'); + # This is wrong: + # list.remove(123); + + # Ensures comments reference valid identifiers in the code. + comment_references: true + # This is right: + # /// The [value] property stores the value. + # class MyClass { + # int value; + # } + # This is wrong: + # /// The [invalid] property stores the value. + # class MyClass { + # int value; + # } + + # Ensures that extensions are named in camel case. + camel_case_extensions: true + # This is right: + # extension StringExtension on String {} + # This is wrong: + # extension string_extension on String {} + + # Ensures that types are named in camel case. + camel_case_types: true + # This is right: + # class MyClass {} + # This is wrong: + # class my_class {} + + # Ensures that subscriptions are properly cancelled. cancel_subscriptions: true - close_sinks: true - directives_ordering: true + # This is right: + # StreamSubscription subscription = stream.listen((event) {}); + # subscription.cancel(); + # This is wrong: + # StreamSubscription subscription = stream.listen((event) {}); + + # Ensures that constant identifiers are in upper case. + constant_identifier_names: true + # This is right: + # const int MAX_VALUE = 100; + # This is wrong: + # const int maxValue = 100; + + # Prevents using control flow statements in finally blocks. + control_flow_in_finally: true + # This is right: + # try {} finally { + # cleanup(); + # } + # This is wrong: + # try {} finally { + # return; + # } + + # Disallows empty constructor bodies. + empty_constructor_bodies: true + # This is right: + # MyClass(); + # This is wrong: + # MyClass() {} + + # Prevents empty statements. + empty_statements: true + # This is right: + # if (condition) {} + # This is wrong: + # if (condition); + + # Ensures that file names use lowercase_with_underscores. + file_names: true + # This is right: + # my_class.dart + # This is wrong: + # MyClass.dart + + # Enforces overriding both hashCode and ==. + hash_and_equals: true + # This is right: + # @override + # bool operator ==(Object other) { + # return identical(this, other) || other is MyClass && other.value == value; + # } + # @override + # int get hashCode => value.hashCode; + # This is wrong: + # @override + # bool operator ==(Object other) { + # return identical(this, other) || other is MyClass && other.value == value; + # } + + + # Encourages combining return statements with assignments. + join_return_with_assignment: true + # This is right: + # final value = computeValue(); + # return value; + # This is wrong: + # return computeValue(); + + + # Prevents non-constant identifier names from using upper case. + non_constant_identifier_names: true + # This is right: + # var value = 1; + # This is wrong: + # var VALUE = 1; + + # Ensures closures do not use null. + null_closures: true + # This is right: + # list.forEach((element) {}); + # This is wrong: + # list.forEach(null); + + # Ensures only errors are thrown. + only_throw_errors: true + # This is right: + # throw Exception('Error'); + # This is wrong: + # throw 'Error'; + + # Prevents overriding fields. + overridden_fields: true + # This is right: + # class Base { + # int value; + # } + # class Derived extends Base {} + # This is wrong: + # class Base { + # int value; + # } + # class Derived extends Base { + # @override + # int value; + # } + + # Ensures package names use lower case letters. + package_names: true + # This is right: + # my_package + # This is wrong: + # MyPackage + + # Prevents assignment to parameters. + parameter_assignments: true + # This is right: + # void method(int value) { + # final newValue = value; + # } + # This is wrong: + # void method(int value) { + # value = 2; + # } + + # Prefers using const constructors. + prefer_const_constructors: true + # This is right: + # const MyClass(); + # This is wrong: + # MyClass(); + + # Prefers using const constructors in immutables. + prefer_const_constructors_in_immutables: true + # This is right: + # class MyClass { + # const MyClass(); + # } + # This is wrong: + # class MyClass { + # MyClass(); + # } + + # Prefers const declarations. + prefer_const_declarations: true + # This is right: + # const value = 1; + # This is wrong: + # final value = 1; + + # Prefers final for fields. + prefer_final_fields: true + # This is right: + # final int value; + # This is wrong: + # int value; + + # Prefers final for local variables. + prefer_final_locals: true + # This is right: + # final value = 1; + # This is wrong: + # var value = 1; + + # Prefers using isEmpty for iterables. + prefer_is_empty: true + # This is right: + # if (list.isEmpty) {} + # This is wrong: + # if (list.length == 0) {} + + # Prefers using isNotEmpty for iterables. + prefer_is_not_empty: true + # This is right: + # if (list.isNotEmpty) {} + # This is wrong: + # if (list.length > 0) {} + + # Prefers using null-aware operators. + prefer_null_aware_operators: true + # This is right: + # value?.method(); + # This is wrong: + # if (value != null) { + # value.method(); + # } + + # Prefers using single quotes for strings. + prefer_single_quotes: true + # This is right: + # 'string' + # This is wrong: + # "string" + + # Prefers typing uninitialized variables. + prefer_typing_uninitialized_variables: true + # This is right: + # String? value; + # This is wrong: + # var value; + + # Encourages the use of mixins to share code between classes. + prefer_mixin: true + # This is right: + # mixin MyMixin { + # void doSomething() {} + # } + # This is wrong: + # abstract class MyMixin { + # void doSomething(); + # } + + # Ensures that unnamed constructors are sorted before named ones. + sort_unnamed_constructors_first: true + # This is right: + # class MyClass { + # MyClass(); + # MyClass.named(); + # } + # This is wrong: + # class MyClass { + # MyClass.named(); + # MyClass(); + # } + + # Prefers using /// for doc comments instead of /* */. + slash_for_doc_comments: true + # This is right: + # /// This is a doc comment. + # void myMethod() {} + # This is wrong: + # /* This is a doc comment. */ + # void myMethod() {} + + # Ensures test types in equals method. test_types_in_equals: true + # This is right: + # @override + # bool operator ==(Object other) { + # return other is MyClass && other.value == value; + # } + # This is wrong: + # @override + # bool operator ==(Object other) { + # return other.value == value; + # } + + # Ensures throw statements are in finally blocks. throw_in_finally: true + # This is right: + # try {} finally { + # if (error) throw Exception(); + # } + # This is wrong: + # try {} finally { + # throw Exception(); + # } + + # Prefers type annotations in initial formal parameters. + type_init_formals: true + # This is right: + # class MyClass { + # MyClass(int this.value); + # final int value; + # } + # This is wrong: + # class MyClass { + # MyClass(this.value); + # final value; + # } + + # Ensures futures are awaited. unawaited_futures: true - unnecessary_breaks: true - unnecessary_statements: true - use_super_parameters: true + # This is right: + # await future; + # This is wrong: + # future; + + # Avoids unnecessary braces in string interpolations. + unnecessary_brace_in_string_interps: true + # This is right: + # 'value: $value' + # This is wrong: + # 'value: ${value}' + + # Prevents unnecessary getters and setters. + unnecessary_getters_setters: true + # This is right: + # class MyClass { + # int value; + # } + # This is wrong: + # class MyClass { + # int _value; + # int get value => _value; + # set value(int value) => _value = value; + # } + + # Avoids unnecessary lambda expressions. + unnecessary_lambdas: true + # This is right: + # list.forEach(print); + # This is wrong: + # list.forEach((value) => print(value)); + + # Avoids unnecessary uses of this keyword. + unnecessary_this: true + # This is right: + # value = 1; + # This is wrong: + # this.value = 1; + + # Prefers using function type syntax for parameters. + use_function_type_syntax_for_parameters: true + # This is right: + # void Function() callback; + # This is wrong: + # Function() callback; + + # Prefers rethrowing exceptions when possible. + use_rethrow_when_possible: true + # This is right: + # try {} catch (e) { + # rethrow; + # } + # This is wrong: + # try {} catch (e) { + # throw e; + # } + + # Prefers using setters for property changes. + use_setters_to_change_properties: true + # This is right: + # set value(int newValue) { + # _value = newValue; + # } + # This is wrong: + # void changeValue(int newValue) { + # _value = newValue; + # } + + # Prevents unnecessary await in return statements. + unnecessary_await_in_return: true + # This is right: + # return await future; + # This is wrong: + # return future; + + + # Ensures regex patterns are valid. + valid_regexps: true + # This is right: + # RegExp(r'^[a-z]+$'); + # This is wrong: + # RegExp(r'['); + + # Uncomment below to enable additional lints + # Prevents the use of dynamic calls, which can be error-prone and less performant. + # avoid_dynamic_calls: true + # This is right: + # (myObject as MyClass).myMethod(); + # This is wrong: + # myObject.myMethod(); + + # Requires all properties of a class to be described in diagnostic methods. + # diagnostic_describe_all_properties: true + # This is right: + # @override + # void debugFillProperties(DiagnosticPropertiesBuilder properties) { + # super.debugFillProperties(properties); + # properties.add(IntProperty('value', value)); + # } + # This is wrong: + # @override + # void debugFillProperties(DiagnosticPropertiesBuilder properties) { + # super.debugFillProperties(properties); + # } + + # Ensures consistent ordering of directives, such as imports. + # directives_ordering: true + # This is right: + # import 'dart:async'; + # import 'package:flutter/material.dart'; + # This is wrong: + # import 'package:flutter/material.dart'; + # import 'dart:async'; + + # Enforces documentation for public members in the API. + # public_member_api_docs: true + # This is right: + # /// This is a public method. + # void publicMethod() {} + # This is wrong: + # void publicMethod() {} + + # Ensures dependencies in pubspec.yaml are sorted. + # sort_pub_dependencies: true + # This is right: + # dependencies: + # flutter: + # provider: + # This is wrong: + # dependencies: + # provider: + # flutter: + + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/analysis_defaults/pubspec.yaml b/analysis_defaults/pubspec.yaml index d6160ec4568..9a2849a73d6 100644 --- a/analysis_defaults/pubspec.yaml +++ b/analysis_defaults/pubspec.yaml @@ -3,9 +3,10 @@ description: Analysis defaults for flutter/samples publish_to: none environment: - sdk: ^3.7.0-0 + sdk: '>=3.8.0 <4.0.0' # Latest Dart SDK + flutter: '>=3.32.0' # Latest Flutter SDK # NOTE: Code is not allowed in this package. Do not add more dependencies. # The `flutter_lints` dependency is required for `lib/flutter.yaml`. dependencies: - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 diff --git a/android_splash_screen/lib/main.dart b/android_splash_screen/lib/main.dart index 59a0eb45d0d..ed1bde78f55 100644 --- a/android_splash_screen/lib/main.dart +++ b/android_splash_screen/lib/main.dart @@ -88,7 +88,7 @@ class CustomAppBar extends StatelessWidget { @override Widget build(BuildContext context) { - Widget titleSection = Row( + final Widget titleSection = Row( children: [ Padding( padding: const EdgeInsets.only(left: 12, right: 4), @@ -105,7 +105,7 @@ class CustomAppBar extends StatelessWidget { const Padding( padding: EdgeInsets.only(top: 3), child: Text( - "Super Splash Screen Demo", + 'Super Splash Screen Demo', style: TextStyle(color: Colors.black54, fontSize: 24), ), ), diff --git a/android_splash_screen/pubspec.yaml b/android_splash_screen/pubspec.yaml index 12f2bae4c64..a8373c8ea65 100644 --- a/android_splash_screen/pubspec.yaml +++ b/android_splash_screen/pubspec.yaml @@ -6,7 +6,8 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ^3.7.0-0 + sdk: '>=3.8.0 <4.0.0' # Latest Dart SDK + flutter: '>=3.32.0' # Latest Flutter SDK dependencies: flutter: diff --git a/animations/ios/Flutter/AppFrameworkInfo.plist b/animations/ios/Flutter/AppFrameworkInfo.plist index 9625e105df3..7c569640062 100644 --- a/animations/ios/Flutter/AppFrameworkInfo.plist +++ b/animations/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/animations/ios/Podfile b/animations/ios/Podfile index fdcc671eb34..d97f17e223f 100644 --- a/animations/ios/Podfile +++ b/animations/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '11.0' +# platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/animations/ios/Runner.xcodeproj/project.pbxproj b/animations/ios/Runner.xcodeproj/project.pbxproj index 7af098398ad..b71c82bf63b 100644 --- a/animations/ios/Runner.xcodeproj/project.pbxproj +++ b/animations/ios/Runner.xcodeproj/project.pbxproj @@ -7,13 +7,15 @@ objects = { /* Begin PBXBuildFile section */ + 0987159C3E721111EE4E4C95 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72551BBA0467F4C35D54517A /* Pods_Runner.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + C8E1565597921695838BFE9C /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C669088641F3A310B963131A /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -40,9 +42,15 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 03FF90A3049BE8430FA8355A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 04CFBB0DE90700EE244CDDF9 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 383D3E3048AB9B883531FF9A /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 72551BBA0467F4C35D54517A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -53,8 +61,10 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + B6FEB113F93BA17A486DE0AB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + B9541A50AC5245F981FC6D42 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + C669088641F3A310B963131A /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CFDCEFF2483AEF3451D05DF0 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,21 +72,28 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 0987159C3E721111EE4E4C95 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B40F60FCC717C49D3621B207 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C8E1565597921695838BFE9C /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 9740EEB11CF90186004384FC /* Flutter */ = { + 2395A5C9EA24597BC5EBDC12 /* Frameworks */ = { isa = PBXGroup; children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, + 72551BBA0467F4C35D54517A /* Pods_Runner.framework */, + C669088641F3A310B963131A /* Pods_RunnerTests.framework */, ); - name = Flutter; + name = Frameworks; sourceTree = ""; }; 331C8082294A63A400263BE5 /* RunnerTests */ = { @@ -87,6 +104,17 @@ path = RunnerTests; sourceTree = ""; }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( @@ -94,6 +122,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, + D39C603021AA45D9ABF484F7 /* Pods */, + 2395A5C9EA24597BC5EBDC12 /* Frameworks */, ); sourceTree = ""; }; @@ -121,6 +151,20 @@ path = Runner; sourceTree = ""; }; + D39C603021AA45D9ABF484F7 /* Pods */ = { + isa = PBXGroup; + children = ( + 04CFBB0DE90700EE244CDDF9 /* Pods-Runner.debug.xcconfig */, + B6FEB113F93BA17A486DE0AB /* Pods-Runner.release.xcconfig */, + 03FF90A3049BE8430FA8355A /* Pods-Runner.profile.xcconfig */, + CFDCEFF2483AEF3451D05DF0 /* Pods-RunnerTests.debug.xcconfig */, + 383D3E3048AB9B883531FF9A /* Pods-RunnerTests.release.xcconfig */, + B9541A50AC5245F981FC6D42 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -128,9 +172,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + 5D800DF22429BB623C22F552 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, - 331C807E294A63A400263BE5 /* Frameworks */, 331C807F294A63A400263BE5 /* Resources */, + B40F60FCC717C49D3621B207 /* Frameworks */, ); buildRules = ( ); @@ -146,6 +191,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + B1416C4552DF4B71507BC252 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -169,7 +215,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -239,6 +285,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 5D800DF22429BB623C22F552 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -254,6 +322,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + B1416C4552DF4B71507BC252 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -345,7 +435,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -377,7 +467,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = CFDCEFF2483AEF3451D05DF0 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -395,7 +485,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = 383D3E3048AB9B883531FF9A /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -411,7 +501,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = B9541A50AC5245F981FC6D42 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -472,7 +562,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -521,7 +611,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/animations/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/animations/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 87131a09bea..e3773d42e24 100644 --- a/animations/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/animations/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ diff --git a/animations/ios/Runner.xcworkspace/contents.xcworkspacedata b/animations/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16ed0..21a3cc14c74 100644 --- a/animations/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/animations/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/animations/ios/Runner/AppDelegate.swift b/animations/ios/Runner/AppDelegate.swift index 70693e4a8c1..b6363034812 100644 --- a/animations/ios/Runner/AppDelegate.swift +++ b/animations/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/animations/lib/src/basics/animated_container.dart b/animations/lib/src/basics/animated_container.dart index 7a772a9fad9..404b381bb3e 100644 --- a/animations/lib/src/basics/animated_container.dart +++ b/animations/lib/src/basics/animated_container.dart @@ -69,8 +69,8 @@ class _AnimatedContainerDemoState extends State { ), ), ElevatedButton( + onPressed: change, child: const Text('change'), - onPressed: () => change(), ), ], ), diff --git a/animations/lib/src/basics/custom_tween.dart b/animations/lib/src/basics/custom_tween.dart index a8e1930a177..e4154e1e99d 100644 --- a/animations/lib/src/basics/custom_tween.dart +++ b/animations/lib/src/basics/custom_tween.dart @@ -10,7 +10,7 @@ class TypewriterTween extends Tween { @override String lerp(double t) { - var cutoff = (end!.length * t).round(); + final cutoff = (end!.length * t).round(); return end!.substring(0, cutoff); } } diff --git a/animations/lib/src/basics/page_route_builder.dart b/animations/lib/src/basics/page_route_builder.dart index f9b474a41f0..7890728d90c 100644 --- a/animations/lib/src/basics/page_route_builder.dart +++ b/animations/lib/src/basics/page_route_builder.dart @@ -28,11 +28,11 @@ Route _createRoute() { return PageRouteBuilder( pageBuilder: (context, animation, secondaryAnimation) => _Page2(), transitionsBuilder: (context, animation, secondaryAnimation, child) { - var tween = Tween( + final tween = Tween( begin: const Offset(0.0, 1.0), end: Offset.zero, ); - var curveTween = CurveTween(curve: Curves.ease); + final curveTween = CurveTween(curve: Curves.ease); return SlideTransition( position: animation.drive(curveTween).drive(tween), diff --git a/animations/lib/src/misc/animated_list.dart b/animations/lib/src/misc/animated_list.dart index 0971959c6e2..6c1a7df0779 100644 --- a/animations/lib/src/misc/animated_list.dart +++ b/animations/lib/src/misc/animated_list.dart @@ -25,7 +25,7 @@ class _AnimatedListDemoState extends State { void addUser() { setState(() { - var index = listData.length; + final index = listData.length; listData.add(UserModel(++_maxIdValue, 'New', 'Person')); _listKey.currentState!.insertItem( index, @@ -37,7 +37,7 @@ class _AnimatedListDemoState extends State { void deleteUser(int id) { setState(() { final index = listData.indexWhere((u) => u.id == id); - var user = listData.removeAt(index); + final user = listData.removeAt(index); _listKey.currentState!.removeItem(index, (context, animation) { return FadeTransition( opacity: CurvedAnimation( diff --git a/animations/lib/src/misc/card_swipe.dart b/animations/lib/src/misc/card_swipe.dart index 7458c983c76..33e2f45f6e4 100644 --- a/animations/lib/src/misc/card_swipe.dart +++ b/animations/lib/src/misc/card_swipe.dart @@ -59,9 +59,7 @@ class _CardSwipeDemoState extends State { ElevatedButton( child: const Text('Refill'), onPressed: () { - setState(() { - _resetCards(); - }); + setState(_resetCards); }, ), ], @@ -145,7 +143,7 @@ class _SwipeableCardState extends State /// Changes the animation to animate to the left or right depending on the /// swipe, and sets the AnimationController's value to the swiped amount. void _dragUpdate(DragUpdateDetails details) { - var isSwipingLeft = (details.localPosition.dx - _dragStartX) < 0; + final isSwipingLeft = (details.localPosition.dx - _dragStartX) < 0; if (isSwipingLeft != _isSwipingLeft) { _isSwipingLeft = isSwipingLeft; _updateAnimation(details.localPosition.dx); @@ -174,7 +172,7 @@ class _SwipeableCardState extends State return; } - var velocity = (details.velocity.pixelsPerSecond.dx / size.width).abs(); + final velocity = (details.velocity.pixelsPerSecond.dx / size.width).abs(); _animate(velocity: velocity); } @@ -188,12 +186,12 @@ class _SwipeableCardState extends State } void _animate({double velocity = 0}) { - var description = const SpringDescription( + const description = SpringDescription( mass: 50, stiffness: 1, damping: 1, ); - var simulation = SpringSimulation( + final simulation = SpringSimulation( description, _controller.value, 1, diff --git a/animations/lib/src/misc/carousel.dart b/animations/lib/src/misc/carousel.dart index c2f2b2974ef..55e6705b0f9 100644 --- a/animations/lib/src/misc/carousel.dart +++ b/animations/lib/src/misc/carousel.dart @@ -67,7 +67,7 @@ class _CarouselState extends State { @override Widget build(context) { - var size = MediaQuery.of(context).size; + final size = MediaQuery.of(context).size; return PageView.builder( onPageChanged: (value) { setState(() { @@ -83,7 +83,7 @@ class _CarouselState extends State { (context, index) => AnimatedBuilder( animation: _controller, builder: (context, child) { - var result = + final result = _pageHasChanged ? _controller.page! : _currentPage * 1.0; // The horizontal position of the page between a 1 and 0 diff --git a/animations/lib/src/misc/expand_card.dart b/animations/lib/src/misc/expand_card.dart index c47829d4c17..34f65a5cc3b 100644 --- a/animations/lib/src/misc/expand_card.dart +++ b/animations/lib/src/misc/expand_card.dart @@ -39,7 +39,7 @@ class _ExpandCardState extends State @override Widget build(context) { return GestureDetector( - onTap: () => toggleExpanded(), + onTap: toggleExpanded, child: Card( child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/animations/lib/src/misc/flutter_animate.dart b/animations/lib/src/misc/flutter_animate.dart index 88de877c69d..f6e66c70fc9 100644 --- a/animations/lib/src/misc/flutter_animate.dart +++ b/animations/lib/src/misc/flutter_animate.dart @@ -19,7 +19,7 @@ class FlutterAnimateDemo extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(16), child: Text( - "Hello Flutter Animate", + 'Hello Flutter Animate', style: Theme.of(context).textTheme.headlineLarge, ) .animate(onPlay: (controller) => controller.repeat()) diff --git a/animations/lib/src/misc/focus_image.dart b/animations/lib/src/misc/focus_image.dart index 7031129cdf1..f7416ac0791 100644 --- a/animations/lib/src/misc/focus_image.dart +++ b/animations/lib/src/misc/focus_image.dart @@ -45,7 +45,7 @@ Route _createRoute(BuildContext parentContext, String image) { return _SecondPage(image); }, transitionsBuilder: (context, animation, secondaryAnimation, child) { - var rectAnimation = _createTween( + final rectAnimation = _createTween( parentContext, ).chain(CurveTween(curve: Curves.ease)).animate(animation); @@ -57,10 +57,10 @@ Route _createRoute(BuildContext parentContext, String image) { } Tween _createTween(BuildContext context) { - var windowSize = MediaQuery.of(context).size; - var box = context.findRenderObject() as RenderBox; - var rect = box.localToGlobal(Offset.zero) & box.size; - var relativeRect = RelativeRect.fromSize(rect, windowSize); + final windowSize = MediaQuery.of(context).size; + final box = context.findRenderObject()! as RenderBox; + final rect = box.localToGlobal(Offset.zero) & box.size; + final relativeRect = RelativeRect.fromSize(rect, windowSize); return RelativeRectTween(begin: relativeRect, end: RelativeRect.fill); } @@ -75,7 +75,7 @@ class SmallCard extends StatelessWidget { child: Material( child: InkWell( onTap: () { - var nav = Navigator.of(context); + final nav = Navigator.of(context); nav.push(_createRoute(context, imageAssetName)); }, child: Image.asset(imageAssetName, fit: BoxFit.cover), diff --git a/animations/pubspec.yaml b/animations/pubspec.yaml index 10083e84924..6dedeb8e867 100644 --- a/animations/pubspec.yaml +++ b/animations/pubspec.yaml @@ -4,13 +4,14 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ^3.7.0-0 + sdk: '>=3.8.0 <4.0.0' # Latest Dart SDK + flutter: '>=3.32.0' # Latest Flutter SDK dependencies: flutter: sdk: flutter - flutter_animate: ^4.1.0 - go_router: ^15.0.0 + flutter_animate: ^4.5.2 + go_router: ^16.0.0 window_size: # plugin is not yet part of the flutter framework git: url: https://github.com/google/flutter-desktop-embedding.git diff --git a/animations/test/basics/animated_builder_test.dart b/animations/test/basics/animated_builder_test.dart index bdab93511d6..1f1cbc78e15 100644 --- a/animations/test/basics/animated_builder_test.dart +++ b/animations/test/basics/animated_builder_test.dart @@ -16,7 +16,7 @@ void main() { // Get the initial color of the button. ElevatedButton button = tester.widget(find.byType(ElevatedButton)); - WidgetStateProperty? initialColor = button.style!.backgroundColor; + final WidgetStateProperty? initialColor = button.style!.backgroundColor; // Tap the button. await tester.tap(find.byType(ElevatedButton)); @@ -24,7 +24,7 @@ void main() { // Get the updated color of the button. button = tester.widget(find.byType(ElevatedButton)); - WidgetStateProperty? updatedColor = button.style!.backgroundColor; + final WidgetStateProperty? updatedColor = button.style!.backgroundColor; // Check if the color has changed. expect(initialColor, isNot(updatedColor)); @@ -35,7 +35,7 @@ void main() { // Get the initial color of the button. ElevatedButton button = tester.widget(find.byType(ElevatedButton)); - WidgetStateProperty? initialColor = button.style!.backgroundColor; + final WidgetStateProperty? initialColor = button.style!.backgroundColor; // Tap the button to trigger the animation but don't wait for it to finish. await tester.tap(find.byType(ElevatedButton)); @@ -44,7 +44,7 @@ void main() { // Check that the color has changed but not to the final color. button = tester.widget(find.byType(ElevatedButton)); - WidgetStateProperty? changedColor = button.style!.backgroundColor; + final WidgetStateProperty? changedColor = button.style!.backgroundColor; expect(initialColor, isNot(changedColor)); // Wait for the animation to finish. @@ -52,7 +52,7 @@ void main() { // Check that the color has changed to the final color. button = tester.widget(find.byType(ElevatedButton)); - WidgetStateProperty? finalColor = button.style!.backgroundColor; + final WidgetStateProperty? finalColor = button.style!.backgroundColor; expect(changedColor, isNot(finalColor)); }); }); diff --git a/animations/test/misc/animated_list_test.dart b/animations/test/misc/animated_list_test.dart index bc03fca9996..01b36a33c5b 100644 --- a/animations/test/misc/animated_list_test.dart +++ b/animations/test/misc/animated_list_test.dart @@ -15,7 +15,7 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester.widgetList(find.byType(ListTile)).length; + final initialLength = tester.widgetList(find.byType(ListTile)).length; // Initial length of list should be equal to 5. expect(initialLength, equals(5)); @@ -27,14 +27,14 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester.widgetList(find.byType(ListTile)).length; + final initialLength = tester.widgetList(find.byType(ListTile)).length; // Tap on the Add Icon Button. await tester.tap(find.byIcon(Icons.add)); await tester.pumpAndSettle(); // Get the new length of list. - var newLength = tester.widgetList(find.byType(ListTile)).length; + final newLength = tester.widgetList(find.byType(ListTile)).length; // New length should be greater than initial length by one. expect(newLength, equals(initialLength + 1)); @@ -46,14 +46,14 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester.widgetList(find.byType(ListTile)).length; + final initialLength = tester.widgetList(find.byType(ListTile)).length; // Tap on the Delete Icon Button at middle index. await tester.tap(find.byIcon(Icons.delete).at(initialLength ~/ 2)); await tester.pumpAndSettle(); // Get the new length of list. - var newLength = tester.widgetList(find.byType(ListTile)).length; + final newLength = tester.widgetList(find.byType(ListTile)).length; // New length should be less than initial length by one. expect(newLength, equals(initialLength - 1)); @@ -66,14 +66,14 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester.widgetList(find.byType(ListTile)).length; + final initialLength = tester.widgetList(find.byType(ListTile)).length; // Tap on the Delete Icon Button at start index. await tester.tap(find.byIcon(Icons.delete).at(0)); await tester.pumpAndSettle(); // Get the new length of list. - var newLength = tester.widgetList(find.byType(ListTile)).length; + final newLength = tester.widgetList(find.byType(ListTile)).length; // New length should be less than initial length by one. expect(newLength, equals(initialLength - 1)); @@ -86,14 +86,14 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester.widgetList(find.byType(ListTile)).length; + final initialLength = tester.widgetList(find.byType(ListTile)).length; // Tap on the Delete Icon Button at end index. await tester.tap(find.byIcon(Icons.delete).at(initialLength - 1)); await tester.pumpAndSettle(); // Get the new length of list. - var newLength = tester.widgetList(find.byType(ListTile)).length; + final newLength = tester.widgetList(find.byType(ListTile)).length; // New Length should be less than initial length by one. expect(newLength, equals(initialLength - 1)); @@ -104,7 +104,7 @@ void main() { await tester.pumpWidget(createAnimatedListDemoScreen()); // Get the initial length of list. - var initialLength = tester.widgetList(find.byType(ListTile)).length; + final initialLength = tester.widgetList(find.byType(ListTile)).length; // Iterating over all the Delete Icon Buttons. for (var i = 0; i < initialLength; i++) { @@ -114,7 +114,7 @@ void main() { } // Get the final length of list. - var finalLength = tester.widgetList(find.byType(ListTile)).length; + final finalLength = tester.widgetList(find.byType(ListTile)).length; // New length should be zero. expect(finalLength, equals(0)); diff --git a/animations/test/misc/animated_positioned_test.dart b/animations/test/misc/animated_positioned_test.dart index 69bbc305055..6518fd4f7ea 100644 --- a/animations/test/misc/animated_positioned_test.dart +++ b/animations/test/misc/animated_positioned_test.dart @@ -14,10 +14,10 @@ void main() { testWidgets('Position of Button Changes on Tap', (tester) async { await tester.pumpWidget(createAnimatedPositionedDemoScreen()); - var button = find.byType(InkWell); + final button = find.byType(InkWell); // Get initial position of the widget. - var initialPosition = tester.getTopLeft(button); + final initialPosition = tester.getTopLeft(button); expect(initialPosition, isNotNull); // Tap on the widget. @@ -25,7 +25,7 @@ void main() { await tester.pumpAndSettle(); // The new position should not be equal to initial position. - var newPosition = tester.getTopLeft(button); + final newPosition = tester.getTopLeft(button); expect(newPosition, isNot(offsetMoreOrLessEquals(initialPosition))); }); }); diff --git a/animations/test/misc/card_swipe_test.dart b/animations/test/misc/card_swipe_test.dart index 85536c0210d..7fdd4974359 100644 --- a/animations/test/misc/card_swipe_test.dart +++ b/animations/test/misc/card_swipe_test.dart @@ -14,7 +14,7 @@ void main() { await tester.pumpWidget(createCardSwipeScreen()); // Get the total number of cards available. - var totalCards = tester.widgetList(find.byType(Card)).length; + final totalCards = tester.widgetList(find.byType(Card)).length; // Ensure card is visible. await tester.ensureVisible(find.byType(Card).last); @@ -31,7 +31,7 @@ void main() { await tester.pumpWidget(createCardSwipeScreen()); // Get the total number of cards availabe. - var totalCards = tester.widgetList(find.byType(Card)).length; + final totalCards = tester.widgetList(find.byType(Card)).length; // Swipe out all cards. for (var i = 0; i < totalCards; i++) { @@ -48,7 +48,7 @@ void main() { await tester.pumpWidget(createCardSwipeScreen()); // Get the total number of cards availabe. - var totalCards = tester.widgetList(find.byType(Card)).length; + final totalCards = tester.widgetList(find.byType(Card)).length; // Swipe out one card. await tester.drag(find.byType(Card).last, const Offset(100.0, 0.0)); diff --git a/animations/test/misc/expand_card_test.dart b/animations/test/misc/expand_card_test.dart index d37ab0ae9d4..6acb82286ad 100644 --- a/animations/test/misc/expand_card_test.dart +++ b/animations/test/misc/expand_card_test.dart @@ -14,7 +14,7 @@ void main() { await tester.pumpWidget(createExpandCardScreen()); // Get the initial size of ExpandCard. - var initialSize = tester.getSize(find.byType(ExpandCard)); + final initialSize = tester.getSize(find.byType(ExpandCard)); // Tap on the ExpandCard. await tester.tap(find.byType(ExpandCard)); @@ -28,7 +28,7 @@ void main() { testWidgets('ExpandCard changes image on tap', (tester) async { await tester.pumpWidget(createExpandCardScreen()); - var initialImage = tester.widget(find.byType(Image).last); + final initialImage = tester.widget(find.byType(Image).last); // Tap on ExpandCard. await tester.tap(find.byType(ExpandCard)); diff --git a/animations/test/misc/focus_image_test.dart b/animations/test/misc/focus_image_test.dart index a65fc9e02cf..3af15fbde1f 100644 --- a/animations/test/misc/focus_image_test.dart +++ b/animations/test/misc/focus_image_test.dart @@ -17,7 +17,7 @@ void main() { final initialInkwell = tester.widget(find.byType(InkWell).at(0)); // Get the size of initial inkwell. - var initialSize = tester.getSize(find.byWidget(initialInkwell)); + final initialSize = tester.getSize(find.byWidget(initialInkwell)); // Tap on the ink well at index 0. await tester.tap(find.byType(InkWell).at(0)); @@ -27,7 +27,7 @@ void main() { final finalInkwell = tester.widget(find.byType(InkWell).at(0)); // Get the size of final inkwell. - var finalSize = tester.getSize(find.byWidget(finalInkwell)); + final finalSize = tester.getSize(find.byWidget(finalInkwell)); // Final size should be greater than initial size. expect(finalSize, greaterThan(initialSize)); diff --git a/animations/test/misc/hero_animation_test.dart b/animations/test/misc/hero_animation_test.dart index c006cdddd65..e5799d7ba06 100644 --- a/animations/test/misc/hero_animation_test.dart +++ b/animations/test/misc/hero_animation_test.dart @@ -15,20 +15,20 @@ void main() { await tester.pumpWidget(createHeroAnimationDemoScreen()); // Get the initial Container. - var initialContainer = tester.firstWidget(find.byType(Container)); + final initialContainer = tester.firstWidget(find.byType(Container)); // Get the size of initial Container. - var initialSize = tester.getSize(find.byWidget(initialContainer)); + final initialSize = tester.getSize(find.byWidget(initialContainer)); // Tap on the Gesture Detector. await tester.tap(find.byType(GestureDetector)); await tester.pumpAndSettle(); // Get the final Container. - var finalContainer = tester.firstWidget(find.byType(Container)); + final finalContainer = tester.firstWidget(find.byType(Container)); // Get the size of final Container. - var finalSize = tester.getSize(find.byWidget(finalContainer)); + final finalSize = tester.getSize(find.byWidget(finalContainer)); // initialSize should be less than finalSize. expect(initialSize, lessThan(finalSize)); @@ -43,7 +43,7 @@ void main() { // Initial color should be Color.grey[300]. expect( - (initialContainer.decoration as BoxDecoration).color, + (initialContainer.decoration! as BoxDecoration).color, Colors.grey[300], ); @@ -57,8 +57,8 @@ void main() { // Final color should not be same as initial color. expect( - (finalContainer.decoration as BoxDecoration).color, - isNot(equals((initialContainer.decoration as BoxDecoration).color)), + (finalContainer.decoration! as BoxDecoration).color, + isNot(equals((initialContainer.decoration! as BoxDecoration).color)), ); }); diff --git a/asset_transformation/.gitignore b/asset_transformation/.gitignore index 29a3a5017f0..79c113f9b50 100644 --- a/asset_transformation/.gitignore +++ b/asset_transformation/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/asset_transformation/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/asset_transformation/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5dfe19..e3773d42e24 100644 --- a/asset_transformation/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/asset_transformation/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/asset_transformation/pubspec.yaml b/asset_transformation/pubspec.yaml index ef57e2379b8..56f1b17d9bc 100644 --- a/asset_transformation/pubspec.yaml +++ b/asset_transformation/pubspec.yaml @@ -4,18 +4,19 @@ publish_to: 'none' version: 0.1.0 environment: - sdk: ^3.7.0-0 + sdk: '>=3.8.0 <4.0.0' # Latest Dart SDK + flutter: '>=3.32.0' # Latest Flutter SDK dependencies: flutter: sdk: flutter - vector_graphics: ^1.1.11+1 + vector_graphics: ^1.1.19 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 - vector_graphics_compiler: ^1.1.11+1 + flutter_lints: ^6.0.0 + vector_graphics_compiler: ^1.1.17 grayscale_transformer: path: ./grayscale_transformer