Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with the latest version of flutter/dart? #374

Closed
gjcarver opened this issue Sep 22, 2023 · 11 comments
Closed

Incompatible with the latest version of flutter/dart? #374

gjcarver opened this issue Sep 22, 2023 · 11 comments

Comments

@gjcarver
Copy link

Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
import '../modal_bottom_sheet.dart';
^^^^^^^^^^^^^^^^^^^^^
lib/modals/circular_modal.dart:102:32: Error: Method not found: 'ModalSheetRoute'.
.push(modal_bottom_sheet.ModalSheetRoute(
^^^^^^^^^^^^^^^
lib/modals/circular_modal.dart:118:10: Error: A value of type 'Object?' can't be returned from an async function with return type 'Future<T?>'.

  • 'Object' is from 'dart:core'.
  • 'Future' is from 'dart:async'.
    return result;
    ^
    Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\tools\flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1297

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\tools\flutter\bin\flutter.bat'' finished with non-zero exit value 1

@sonigeez
Copy link

facing same issue...

@gjcarver
Copy link
Author

Switched "params" to "pathParameters" in gorouter.dart: "final String id = state.pathParameters['bid']!;"
Switched "with" to "implements" in lib/examples/sheet/complex_snap_sheet.dart : "class MapAppBar extends StatefulWidget implements PreferredSizeWidget {"

@gjcarver
Copy link
Author

lib/examples/route/navigation/go_router.dart: from "redirect: (GoRouterState state) {" to "redirect: (BuildContext context, GoRouterState state) {"

@sanburnn
Copy link

facing same issue here. is there anyway to fix this?

@fralsal
Copy link

fralsal commented Oct 17, 2023

I believe I have fixed the issue, will test it on my project and submit a PR.

Edit: PR is up.

@sanburnn
Copy link

oh sory i just fix it by changing the version into modal_bottom_sheet: ^3.0.0-pre

@koldoon
Copy link

koldoon commented Nov 20, 2023

What about "sheet" package update accordingly? Facing the same issue

@ziqq
Copy link

ziqq commented Dec 7, 2023

Hello any one, try to use modal_bottom_sheet: ^3.0.0-pre in pubspec.yaml

@joaobentes
Copy link
Contributor

Hello everyone,

It does not work for me neither. I have both sheet: ^1.0.0-pre and modal_bottom_sheet: ^3.0.0-pre in pubspec.yaml.

But still, it does not build the project. Here's the error messages:

../../.pub-cache/hosted/pub.dev/sheet-1.0.0-pre/lib/src/sheet.dart:905:18: Error: The method 'RenderSheetViewport.getOffsetToReveal' has fewer named arguments than those of overridden method 'RenderAbstractViewport.getOffsetToReveal'.
  RevealedOffset getOffsetToReveal(RenderObject target, double alignment,
                 ^
../../fluttter/flutter/packages/flutter/lib/src/rendering/viewport.dart:126:18: Context: This is the overridden method ('getOffsetToReveal').
  RevealedOffset getOffsetToReveal(
                 ^
../../.pub-cache/hosted/pub.dev/sheet-1.0.0-pre/lib/src/sheet.dart:905:18: Error: The method 'RenderSheetViewport.getOffsetToReveal' doesn't have the named parameter 'axis' of overridden method 'RenderAbstractViewport.getOffsetToReveal'.
  RevealedOffset getOffsetToReveal(RenderObject target, double alignment,
                 ^
../../fluttter/flutter/packages/flutter/lib/src/rendering/viewport.dart:126:18: Context: This is the overridden method ('getOffsetToReveal').
  RevealedOffset getOffsetToReveal(
                 ^
../../.pub-cache/hosted/pub.dev/sheet-1.0.0-pre/lib/src/scrollable.dart:313:7: Error: The non-abstract class 'SheetState' is missing implementations for these members:
 - ScrollContext.devicePixelRatio

And here's my sample code:

import 'package:flutter/material.dart';
import 'package:sheet/route.dart';

class PreviewCupertinoModals extends StatefulWidget {
  const PreviewCupertinoModals({super.key});

  @override
  State<PreviewCupertinoModals> createState() => _PreviewCupertinoModalsState();
}

class _PreviewCupertinoModalsState extends State<PreviewCupertinoModals> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: ElevatedButton(
          child: const Text('Go to Cupertino Sheet'),
          onPressed: () {
            const CupertinoSheetPage(
                child: Center(
              child: Text('Something'),
            ));
          }),
    );
  }
}

Here's my flutter --version

Flutter 3.16.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b0366e0a3f (4 weeks ago) • 2023-12-05 19:46:39 -0800
Engine • revision 54a7145303
Tools • Dart 3.2.3 • DevTools 2.28.4

Anyone with the same issue?

@ziqq
Copy link

ziqq commented Feb 2, 2024

Hello @joaobentes, remove sheet: ^1.0.0-pre and use only modal_bottom_sheet: ^3.0.0-pre

@jamesblasco
Copy link
Owner

There is a new version of sheet 1.0.0 and modal_bottom_sheet: 3.0.0 that should work with latest dart 3.3 and flutter 3.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants