0

In Git branch A, I was trying some design tweaks when I thought about using Sliver List and then I wrote something like SliverList() and gave all the params that were required. I almost got that right but then I actually don't know exactly what happened but I was getting squiggly red lines underneath SliverList keyword although I didn't change anything. It mentioned something like Unnamed constructors Also I got the whole mobile screen red and decided not to waste anymore time on how to make it work since it wasn't the current priority so I removed SliverList widget from there and undo all of it.

But from then on I am not able to run my app. I am constantly getting this error:

flutter run 
Using hardware rendering with device sdk gphone arm64. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on sdk gphone arm64 in debug mode...
../../../../development/flutter/packages/flutter/lib/src/widgets/sliver.dart:150:3: Error: Getters, setters and methods can't be declared to be 'const'.
Try removing the 'const' keyword.
  const xSliverList({
  ^^^^^
../../../../development/flutter/packages/flutter/lib/src/widgets/sliver.dart:148:7: Error: The non-abstract class 'SliverList' is missing implementations for these members:
 - SliverList.xSliverList
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class SliverList extends SliverMultiBoxAdaptorWidget {
      ^^^^^^^^^^
../../../../development/flutter/packages/flutter/lib/src/widgets/sliver.dart:150:9: Context: 'SliverList.xSliverList' is defined here.
  const xSliverList({
        ^^^^^^^^^^^
../../../../development/flutter/packages/flutter/lib/src/material/about.dart:922:21: Error: Couldn't find constructor 'SliverList'.
            sliver: SliverList(
                    ^^^^^^^^^^
../../../../development/flutter/packages/flutter/lib/src/material/date_picker.dart:1839:17: Error: Couldn't find constructor 'SliverList'.
                SliverList(
                ^^^^^^^^^^
../../../../development/flutter/packages/flutter/lib/src/material/date_picker.dart:1845:17: Error: Couldn't find constructor 'SliverList'.
                SliverList(
                ^^^^^^^^^^
../../../../development/flutter/packages/flutter/lib/src/widgets/animated_scroll_view.dart:760:12: Error: Couldn't find constructor 'SliverList'.
    return SliverList(
           ^^^^^^^^^^
../../../../development/flutter/packages/flutter/lib/src/widgets/reorderable_list.dart:957:12: Error: Couldn't find constructor 'SliverList'.
    return SliverList(delegate: childrenDelegate);
           ^^^^^^^^^^
../../../../development/flutter/packages/flutter/lib/src/widgets/scroll_view.dart:1584:12: Error: Couldn't find constructor 'SliverList'.
    return SliverList(delegate: childrenDelegate);
           ^^^^^^^^^^
../../../../development/flutter/packages/flutter/lib/src/widgets/sliver.dart:151:5: Error: Super-initializer formal parameters can only be used in generative constructors.
Try removing 'super.'.
    super.key,
    ^^^^^
../../../../development/flutter/packages/flutter/lib/src/widgets/sliver.dart:152:14: Error: Super-initializer formal parameters can only be used in generative constructors.
Try removing 'super.'.
    required super.delegate,
             ^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '/Users/arjunmalhotra/Desktop/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1201

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/arjunmalhotra/Desktop/development/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s
Running Gradle task 'assembleDebug'...                             11.1s
Exception: Gradle task assembleDebug failed with exit code 1

Below is the output of Iphone 14 emulator:

flutter run 
Launching lib/main.dart on iPhone 14 Pro Max in debug mode...
Running pod install...                                             13.9s
Running Xcode build...                                                  
Xcode build done.                                           155.0s
Failed to build iOS app
Error (Xcode): ../../../../development/flutter/packages/flutter/lib/src/widgets/sliver.dart:150:3: Error: Getters, setters and methods
can't be declared to be 'const'.


Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.

I have tried flutter clean good loads of times but its not working. I am not sure where I am wrong and what to do about it. Another thing is that when I checkout to master, I Expected it to work since branch A is not merged. What exactly is the issue and how can I remove it?

Arjun Malhotra
  • 351
  • 2
  • 11
  • can you include your code, the code in the error is unreadable – CStark Jul 05 '23 at 14:33
  • I actually have a large codebase. Can you please specify which part exactly? If you want anything about Sliver List, I had mentioned, I deleted all that code, I have no code that implements Sliver list – Arjun Malhotra Jul 05 '23 at 16:02
  • the code you had for the sliver list, which is the point of the question. if you deleted it then why are you asking the question – CStark Jul 05 '23 at 16:23
  • I dont think you have read the full question : I have deleted all the code in my project that implemented SliverList widget there's no such reference to the sliver.dart file in my project. – Arjun Malhotra Jul 05 '23 at 16:33

0 Answers0