Skip to content

Fix formatting #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
melos bootstrap

- name: Verify formatting
run: melos exec dart format --output=none --set-exit-if-changed .
# Remove --line-length=100 when upgrading the min dart sdk to at least 3.7
run: melos exec dart format --output=none --set-exit-if-changed --line-length=100 .

# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Run flutter analyze
Expand Down
3 changes: 2 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ scripts:
description: Run `flutter analyze` for all packages.

format:
run: melos exec dart format . --fix
# Remove --line-length=100 when upgrading the min dart sdk to at least 3.7
run: melos exec dart format --line-length=100 .
description: Run `dart format` for all packages.

test:select:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class _FormFieldExampleState extends State<FormFieldExample> {
DropdownButtonFormField2<String>(
isExpanded: true,
decoration: InputDecoration(
contentPadding:
const EdgeInsets.symmetric(vertical: 16, horizontal: 16),
contentPadding: const EdgeInsets.symmetric(vertical: 16, horizontal: 16),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ class _MultiSelectExampleState extends State<MultiSelectExample> {
? multiValueListenable.value = []
: multiValueListenable.value = List.from(items);
} else {
multiValueListenable.value = isSelected
? ([...multiValue]..remove(value))
: [...multiValue, value!];
multiValueListenable.value =
isSelected ? ([...multiValue]..remove(value)) : [...multiValue, value!];
}
},
selectedItemBuilder: (context) {
Expand All @@ -89,9 +88,7 @@ class _MultiSelectExampleState extends State<MultiSelectExample> {
return Container(
alignment: AlignmentDirectional.center,
child: Text(
multiValue
.where((item) => item != 'All')
.join(', '),
multiValue.where((item) => item != 'All').join(', '),
style: const TextStyle(
fontSize: 14,
overflow: TextOverflow.ellipsis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/few_styling_example/${variant.name}_closed_menu.png'),
matchesGoldenFile('goldens/few_styling_example/${variant.name}_closed_menu.png'),
);

// GIVEN
Expand All @@ -27,8 +26,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/few_styling_example/${variant.name}_open_menu.png'),
matchesGoldenFile('goldens/few_styling_example/${variant.name}_open_menu.png'),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) async {
/// of [.SF UI Text], [.SF UI Display], [.SF Pro Text] and [.SF Pro Display] in your package's yaml.
/// It's not included in this package for licensing reasons.
Future<void> _loadRobotoFont() async {
final Future<ByteData> font =
rootBundle.load('assets/fonts/Roboto-Regular.ttf');
final Future<ByteData> font = rootBundle.load('assets/fonts/Roboto-Regular.ttf');
final FontLoader fontLoader = FontLoader('Roboto')..addFont(font);
await fontLoader.load();
}
Expand All @@ -36,8 +35,7 @@ Future<void> _loadRobotoFont() async {
Future<void> _loadMaterialIconFont() async {
const f.FileSystem fs = l.LocalFileSystem();
const p.Platform platform = p.LocalPlatform();
final f.Directory flutterRoot =
fs.directory(platform.environment['FLUTTER_ROOT']);
final f.Directory flutterRoot = fs.directory(platform.environment['FLUTTER_ROOT']);

final f.File iconFont = flutterRoot.childFile(
fs.path.join(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/form_field_example/${variant.name}_closed_menu.png'),
matchesGoldenFile('goldens/form_field_example/${variant.name}_closed_menu.png'),
);

// GIVEN
Expand All @@ -27,8 +26,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/form_field_example/${variant.name}_open_menu.png'),
matchesGoldenFile('goldens/form_field_example/${variant.name}_open_menu.png'),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/multi_select_example/${variant.name}_closed_menu.png'),
matchesGoldenFile('goldens/multi_select_example/${variant.name}_closed_menu.png'),
);

// GIVEN
Expand All @@ -27,8 +26,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/multi_select_example/${variant.name}_open_menu.png'),
matchesGoldenFile('goldens/multi_select_example/${variant.name}_open_menu.png'),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/popup_icon_example/${variant.name}_closed_menu.png'),
matchesGoldenFile('goldens/popup_icon_example/${variant.name}_closed_menu.png'),
);

// GIVEN
Expand All @@ -27,8 +26,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/popup_icon_example/${variant.name}_open_menu.png'),
matchesGoldenFile('goldens/popup_icon_example/${variant.name}_open_menu.png'),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/popup_image_example/${variant.name}_closed_menu.png'),
matchesGoldenFile('goldens/popup_image_example/${variant.name}_closed_menu.png'),
);

// GIVEN
Expand All @@ -28,8 +27,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/popup_image_example/${variant.name}_open_menu.png'),
matchesGoldenFile('goldens/popup_image_example/${variant.name}_open_menu.png'),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/search_example/${variant.name}_closed_menu.png'),
matchesGoldenFile('goldens/search_example/${variant.name}_closed_menu.png'),
);

// GIVEN
Expand All @@ -27,8 +26,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/search_example/${variant.name}_open_menu.png'),
matchesGoldenFile('goldens/search_example/${variant.name}_open_menu.png'),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/simple_example/${variant.name}_closed_menu.png'),
matchesGoldenFile('goldens/simple_example/${variant.name}_closed_menu.png'),
);

// GIVEN
Expand All @@ -27,8 +26,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/simple_example/${variant.name}_open_menu.png'),
matchesGoldenFile('goldens/simple_example/${variant.name}_open_menu.png'),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/with_separators_example/${variant.name}_closed_menu.png'),
matchesGoldenFile('goldens/with_separators_example/${variant.name}_closed_menu.png'),
);

// GIVEN
Expand All @@ -27,8 +26,7 @@ void main() {
// THEN
await expectLater(
find.byType(TestApp),
matchesGoldenFile(
'goldens/with_separators_example/${variant.name}_open_menu.png'),
matchesGoldenFile('goldens/with_separators_example/${variant.name}_open_menu.png'),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ void runGoldenTests(
GoldenTestCallback callback, {
ValueVariant<ViewVariant>? variantsOverride,
}) {
final ValueVariant<ViewVariant> variants =
variantsOverride ?? defaultVariants;
final ValueVariant<ViewVariant> variants = variantsOverride ?? defaultVariants;
testWidgets(
description,
(WidgetTester tester) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ extension WidgetTesterX on WidgetTester {
/// Pauses test until images are ready to be rendered.
Future<void> precacheImages() async {
final imageElements = find.byType(Image, skipOffstage: false).evaluate();
final containerElements =
find.byType(DecoratedBox, skipOffstage: false).evaluate();
final containerElements = find.byType(DecoratedBox, skipOffstage: false).evaluate();

await runAsync(() async {
for (final element in imageElements) {
Expand Down
Loading