Skip to content

Commit

Permalink
fix: #301 add implicit_dynamic_list_literal to generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabeef committed Sep 29, 2022
1 parent d534c36 commit 7c8aa2e
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 4 deletions.
3 changes: 3 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ analyzer:
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
strong-mode:
implicit-casts: false
implicit-dynamic: false

linter:
rules:
Expand Down
Binary file added example/assets/mix/aaa.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
1 change: 1 addition & 0 deletions example/assets/mix/unknown_mime_type.bk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This file is UNKNOWN MIME TYPE FILE.
16 changes: 15 additions & 1 deletion example/lib/gen/assets.gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: directives_ordering,unnecessary_import
// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal

import 'package:flutter/widgets.dart';
import 'package:flutter_svg/flutter_svg.dart';
Expand Down Expand Up @@ -85,6 +85,19 @@ class $AssetsLottieGen {
[alarmClockLottieV440, geometricalAnimation, hamburgerArrow];
}

class $AssetsMixGen {
const $AssetsMixGen();

/// File path: assets/mix/aaa.jpg
AssetGenImage get aaa => const AssetGenImage('assets/mix/aaa.jpg');

/// File path: assets/mix/unknown_mime_type.bk
String get unknownMimeType => 'assets/mix/unknown_mime_type.bk';

/// List of all assets
List<dynamic> get values => [aaa, unknownMimeType];
}

class $AssetsMovieGen {
const $AssetsMovieGen();

Expand Down Expand Up @@ -170,6 +183,7 @@ class MyAssets {
static const $AssetsImagesGen images = $AssetsImagesGen();
static const $AssetsJsonGen json = $AssetsJsonGen();
static const $AssetsLottieGen lottie = $AssetsLottieGen();
static const $AssetsMixGen mix = $AssetsMixGen();
static const $AssetsMovieGen movie = $AssetsMovieGen();
static const $AssetsRiveGen rive = $AssetsRiveGen();
static const $AssetsUnknownGen unknown = $AssetsUnknownGen();
Expand Down
2 changes: 1 addition & 1 deletion example/lib/gen/colors.gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: directives_ordering,unnecessary_import
// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal

import 'package:flutter/painting.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/lib/gen/fonts.gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: directives_ordering,unnecessary_import
// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal

class MyFontFamily {
MyFontFamily._();
Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ flutter:
- assets/lottie/wrong/
- assets/movie/
- assets/unknown/
- assets/mix/
fonts:
- family: Raleway
fonts:
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/generators/generator_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ String get header {
String get ignore {
return '''// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: directives_ordering,unnecessary_import
// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal
''';
}
Expand Down

0 comments on commit 7c8aa2e

Please sign in to comment.