Skip to content

Commit 676643e

Browse files
[various] Updates min SDK for third_party/packages to 3.29 (#9819)
For all packages in third_party/: - Updates the min SDK version to 3.29 - Runs the autoformatter with the new format - Runs the code-excerpt tool to pick up format changes This does not update versions because pushing format changes (even in READMEs) isn't worth doing a release that drops an SDK version (which we don't normally version) Prep for #9816
1 parent 550f862 commit 676643e

35 files changed

+1957
-2000
lines changed

third_party/packages/cupertino_icons/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## NEXT
22

3-
* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
3+
* Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
44

55
## 1.0.8
66

third_party/packages/cupertino_icons/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+
66
version: 1.0.8
77

88
environment:
9-
sdk: ^3.6.0
9+
sdk: ^3.7.0
1010

1111
dev_dependencies:
1212
collection: ^1.18.0

third_party/packages/cupertino_icons/test/cupertino_icons_golden_test.dart

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,36 @@ void main() async {
2525
if (kIsWeb || !Platform.isLinux) {
2626
return;
2727
}
28-
final bool isMainChannel = !Platform.environment.containsKey('CHANNEL') ||
28+
final bool isMainChannel =
29+
!Platform.environment.containsKey('CHANNEL') ||
2930
Platform.environment['CHANNEL'] == 'main' ||
3031
Platform.environment['CHANNEL'] == 'master';
3132
// Only test against main to avoid rendering differences between flutter channels.
3233
if (!isMainChannel) {
3334
return;
3435
}
3536
// Load font.
36-
final String effectiveFontFamily = const TextStyle(
37-
fontFamily: CupertinoIcons.iconFont,
38-
package: CupertinoIcons.iconFontPackage)
39-
.fontFamily!;
37+
final String effectiveFontFamily =
38+
const TextStyle(
39+
fontFamily: CupertinoIcons.iconFont,
40+
package: CupertinoIcons.iconFontPackage,
41+
).fontFamily!;
4042
final FontLoader fontLoader = FontLoader(effectiveFontFamily);
4143
final String filePath = path.canonicalize('assets/CupertinoIcons.ttf');
4244
final File file = File(filePath);
43-
fontLoader
44-
.addFont(file.readAsBytes().then((Uint8List v) => v.buffer.asByteData()));
45+
fontLoader.addFont(
46+
file.readAsBytes().then((Uint8List v) => v.buffer.asByteData()),
47+
);
4548
await fontLoader.load();
4649

4750
assert(icons.isNotEmpty);
4851
for (int index = 0; index < icons.length;) {
4952
final int groupEndCodePoint =
5053
(icons[index].codePoint ~/ iconsPerImage + 1) * iconsPerImage;
5154
final int next = icons.indexWhere(
52-
(IconData icon) => icon.codePoint >= groupEndCodePoint, index);
55+
(IconData icon) => icon.codePoint >= groupEndCodePoint,
56+
index,
57+
);
5358
final int nextIndex = next < 0 ? icons.length : next;
5459
registerTestForIconGroup(icons.slice(index, nextIndex));
5560
index = nextIndex;
@@ -71,15 +76,19 @@ void registerTestForIconGroup(List<IconData> iconGroup) {
7176

7277
testWidgets('font golden test: $range', (WidgetTester tester) async {
7378
addTearDown(tester.view.reset);
74-
const Size canvasSize =
75-
Size(iconSize * iconsPerRow, iconSize * iconsPerCol);
79+
const Size canvasSize = Size(
80+
iconSize * iconsPerRow,
81+
iconSize * iconsPerCol,
82+
);
7683
tester.view.physicalSize = canvasSize * tester.view.devicePixelRatio;
7784

7885
const Widget fillerBox = SizedBox.square(dimension: iconSize);
7986
final List<Widget> children = List<Widget>.filled(iconsPerImage, fillerBox);
8087
for (final IconData icon in iconGroup) {
81-
children[icon.codePoint - groupStartCodePoint] =
82-
Icon(icon, size: iconSize);
88+
children[icon.codePoint - groupStartCodePoint] = Icon(
89+
icon,
90+
size: iconSize,
91+
);
8392
}
8493

8594
final Widget widget = Directionality(
@@ -94,6 +103,8 @@ void registerTestForIconGroup(List<IconData> iconGroup) {
94103
);
95104
await tester.pumpWidget(widget);
96105
await expectLater(
97-
find.byType(Wrap), matchesGoldenFile('goldens/glyph_$range.png'));
106+
find.byType(Wrap),
107+
matchesGoldenFile('goldens/glyph_$range.png'),
108+
);
98109
});
99110
}

third_party/packages/cupertino_icons/test/cupertino_icons_test.dart

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,17 @@ import 'package:flutter/material.dart';
1010
import 'package:flutter_test/flutter_test.dart';
1111

1212
void main() {
13-
testWidgets(
14-
'Cupertino Icon Test',
15-
(WidgetTester tester) async {
16-
// #docregion CupertinoIcon
17-
const Icon icon = Icon(
18-
CupertinoIcons.heart_fill,
19-
color: Colors.pink,
20-
size: 24.0,
21-
);
22-
// #enddocregion CupertinoIcon
13+
testWidgets('Cupertino Icon Test', (WidgetTester tester) async {
14+
// #docregion CupertinoIcon
15+
const Icon icon = Icon(
16+
CupertinoIcons.heart_fill,
17+
color: Colors.pink,
18+
size: 24.0,
19+
);
20+
// #enddocregion CupertinoIcon
2321

24-
await tester.pumpWidget(
25-
const MaterialApp(
26-
home: Scaffold(
27-
body: icon,
28-
),
29-
),
30-
);
22+
await tester.pumpWidget(const MaterialApp(home: Scaffold(body: icon)));
3123

32-
expect(find.byType(Icon), findsOne);
33-
},
34-
);
24+
expect(find.byType(Icon), findsOne);
25+
});
3526
}

0 commit comments

Comments
 (0)