EdsonBueno / infinite_scroll_pagination

Flutter package to help you lazily load and display pages of items as the user scrolls down your screen.
https://pub.dev/packages/infinite_scroll_pagination
MIT License
612 stars 202 forks source link

Error: Cannot invoke a non-'const' #283

Closed itsnang closed 3 months ago

itsnang commented 11 months ago

: Error: Cannot invoke a non-'const' constructor where a const expression is expected. new_page_error_indicator.dart:15 Try using a constructor or factory that is 'const'. child: Column( ^^^^^^

desmeit commented 11 months ago

I have this error too

mbrandon85 commented 11 months ago

I am seeing the same error as well. Anyone able to get past it?

For now, we temporarily reverted back to 3.2.0.

beebobox commented 11 months ago

I too have this error in Xcode. Android builds fine..

workaround found: in the file: new_page_error_indicator.dart path: Pub\Cache\hosted\pub.dev\infinite_scroll_pagination-4.0.0\lib\src\widgets\helpers\default_status_indicators

change line 14 from
child: const FooterTile( to child: FooterTile( :)

cipsys commented 10 months ago

Same error here. Is there a plan to address this? Would be sad to fork it. Thanks

iel-milabs commented 10 months ago

same error here. Thanks

aeros281 commented 10 months ago

Same error. Right now I'm just using my own patched repo to fix this issue on iOS build:

diff --git a/lib/src/widgets/helpers/default_status_indicators/new_page_error_indicator.dart b/lib/src/widgets/helpers/default_status_indicators/new_page_error_indicator.dart
index a208af2..d36c85d 100644
--- a/lib/src/widgets/helpers/default_status_indicators/new_page_error_indicator.dart
+++ b/lib/src/widgets/helpers/default_status_indicators/new_page_error_indicator.dart
@@ -11,10 +11,10 @@ class NewPageErrorIndicator extends StatelessWidget {
   @override
   Widget build(BuildContext context) => InkWell(
         onTap: onTap,
-        child: const FooterTile(
+        child: FooterTile(
           child: Column(
             mainAxisAlignment: MainAxisAlignment.center,
-            children: [
+            children: const [
               Text(
                 'Something went wrong. Tap to try again.',
                 textAlign: TextAlign.center,
ericaig commented 9 months ago

Same issue:

../../.pub-cache/hosted/pub.dev/infinite_scroll_pagination-4.0.0/lib/src/widget
s/helpers/default_status_indicators/new_page_error_indicator.dart:15:18: Error:
Cannot invoke a non-'const' constructor where a const expression is expected.
Try using a constructor or factory that is 'const'.
          child: Column(
PollyGlot commented 8 months ago

Same issue here and still no hotfix from a developer

RakaAlrian commented 7 months ago

getting same error on version 4.0.0

here is my flutter doctor :

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.7.0, on Microsoft Windows [Version 10.0.19042.906], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.84.2)
[√] Connected device (1 available)
[√] HTTP Host Availability

• No issues found!
clragon commented 3 months ago

This error appears to be caused by an outdated flutter version. Please upgrade your flutter sdk, if you are experiencing this. Thank you!