json_serializable.dart icon indicating copy to clipboard operation
json_serializable.dart copied to clipboard

Super-parameters issue

Open feduke-nukem opened this issue 2 years ago • 11 comments

Hello.

I am facing the problem when I am using new Dart 2.17 super-parameters in constructor.

const BasketModel({
    required this.products,
    required this.delayedProducts,
    required this.unavailableProducts,
    required super.coupon,
    required super.couponData,
    required super.isCouponApplied,
    required this.summary,
  }) : super( 
          products: products,
          delayedProducts: delayedProducts,
          unavailableProducts: unavailableProducts,
          summary: summary,
        );

So I am getting this code-generation errors image

My flutter and dart version in project are up to date image

feduke-nukem avatar Jul 08 '22 12:07 feduke-nukem

I am able to solve that problem with command:

flutter pub run build_runner build --delete-conflicting-outputs --enable-experiment=super-parameters

But I wonder if there's any other way to handle that?

feduke-nukem avatar Jul 08 '22 13:07 feduke-nukem

What's your SDK constraint in your pubspec?

It should be sdk: '>=2.17.0 <3.0.0'

kevmoo avatar Jul 08 '22 21:07 kevmoo

What's your SDK constraint in your pubspec?

It should be sdk: '>=2.17.0 <3.0.0'

i am using these SDK constraint and get same error message

kencana16 avatar Jul 11 '22 03:07 kencana16

What's your SDK constraint in your pubspec?

It should be sdk: '>=2.17.0 <3.0.0'

It is.

feduke-nukem avatar Jul 11 '22 05:07 feduke-nukem

Have you run pub get or pub upgrade and restarted your IDE?

kevmoo avatar Jul 11 '22 21:07 kevmoo

Have you run pub get or pub upgrade and restarted your IDE?

Sure, I have.

feduke-nukem avatar Jul 12 '22 06:07 feduke-nukem

Any progress here, @coccyx-cyst ?

kevmoo avatar Jul 29 '22 23:07 kevmoo

Any progress here, @coccyx-cyst ?

Nope

I'm still using : flutter pub run build_runner build --delete-conflicting-outputs --enable-experiment=super-parameters

feduke-nukem avatar Aug 04 '22 17:08 feduke-nukem

give me the output of flutter --doctor

kevmoo avatar Aug 19 '22 20:08 kevmoo

or flutter doctor

kevmoo avatar Aug 19 '22 20:08 kevmoo

flutter --doctor

image

feduke-nukem avatar Aug 22 '22 05:08 feduke-nukem

Drop the -0 from 12.17.0-0

On Fri, Jul 8, 2022 at 5:59 AM Федор Благодырь @.***> wrote:

Hello.

I am facing the problem when I am using new Dart 2.17 super-parameters in constructor.

const BasketModel({ required this.products, required this.delayedProducts, required this.unavailableProducts, required super.coupon, required super.couponData, required super.isCouponApplied, required this.summary, }) : super( products: products, delayedProducts: delayedProducts, unavailableProducts: unavailableProducts, summary: summary, );

So I am getting this code-generation errors [image: image] https://user-images.githubusercontent.com/72284940/177996407-01e2b8ee-00ed-4c02-8079-4eabf2757e9b.png

My flutter and dart version in project are up to date [image: image] https://user-images.githubusercontent.com/72284940/177996496-69944934-2746-45cf-b940-7849f4a55a19.png

— Reply to this email directly, view it on GitHub https://github.com/google/json_serializable.dart/issues/1171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFCVOKLN6SQHBT67YX5TVTAQ4TANCNFSM53A5MWZQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kevmoo avatar Oct 11 '22 07:10 kevmoo