json_serializable.dart
json_serializable.dart copied to clipboard
Super-parameters issue
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
My flutter and dart version in project are up to date
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?
What's your SDK constraint in your pubspec?
It should be sdk: '>=2.17.0 <3.0.0'
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
What's your SDK constraint in your pubspec?
It should be
sdk: '>=2.17.0 <3.0.0'
It is.
Have you run pub get
or pub upgrade
and restarted your IDE?
Have you run
pub get
orpub upgrade
and restarted your IDE?
Sure, I have.
Any progress here, @coccyx-cyst ?
Any progress here, @coccyx-cyst ?
Nope
I'm still using : flutter pub run build_runner build --delete-conflicting-outputs --enable-experiment=super-parameters
give me the output of flutter --doctor
or flutter doctor
flutter --doctor
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: @.***>