Code Monkey home page Code Monkey logo

Comments (6)

AndroidHensen avatar AndroidHensen commented on September 21, 2024

try showCallBack property avaliable or not

from flutter-custom-dialog.

jpainam avatar jpainam commented on September 21, 2024

Sorry, how am I supposed to use the function showCallBack, it doesn't receive any argument. Can you show a sample using showCallBack? the property does exist

from flutter-custom-dialog.

AndroidHensen avatar AndroidHensen commented on September 21, 2024
YYDialog YYNoticeDialog() {
  return YYDialog().build()
    ..width = 120
    ..height = 110
    ..backgroundColor = Colors.black.withOpacity(0.8)
    ..borderRadius = 10.0
    ..showCallBack = () {
      print("showCallBack invoke");
    }
    ..dismissCallBack = () {
      print("dismissCallBack invoke");
    }
    ..widget(Padding(
      padding: EdgeInsets.only(top: 21),
      child: Image.asset(
        'images/success.png',
        width: 38,
        height: 38,
      ),
    ))
    ..widget(Padding(
      padding: EdgeInsets.only(top: 10),
      child: Text(
        "Success",
        style: TextStyle(
          fontSize: 15,
          color: Colors.white,
        ),
      ),
    ))
    ..animatedFunc = (child, animation) {
      return ScaleTransition(
        child: child,
        scale: Tween(begin: 0.0, end: 1.0).animate(animation),
      );
    }
    ..show();
}

from flutter-custom-dialog.

jpainam avatar jpainam commented on September 21, 2024

sorry, but it doesn't solve my problem. I can execute the showCallback and the dismissCallBack . But how do I get the returned value after the user hit onTap1 or onTap2? I want to return the selected value when the dialog is dismiss. Using Navigor.pop(context, selectedButton) will pop the whole screen.

from flutter-custom-dialog.

AndroidHensen avatar AndroidHensen commented on September 21, 2024

1、dismiss

Do not use 'Navigator.pop(context)' to make the popover disappear, or you will close your page
This problem has been solved internally in YYDialog, and you can simply call 'dismiss()' supplied internally

var yyDialog = YYDialog();
yyDialog?.dismiss();

2、return value

return value belongs to the business logic, can find a way to obtain

from flutter-custom-dialog.

jpainam avatar jpainam commented on September 21, 2024

i get. thank you

from flutter-custom-dialog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.