A constant constructor can't call a non-constant super constructor

Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>

../programs/flutter/.pub-cache/hosted/pub.dev/syncfusion_flutter_core-21.2.5/lib/src/calendar/custom_looping_widget.dart:50:9: Error: A constant constructor can't call a non-constant super constructor.

      : super(children: children);

        ^

Target kernel_snapshot failed: Exception



FAILURE: Build failed with an exception.


* Where:

Script '/Users/builder/programs/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1151


10 Replies

IR Indumathi Ravichandran Syncfusion Team May 17, 2023 07:40 AM UTC

Hi kamila,


As per the shared information, we have checked the issue “A constant constructor can't call a non-constant super constructor” in a simple sample of the Flutter calendar, but we are unable to reproduce the mentioned issue from our end, it was working fine as expected from our end.

Tested details:

1. Flutter version: Stable channel-3.10.0

2. Flutter  Calendar: 21.2.5


Kindly update and check the Flutter version to the latest version 3.10.0. and let us know still if you are facing the same issue, please share the below details with us.


  1. Replication procedure
  2. Code snippet of the calendar implementation.


It would be helpful for us to analyze and provide you with a solution at the earliest.


Regards,

Indumathi R



SS soki sokaina May 19, 2023 04:37 PM UTC

Have you found a solution ? I'm getting the same error, it was working fine till I updated.



AK Ahad Khan replied to Indumathi Ravichandran May 21, 2023 03:27 PM UTC

/C:/Users/KHAN/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_charts-21.2.5/lib/src/common/template/rendering.dart:401:9: Error: A constant constructor can't call a non-constant super constructor.

      : super(children: children);

        ^

Target kernel_snapshot failed: Exception


Why I'm facing this issue after the update?



KA Kemal Abdillah May 21, 2023 09:46 PM UTC

I have a same problem until I upgraded my Flutter version with 'flutter upgrade' from 3.7 to 3.10. The sf package is now working fine. You guys should upgrade your Flutter version



LK Luk Kim Leung May 22, 2023 07:05 AM UTC

Dear Team


I am using Flutter 3.10.1 with 

syncfusion_flutter_datepicker: ^21.2.5

Also encounter the same error:

Failed to build iOS app

Could not build the precompiled application for the device.

Error (Xcode): ../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_datepicker-21.2.5/lib/src/date_picker/date_picker.dart:7584:8: Error: A constant constructor can't call a non-constant super constructor.


Be below sample:
return Scaffold(
appBar: AppBar(
title: Text('Select Date'),
),
body: SfDateRangePicker(
onSelectionChanged: (DateRangePickerSelectionChangedArgs args) {
setState(() {
_selectedDate = args.value;
});
},
),
floatingActionButton: FloatingActionButton(
onPressed: () {
Navigator.pop(context, _selectedDate);
},
child: Icon(Icons.check),
),
);




IR Indumathi Ravichandran Syncfusion Team May 22, 2023 09:53 AM UTC

Hi Luk Kim,


As per the shared information, we have checked the issue “A constant constructor can't call a non-constant super constructor” in the simple sample of the Flutter calendar in macOs and iPhone Simulator, but we are unable to reproduce the mentioned issue, it was working fine as expected from our end.

Tested details:

1. Flutter version: Stable channel-3.10.1

2. Flutter  Date Picker version: 21.2.5


Kindly run the flutter clean command then check and let us know still if you are facing the same issue, please share the below details with us.


  1. Replication procedure


It would be helpful for us to analyze and provide you with a solution at the earliest.


Regards,

Indumathi R



TJ Toby Jose July 1, 2023 02:44 AM UTC

Hi Team,


I could see this error with syncfusion_flutter_datepicker: ^22.1.36

Error:

/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-22.1.36/lib/src/date_picker/year_view.dart:1004:9: Error: A constant constructor can't call a non-constant super constructor.

      : super(children: widgets);

        ^


I did flutter clean



IR Indumathi Ravichandran Syncfusion Team July 3, 2023 06:38 AM UTC

Hi Toby,


As per the shared information, we have checked the issue “A constant constructor can't call a non-constant super constructor” in the simple sample of the Flutter calendar. But we are unable to reproduce the mentioned issue with the version 22.1.36, it was working fine as expected from our end.

Tested details:

1. Flutter version: Stable channel-3.10.2

2. Flutter  Date Picker version: 22.1.36


Kindly update the Flutter version to latest version 3.10.2 then check and let us know still if you are facing the same issue, please share the below details with us.


1.Replication procedure


It would be helpful for us to analyze and provide you a solution at the earliest.


Regards,

Indumathi R



RA rajat June 6, 2024 07:59 AM UTC

hi,

 i am using the old version of flutter 3.7.12
and getting the same error
Failed to build iOS app Error (Xcode): ../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-22.2.12/lib/src/common/template/rendering.dart:401:9: Error: A constant constructor can't call a non-constant super constructor.
can you suggest compatible version of  syncfusion_flutter_charts and syncfusion_flutter_datepicker because i have old mac thats why i can't update my flutter version



PS Preethika Selvam Syncfusion Team June 7, 2024 07:28 AM UTC

Hi Rajat,


We have checked the reported issue, that you are using a lower version of the Flutter SDK which is not compatible with the Syncfusion Flutter package version 22.2.12. If you prefer using our package with the lower Flutter SDK 3.7.12, please use Syncfusion Flutter package version from 20.4.50 to 21.2.6. Additionally, we have shared user guide documentation for the Syncfusion Compatibility Package version. Please find the compatible Syncfusion Flutter package version based on your Flutter SDK version below.


UG Link: https://help.syncfusion.com/flutter/system-requirements#sdk-version-compatibility


Please let us know if you need any further assistance.


Regards,
Preethika Selvam.


Loader.
Up arrow icon