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

Flutter 2: Cannot configure in the builder parameters of MaterialApp #3

Closed
calcitem opened this issue Apr 10, 2021 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@calcitem
Copy link

calcitem commented Apr 10, 2021

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SmartDialogPage(),
      builder: (BuildContext context, Widget child) {
        return FlutterSmartDialog(child: child);
      },
    );
  }
}

The error occurs:

The argument type 'FlutterSmartDialog Function(BuildContext, Widget)' can't be assigned to the parameter type 'Widget Function(BuildContext, Widget?)?'.
@xdd666t
Copy link
Member

xdd666t commented Apr 11, 2021

Hi,this is my problem, because I forget to update the use of flutter2.0

This problem has been solved

  • please update version to 2.0.3
dependencies:
  flutter_smart_dialog: ^2.0.3
  • about use
void main() {
  runApp(MyApp());
}

///flutter 2.0
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Container(),
      builder: (BuildContext context, Widget? child) {
        return FlutterSmartDialog(child: child);
      },
    );
  }
}

@calcitem
Copy link
Author

Fixed! Thank you very much!

@13232989155 13232989155 mentioned this issue Dec 13, 2021
@xdd666t xdd666t added the bug Something isn't working label Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants