Skip to content
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
4 changes: 1 addition & 3 deletions examples/example/lib/gen/assets.gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@ class $AssetsLottieWrongGen {
List<String> get values => [dummy, rocketLottieV439];
}

class MyAssets {
const MyAssets._();

abstract final class MyAssets {
static const String readme = 'README.md';
static const $AssetsFlareGen flare = $AssetsFlareGen();
static const $AssetsImagesGen images = $AssetsImagesGen();
Expand Down
4 changes: 1 addition & 3 deletions examples/example/lib/gen/colors.gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
import 'package:flutter/painting.dart';
import 'package:flutter/material.dart';

class MyColorName {
MyColorName._();

abstract final class MyColorName {
/// Color: #000000
static const Color black = Color(0xFF000000);

Expand Down
4 changes: 1 addition & 3 deletions examples/example/lib/gen/fonts.gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
// ignore_for_file: type=lint
// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import

class MyFontFamily {
MyFontFamily._();

abstract final class MyFontFamily {
/// Font family: Raleway
static const String raleway = 'Raleway';

Expand Down
4 changes: 1 addition & 3 deletions examples/example_resources/lib/gen/assets.gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ class $AssetsUnknownGen {
List<String> get values => [unknownMimeType];
}

class ResAssets {
const ResAssets._();

abstract final class ResAssets {
static const String package = 'example_resources';

static const $AssetsImagesGen images = $AssetsImagesGen();
Expand Down
4 changes: 1 addition & 3 deletions examples/example_resources/lib/gen/colors.gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
import 'package:flutter/painting.dart';
import 'package:flutter/material.dart';

class ColorName {
ColorName._();

abstract final class ColorName {
/// Color: #000000
static const Color black = Color(0xFF000000);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ class $AssetsImagesGen {
List<AssetGenImage> get values => [flutter3];
}

class GalleryOneAssets {
const GalleryOneAssets._();

abstract final class GalleryOneAssets {
static const $AssetsImagesGen images = $AssetsImagesGen();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class $AssetsImagesGen {
List<String> get values => [dart];
}

class GalleryTwoAssets {
const GalleryTwoAssets._();

abstract final class GalleryTwoAssets {
static const $AssetsImagesGen images = $AssetsImagesGen();
}
6 changes: 5 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ scripts:

format:
run: |
dart format --set-exit-if-changed .
find . -name "*.dart" \
-not -path "*/actual_data/*" \
-not -path "*/.dart_tool/*" \
-not -path "*/build/*" \
-print0 | xargs -0 dart format --set-exit-if-changed
Comment on lines +36 to +40
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

git --no-pager diff --exit-code
description: Format Dart files and exit if unstaged changes exist

Expand Down
3 changes: 1 addition & 2 deletions packages/core/lib/generators/assets_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,7 @@ String _assetsClassDefinition(
String? packageName,
) {
return '''
class $className {
const $className._();
abstract final class $className {
${packageName != null ? "\n static const String package = '$packageName';" : ''}
$statementsBlock
Expand Down
3 changes: 1 addition & 2 deletions packages/core/lib/generators/colors_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ String generateColors(
buffer.writeln("import 'package:flutter/painting.dart';");
buffer.writeln("import 'package:flutter/material.dart';");
buffer.writeln();
buffer.writeln('class $className {');
buffer.writeln('$className._();');
buffer.writeln('abstract final class $className {');
buffer.writeln();

final colorList = <_Color>[];
Expand Down
3 changes: 1 addition & 2 deletions packages/core/lib/generators/fonts_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ String generateFonts(
buffer.writeln('// dart format width=${formatter.pageWidth}');
buffer.writeln(header);
buffer.writeln(ignore);
buffer.writeln('class $className {');
buffer.writeln('$className._();');
buffer.writeln('abstract final class $className {');
buffer.writeln();

final isPackage = config.packageParameterLiteral.isNotEmpty;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading