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

How to use pushDynamicScreen in plugin version v5.2.3 #163

Open
pawarn opened this issue May 16, 2024 · 1 comment
Open

How to use pushDynamicScreen in plugin version v5.2.3 #163

pawarn opened this issue May 16, 2024 · 1 comment

Comments

@pawarn
Copy link

pawarn commented May 16, 2024

Version

5.2.3

Flutter Doctor Output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.5 23F79 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[!] Xcode - develop for iOS and macOS (Xcode 14.3)
    ! Flutter recommends a minimum Xcode version of 15.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.84.2)
[✓] Connected device (4 available)
[✓] Network resources

! Doctor found issues in 1 category.

What platforms are you seeing the problem on?

Android and IOS

What happened?

In our app, we are using the plugin version v4.2.8 where we are currently using the pushDynamicScreen method to push the code in new version I'm not able to see alternative method to achieve the same.

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Code to reproduce the problem

pushDynamicScreen(
          context,
          withNavBar: true,
          screen: Screen1()
        );
This is the code to push a new dialog.

and in Screen1 we are using the below code.
import 'package:flutter/material.dart';



class Screen1 extends ModalRoute<void> {

  Screen1({Key? key} );

  Widget _buildOverlayContent(BuildContext context) {
    return  Dialog(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(10.0),
      ),
      elevation: 0,
      backgroundColor: Colors.white,
      child: Container()
    );
  }
  @override
  Duration get transitionDuration => Duration(milliseconds: 500);

  @override
  bool get opaque => false;

  @override
  bool get barrierDismissible => false;

  @override
  Color get barrierColor => Colors.black.withOpacity(0.5);

  @override
  String? get barrierLabel => null;

  @override
  bool get maintainState => true;

  @override
  Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
    // This makes sure that text and other content follows the material style
    return SafeArea(
      child: _buildOverlayContent(context),
    );
  }
}

Relevant log output

No response

Screenshots

No response

@jb3rndt
Copy link
Owner

jb3rndt commented May 26, 2024

Hi, can you try pushScreen? This should be able to do what you want

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

2 participants