diff --git a/.github/workflows/.env b/.github/workflows/.env index 4fde6ed..924d0ee 100644 --- a/.github/workflows/.env +++ b/.github/workflows/.env @@ -1 +1 @@ -FLUTTER_VERSION=3.3.7 +FLUTTER_VERSION=3.10.6 diff --git a/.github/workflows/test-flutter.yaml b/.github/workflows/test-flutter.yaml index 2e36c43..f3605be 100644 --- a/.github/workflows/test-flutter.yaml +++ b/.github/workflows/test-flutter.yaml @@ -35,7 +35,7 @@ jobs: run: flutter packages get - name: Format - run: flutter format --set-exit-if-changed lib test + run: dart format --set-exit-if-changed lib test - name: Analyze run: flutter analyze lib test diff --git a/CHANGELOG.md b/CHANGELOG.md index a361c21..7ae67e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.0 + +* fix: add support for flutter >=3.10.0 +* fix: add support for dart >=3.0.5 + ## 0.3.2 * feat: add the `loadFontsFromPackage` method to load fonts from a package which name does not match the corresponding folder name diff --git a/example/multi_packages_app/app/pubspec.lock b/example/multi_packages_app/app/pubspec.lock index 378e905..b937b90 100644 --- a/example/multi_packages_app/app/pubspec.lock +++ b/example/multi_packages_app/app/pubspec.lock @@ -7,70 +7,79 @@ packages: path: "../../.." relative: true source: path - version: "0.3.2" + version: "0.4.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" equatable: dependency: transitive description: name: equatable - url: "https://pub.dartlang.org" + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" source: hosted version: "2.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -80,7 +89,8 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted version: "2.0.1" flutter_test: @@ -88,34 +98,46 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5cfd6509652ff5e7fe149b6df4859e687fca9048437857cb2e65c8d780f396e3" + url: "https://pub.dev" source: hosted version: "2.0.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" multi_packages_example_theme: dependency: "direct main" description: @@ -127,21 +149,24 @@ packages: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted version: "3.1.0" recase: dependency: transitive description: name: recase - url: "https://pub.dartlang.org" + sha256: "7aec9b9f498cba65ed969eda51ea3d86a77bbd633d876b57d9db7d9f94fc6ca5" + url: "https://pub.dev" source: hosted version: "4.0.0" sky_engine: @@ -153,51 +178,58 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.5.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" sdks: - dart: ">=2.17.6 <3.0.0" + dart: ">=3.0.5 <4.0.0" flutter: ">=1.17.0" diff --git a/example/multi_packages_app/app/pubspec.yaml b/example/multi_packages_app/app/pubspec.yaml index b1ab537..c560dc8 100644 --- a/example/multi_packages_app/app/pubspec.yaml +++ b/example/multi_packages_app/app/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.17.5 <3.0.0" + sdk: '>=3.0.5 <4.0.0' dependencies: flutter: diff --git a/example/multi_packages_app/app/test/flutter_test_config.dart b/example/multi_packages_app/app/test/flutter_test_config.dart index ddca81d..9ce95f9 100644 --- a/example/multi_packages_app/app/test/flutter_test_config.dart +++ b/example/multi_packages_app/app/test/flutter_test_config.dart @@ -23,6 +23,7 @@ Future testExecutable(FutureOr Function() testMain) async { relativePath: '../theme', ), ); - setupFileComparatorWithThreshold(); + const m1IntelDifferenceThreshold = 0.2 / 100; // 0.2% + setupFileComparatorWithThreshold(m1IntelDifferenceThreshold); await testMain(); } diff --git a/example/multi_packages_app/app/test/src/preview/desktop:app_multi_packages_with_keyboard.png b/example/multi_packages_app/app/test/src/preview/desktop:app_multi_packages_with_keyboard.png index 78afb51..54c45dc 100644 Binary files a/example/multi_packages_app/app/test/src/preview/desktop:app_multi_packages_with_keyboard.png and b/example/multi_packages_app/app/test/src/preview/desktop:app_multi_packages_with_keyboard.png differ diff --git a/example/multi_packages_app/app/test/src/preview/iPadPro:app_multi_packages.png b/example/multi_packages_app/app/test/src/preview/iPadPro:app_multi_packages.png index ce176dc..82a1992 100644 Binary files a/example/multi_packages_app/app/test/src/preview/iPadPro:app_multi_packages.png and b/example/multi_packages_app/app/test/src/preview/iPadPro:app_multi_packages.png differ diff --git a/example/multi_packages_app/app/test/src/preview/iPadPro:app_multi_packages_with_keyboard.png b/example/multi_packages_app/app/test/src/preview/iPadPro:app_multi_packages_with_keyboard.png index 5d7886e..1c8bccb 100644 Binary files a/example/multi_packages_app/app/test/src/preview/iPadPro:app_multi_packages_with_keyboard.png and b/example/multi_packages_app/app/test/src/preview/iPadPro:app_multi_packages_with_keyboard.png differ diff --git a/example/multi_packages_app/app/test/src/preview/iPhone_13:app_multi_packages.png b/example/multi_packages_app/app/test/src/preview/iPhone_13:app_multi_packages.png index 4a5c73b..af153a1 100644 Binary files a/example/multi_packages_app/app/test/src/preview/iPhone_13:app_multi_packages.png and b/example/multi_packages_app/app/test/src/preview/iPhone_13:app_multi_packages.png differ diff --git a/example/multi_packages_app/app/test/src/preview/iPhone_13:app_multi_packages_with_keyboard.png b/example/multi_packages_app/app/test/src/preview/iPhone_13:app_multi_packages_with_keyboard.png index c16b292..0aa6b54 100644 Binary files a/example/multi_packages_app/app/test/src/preview/iPhone_13:app_multi_packages_with_keyboard.png and b/example/multi_packages_app/app/test/src/preview/iPhone_13:app_multi_packages_with_keyboard.png differ diff --git a/example/multi_packages_app/app/test/src/preview/iPhone_8:app_multi_packages_with_keyboard.png b/example/multi_packages_app/app/test/src/preview/iPhone_8:app_multi_packages_with_keyboard.png index 7a7a4c9..fac5eb4 100644 Binary files a/example/multi_packages_app/app/test/src/preview/iPhone_8:app_multi_packages_with_keyboard.png and b/example/multi_packages_app/app/test/src/preview/iPhone_8:app_multi_packages_with_keyboard.png differ diff --git a/example/multi_packages_app/app/test/src/preview/pixel_5:app_multi_packages.png b/example/multi_packages_app/app/test/src/preview/pixel_5:app_multi_packages.png index afa6867..87624e7 100644 Binary files a/example/multi_packages_app/app/test/src/preview/pixel_5:app_multi_packages.png and b/example/multi_packages_app/app/test/src/preview/pixel_5:app_multi_packages.png differ diff --git a/example/multi_packages_app/app/test/src/preview/pixel_5:app_multi_packages_with_keyboard.png b/example/multi_packages_app/app/test/src/preview/pixel_5:app_multi_packages_with_keyboard.png index 9153696..ff3087b 100644 Binary files a/example/multi_packages_app/app/test/src/preview/pixel_5:app_multi_packages_with_keyboard.png and b/example/multi_packages_app/app/test/src/preview/pixel_5:app_multi_packages_with_keyboard.png differ diff --git a/example/multi_packages_app/theme/pubspec.lock b/example/multi_packages_app/theme/pubspec.lock index bdf0e77..6097b67 100644 --- a/example/multi_packages_app/theme/pubspec.lock +++ b/example/multi_packages_app/theme/pubspec.lock @@ -7,70 +7,79 @@ packages: path: "../../.." relative: true source: path - version: "0.3.2" + version: "0.4.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" equatable: dependency: transitive description: name: equatable - url: "https://pub.dartlang.org" + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" source: hosted version: "2.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -80,7 +89,8 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted version: "2.0.1" flutter_test: @@ -88,53 +98,68 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5cfd6509652ff5e7fe149b6df4859e687fca9048437857cb2e65c8d780f396e3" + url: "https://pub.dev" source: hosted version: "2.0.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted version: "3.1.0" recase: dependency: transitive description: name: recase - url: "https://pub.dartlang.org" + sha256: "7aec9b9f498cba65ed969eda51ea3d86a77bbd633d876b57d9db7d9f94fc6ca5" + url: "https://pub.dev" source: hosted version: "4.0.0" sky_engine: @@ -146,51 +171,58 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.5.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" sdks: - dart: ">=2.17.6 <3.0.0" + dart: ">=3.0.5 <4.0.0" flutter: ">=1.17.0" diff --git a/example/multi_packages_app/theme/pubspec.yaml b/example/multi_packages_app/theme/pubspec.yaml index 99465c8..8da2f59 100644 --- a/example/multi_packages_app/theme/pubspec.yaml +++ b/example/multi_packages_app/theme/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.17.5 <3.0.0" + sdk: '>=3.0.5 <4.0.0' dependencies: flutter: diff --git a/example/multi_packages_app/theme/test/flutter_test_config.dart b/example/multi_packages_app/theme/test/flutter_test_config.dart index df5a246..9496d6f 100644 --- a/example/multi_packages_app/theme/test/flutter_test_config.dart +++ b/example/multi_packages_app/theme/test/flutter_test_config.dart @@ -18,6 +18,7 @@ Future testExecutable(FutureOr Function() testMain) async { ..setEnforcedTestPlatform(TargetPlatform.macOS) ..setDeviceVariants(defaultDeviceConfigs); await loadFonts(); - setupFileComparatorWithThreshold(); + const m1IntelDifferenceThreshold = 0.2 / 100; // 0.2% + setupFileComparatorWithThreshold(m1IntelDifferenceThreshold); await testMain(); } diff --git a/example/simple_app/pubspec.lock b/example/simple_app/pubspec.lock index 7b34d13..7a36f54 100644 --- a/example/simple_app/pubspec.lock +++ b/example/simple_app/pubspec.lock @@ -7,70 +7,79 @@ packages: path: "../.." relative: true source: path - version: "0.3.1" + version: "0.4.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" equatable: dependency: transitive description: name: equatable - url: "https://pub.dartlang.org" + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" source: hosted version: "2.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -80,7 +89,8 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted version: "2.0.1" flutter_test: @@ -88,53 +98,68 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5cfd6509652ff5e7fe149b6df4859e687fca9048437857cb2e65c8d780f396e3" + url: "https://pub.dev" source: hosted version: "2.0.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted version: "3.1.0" recase: dependency: transitive description: name: recase - url: "https://pub.dartlang.org" + sha256: "7aec9b9f498cba65ed969eda51ea3d86a77bbd633d876b57d9db7d9f94fc6ca5" + url: "https://pub.dev" source: hosted version: "4.0.0" sky_engine: @@ -146,51 +171,58 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.5.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" sdks: - dart: ">=2.17.6 <3.0.0" + dart: ">=3.0.5 <4.0.0" flutter: ">=1.17.0" diff --git a/example/simple_app/pubspec.yaml b/example/simple_app/pubspec.yaml index c13b343..0fd45fe 100644 --- a/example/simple_app/pubspec.yaml +++ b/example/simple_app/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.17.5 <3.0.0" + sdk: '>=3.0.5 <4.0.0' dependencies: flutter: diff --git a/example/simple_app/test/flutter_test_config.dart b/example/simple_app/test/flutter_test_config.dart index df5a246..9496d6f 100644 --- a/example/simple_app/test/flutter_test_config.dart +++ b/example/simple_app/test/flutter_test_config.dart @@ -18,6 +18,7 @@ Future testExecutable(FutureOr Function() testMain) async { ..setEnforcedTestPlatform(TargetPlatform.macOS) ..setDeviceVariants(defaultDeviceConfigs); await loadFonts(); - setupFileComparatorWithThreshold(); + const m1IntelDifferenceThreshold = 0.2 / 100; // 0.2% + setupFileComparatorWithThreshold(m1IntelDifferenceThreshold); await testMain(); } diff --git a/example/simple_app/test/src/preview/desktop:app_simple_with_keyboard.png b/example/simple_app/test/src/preview/desktop:app_simple_with_keyboard.png index 7892793..710eaf9 100644 Binary files a/example/simple_app/test/src/preview/desktop:app_simple_with_keyboard.png and b/example/simple_app/test/src/preview/desktop:app_simple_with_keyboard.png differ diff --git a/example/simple_app/test/src/preview/iPadPro:app_simple.png b/example/simple_app/test/src/preview/iPadPro:app_simple.png index 47c1653..90c6b5c 100644 Binary files a/example/simple_app/test/src/preview/iPadPro:app_simple.png and b/example/simple_app/test/src/preview/iPadPro:app_simple.png differ diff --git a/example/simple_app/test/src/preview/iPadPro:app_simple_with_keyboard.png b/example/simple_app/test/src/preview/iPadPro:app_simple_with_keyboard.png index 60941d1..8d25e9a 100644 Binary files a/example/simple_app/test/src/preview/iPadPro:app_simple_with_keyboard.png and b/example/simple_app/test/src/preview/iPadPro:app_simple_with_keyboard.png differ diff --git a/example/simple_app/test/src/preview/iPhone_13:app_simple.png b/example/simple_app/test/src/preview/iPhone_13:app_simple.png index 0c9ce35..b8de4ed 100644 Binary files a/example/simple_app/test/src/preview/iPhone_13:app_simple.png and b/example/simple_app/test/src/preview/iPhone_13:app_simple.png differ diff --git a/example/simple_app/test/src/preview/iPhone_13:app_simple_with_keyboard.png b/example/simple_app/test/src/preview/iPhone_13:app_simple_with_keyboard.png index a10d005..1af61ed 100644 Binary files a/example/simple_app/test/src/preview/iPhone_13:app_simple_with_keyboard.png and b/example/simple_app/test/src/preview/iPhone_13:app_simple_with_keyboard.png differ diff --git a/example/simple_app/test/src/preview/iPhone_8:app_simple_with_keyboard.png b/example/simple_app/test/src/preview/iPhone_8:app_simple_with_keyboard.png index 1543e6a..527f9e6 100644 Binary files a/example/simple_app/test/src/preview/iPhone_8:app_simple_with_keyboard.png and b/example/simple_app/test/src/preview/iPhone_8:app_simple_with_keyboard.png differ diff --git a/example/simple_app/test/src/preview/pixel_5:app_simple.png b/example/simple_app/test/src/preview/pixel_5:app_simple.png index cd1fe9e..c1e0259 100644 Binary files a/example/simple_app/test/src/preview/pixel_5:app_simple.png and b/example/simple_app/test/src/preview/pixel_5:app_simple.png differ diff --git a/example/simple_app/test/src/preview/pixel_5:app_simple_with_keyboard.png b/example/simple_app/test/src/preview/pixel_5:app_simple_with_keyboard.png index a60f080..56bf096 100644 Binary files a/example/simple_app/test/src/preview/pixel_5:app_simple_with_keyboard.png and b/example/simple_app/test/src/preview/pixel_5:app_simple_with_keyboard.png differ diff --git a/lib/src/adaptive/window_configuration.dart b/lib/src/adaptive/window_configuration.dart index 7acc081..60895a2 100644 --- a/lib/src/adaptive/window_configuration.dart +++ b/lib/src/adaptive/window_configuration.dart @@ -8,29 +8,27 @@ import 'window_size.dart'; extension WidgetTesterWithConfigurableWindow on WidgetTester { /// Configure the tester window to represent the given device variant. void configureWindow(WindowConfigData windowConfig) { - binding.window.physicalSizeTestValue = windowConfig.physicalSize; - binding.window.devicePixelRatioTestValue = windowConfig.pixelDensity; - binding.window.paddingTestValue = windowConfig.padding; - binding.window.viewPaddingTestValue = windowConfig.padding; + view.physicalSize = windowConfig.physicalSize; + view.devicePixelRatio = windowConfig.pixelDensity; + view.padding = windowConfig.padding; + view.viewPadding = windowConfig.padding; - addTearDown(binding.window.clearPaddingTestValue); - addTearDown(binding.window.clearViewPaddingTestValue); - addTearDown(binding.window.clearPhysicalSizeTestValue); - addTearDown( - binding.window.clearDevicePixelRatioTestValue, - ); - addTearDown(binding.window.clearViewInsetsTestValue); + addTearDown(view.resetPadding); + addTearDown(view.resetViewPadding); + addTearDown(view.resetDevicePixelRatio); + addTearDown(view.resetPhysicalSize); + addTearDown(view.resetViewInsets); } /// Configure the tester window to represent an opened keyboard on the given device variant. void configureOpenedKeyboardWindow(WindowConfigData windowConfig) { - binding.window.viewInsetsTestValue = windowConfig.viewInsets; - binding.window.paddingTestValue = windowConfig.padding.copyWith(bottom: 0); + view.viewInsets = windowConfig.viewInsets; + view.padding = windowConfig.padding.copyWith(bottom: 0); } /// Configure the tester window to represent a closed keyboard on the given device variant. void configureClosedKeyboardWindow(WindowConfigData windowConfig) { - binding.window.clearViewInsetsTestValue(); - binding.window.paddingTestValue = windowConfig.padding; + view.resetViewInsets(); + view.padding = windowConfig.padding; } } diff --git a/lib/src/adaptive/window_size.dart b/lib/src/adaptive/window_size.dart index 2fbc226..c4febc2 100644 --- a/lib/src/adaptive/window_size.dart +++ b/lib/src/adaptive/window_size.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:equatable/equatable.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -78,11 +76,11 @@ class WindowConfigData extends Equatable { this.notchSize, this.punchHole, this.homeIndicator, - }) : viewInsets = WindowPaddingImpl( + }) : viewInsets = ViewPaddingImpl( bottom: keyboardSize?.height ?? 0, ) * pixelDensity, - padding = WindowPaddingImpl( + padding = ViewPaddingImpl( bottom: safeAreaPadding.bottom, top: safeAreaPadding.top, ) * @@ -131,13 +129,13 @@ class WindowConfigData extends Equatable { /// This padding describe the size used by an opened keyboard. /// /// expressed in `px`. - final WindowPadding viewInsets; + final FakeViewPadding viewInsets; /// This padding describe the size taken by the hardware layer. /// Like the notch on the iPhone X. /// /// expressed in `px`. - final WindowPadding padding; + final FakeViewPadding padding; /// This represent the size of the device, expressed in `px`. final Size physicalSize; @@ -159,16 +157,16 @@ class WindowConfigData extends Equatable { ]; } -/// Implementation of the abstract class [WindowPadding]. -class WindowPaddingImpl implements WindowPadding { - const WindowPaddingImpl({ +/// Implementation of the abstract class [FakeViewPadding]. +class ViewPaddingImpl implements FakeViewPadding { + const ViewPaddingImpl({ this.bottom = 0, this.top = 0, this.left = 0, this.right = 0, }); - static const WindowPaddingImpl zero = WindowPaddingImpl(); + static const ViewPaddingImpl zero = ViewPaddingImpl(); @override final double bottom; @@ -187,7 +185,7 @@ class WindowPaddingImpl implements WindowPadding { /// Returns a [WindowPaddingImpl] whose dimensions are the dimensions of the /// left-hand-side operand (a [WindowPaddingImpl]) multiplied by the scalar /// right-hand-side operand (a [double]). - WindowPaddingImpl operator *(double operand) => WindowPaddingImpl( + ViewPaddingImpl operator *(double operand) => ViewPaddingImpl( bottom: bottom * operand, top: top * operand, left: left * operand, @@ -195,14 +193,14 @@ class WindowPaddingImpl implements WindowPadding { ); } -extension WindowPaddingX on WindowPadding { - WindowPadding copyWith({ +extension FakeViewPaddingX on FakeViewPadding { + FakeViewPadding copyWith({ double? bottom, double? top, double? left, double? right, }) { - return WindowPaddingImpl( + return ViewPaddingImpl( bottom: bottom ?? this.bottom, top: top ?? this.top, left: left ?? this.left, diff --git a/pubspec.yaml b/pubspec.yaml index 3845d66..6316350 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,18 +1,18 @@ name: adaptive_test description: >- A Flutter package to generate adaptive golden files during widget tests. -version: 0.3.2 +version: 0.4.0 homepage: https://github.com/bamlab/adaptive_test repository: https://github.com/bamlab/adaptive_test environment: - sdk: ">=2.17.6 <3.0.0" + sdk: '>=3.0.5 <4.0.0' flutter: ">=1.17.0" dependencies: cupertino_icons: ^1.0.5 equatable: ^2.0.5 - file: ^6.1.4 + file: ^7.0.0 flutter: sdk: flutter flutter_test: @@ -21,7 +21,6 @@ dependencies: path: ^1.8.2 platform: ^3.1.0 recase: ^4.0.0 - test_api: ^0.4.12 dev_dependencies: flutter_lints: ^2.0.1