Skip to content

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

@pawarn

Description

@pawarn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions