vedartm / paginate_firestore

A flutter package to simplify pagination with firestore data 🗃
https://pub.dev/packages/paginate_firestore
MIT License
113 stars 138 forks source link

Can't use the package on Web #110

Open ben55j opened 2 years ago

ben55j commented 2 years ago

Hello,

I am facing the following error when using the package on web. (I have no issues with the same code on mobile); Please help

Here is my query:

 Widget paginateFirestoreTest() {

    return PaginateFirestore(

        itemsPerPage: 10,
        itemBuilderType: PaginateBuilderType.listView, // listview and gridview
        itemBuilder: (index, context, documentSnapshot) {

          return Container();
        },
        query: FirebaseFirestore.instance.collection("MyCollection").limit(2));

  }

And the error I got when running this:

Bad state: Source maps are not done loading.
    at Object.a (http://localhost:52288/stack_trace_mapper.js:298:3)
    at cG.kB (http://localhost:52288/stack_trace_mapper.js:2612:23)
    at Object.j2 (http://localhost:52288/stack_trace_mapper.js:250:69)
    at jU (http://localhost:52288/stack_trace_mapper.js:2631:10)
    at http://localhost:52288/stack_trace_mapper.js:2625:42
    at dart._StackTrace.new.toString (http://localhost:52288/dart_sdk.js:7783:19)
    at Object.str (http://localhost:52288/dart_sdk.js:5488:32)
at Function._applyStackFilter (http://localhost:52288/packages/flutter/src/foundation/debug.dart.lib.js:3766:32)
at new assertions.DiagnosticsStackTrace.new (http://localhost:52288/packages/flutter/src/foundation/debug.dart.lib.js:3779:135)
at assertions.FlutterErrorDetails.new.debugFillProperties (http://localhost:52288/packages/flutter/src/foundation/debug.dart.lib.js:3477:24)
at http://localhost:52288/packages/flutter/src/foundation/debug.dart.lib.js:2523:26
at assertions._FlutterErrorDetailsNode.new.get builder (http://localhost:52288/packages/flutter/src/foundation/debug.dart.lib.js:2526:30)
at assertions._FlutterErrorDetailsNode.new.get builder [as builder] (http://localhost:52288/packages/flutter/src/foundation/debug.dart.lib.js:3804:27)
at assertions._FlutterErrorDetailsNode.new.get emptyBodyDescription [as emptyBodyDescription] (http://localhost:52288/packages/flutter/src/foundation/debug.dart.lib.js:2535:58)

Here my yaml file

name: myApp
description: here is my description

# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  google_fonts: ^2.1.0
  auto_route: ^3.2.0
  responsive_builder: ^0.4.1
  auto_route_generator: ^3.2.0
  feather_icons: ^1.1.0-nullsafety.0
  font_awesome_flutter: ^9.0.0-nullsafety
  flutter_staggered_grid_view: ^0.4.0
  url_launcher: ^6.0.3
  layout: ^1.0.2
  carousel_slider: ^4.0.0
  dots_indicator: ^2.0.0
  animated_text_kit: ^4.2.1
  visibility_detector: ^0.2.0
  get: ^4.3.8
  webviewx: ^0.2.1
  cloud_firestore: ^3.1.5
  firebase_core: ^1.3.0
  awesome_dialog: ^2.1.0
  string_validator: ^0.3.0
  intl: ^0.17.0
  firebase_auth: ^2.0.0
  webview_flutter: ^2.0.13
  google_tag_manager: ^0.1.0
  seo_renderer: ^0.3.0
  shared_preferences: ^2.0.6
  paginate_firestore: ^1.0.3
  flutter_rating_bar: ^4.0.0
  cached_network_image: ^3.1.0
  universal_html: ^2.0.8

dev_dependencies:
  flutter_test:
    sdk: flutter

  build_runner:

flutter:
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/images/

And my flutter doctor ` [✓] Flutter (Channel stable, 2.8.1, on macOS 11.6.1 20G224 darwin-x64, locale fr-FR) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] VS Code (version 1.63.2) [✓] Connected device (1 available)

• No issues found! `

garrettApproachableGeek commented 2 years ago

@ben55j Can you attempt to remove <script src="main.dart.js" type="application/javascript"></script> from web/index.html