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

Dialog is rendered above the Feedback UI #233

Closed
quoc-huynh-cosee opened this issue Aug 1, 2023 · 10 comments · Fixed by #235
Closed

Dialog is rendered above the Feedback UI #233

quoc-huynh-cosee opened this issue Aug 1, 2023 · 10 comments · Fixed by #235
Labels
bug Something isn't working

Comments

@quoc-huynh-cosee
Copy link
Contributor

Version

2.6.0

Library

feedback

Flutter channel

stable

Flutter version

3.10.6

Platform

Android

Details

If I open the Feedback UI, then select the navigate button, and then opening a Dialog via a button, the Dialog is rendered above the Feedback UI, so that I can't interact with the Feedback UI anymore.

Steps to reproduce

  • Open Feedback UI
  • Select navigate
  • Open a Dialog

Output of flutter doctor -v

No response

@quoc-huynh-cosee quoc-huynh-cosee added the bug Something isn't working label Aug 1, 2023
@quoc-huynh-cosee quoc-huynh-cosee changed the title Displaying an Dialog while in Feedback renders the Dialog above the Feedback Dialog is rendered above the Feedback UI Aug 1, 2023
@ueman
Copy link
Owner

ueman commented Aug 1, 2023

Where are you adding the better feedback widget? Can you share a snippet of that code?

@quoc-huynh-cosee
Copy link
Contributor Author

I added the BetterFeedback Widget above the MaterialApp.
Here is a small example:

import 'package:feedback/feedback.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return BetterFeedback(
      child: MaterialApp(
        home: Builder(
          builder: (context) => Scaffold(
            appBar: AppBar(),
            body: Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  TextButton(
                    onPressed: () => BetterFeedback.of(context)
                        .show((feedback) => print(feedback)),
                    child: Text('FEEDBACK'),
                  ),
                  TextButton(
                    onPressed: () => showDialog(
                      context: context,
                      builder: (context) => AlertDialog(
                        title: Text('My Dialog'),
                        actions: [
                          TextButton(
                            onPressed: () => Navigator.pop(context),
                            child: Text('OK'),
                          ),
                        ],
                      ),
                    ),
                    child: Text('DIALOG'),
                  ),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}

@quoc-huynh-cosee
Copy link
Contributor Author

quoc-huynh-cosee commented Aug 1, 2023

This is how it would look

Bildschirmfoto 2023-08-01 um 09 55 45

@ueman
Copy link
Owner

ueman commented Aug 1, 2023

You have to move the BetterFeedback widget above the MaterialApp:

import 'package:feedback/feedback.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(
    BetterFeedback(
      child: const MyApp(),
    ),
  );
}

Edit: Wait, you're doing that. Hm, I'll have to look further into it

@ueman ueman closed this as completed Aug 1, 2023
@ueman ueman reopened this Aug 1, 2023
@Bungeefan
Copy link

Hi, did you try using showDialog(useRootNavigator: false, ...)?

@quoc-huynh-cosee
Copy link
Contributor Author

@Bungeefan Nice, this is working. @ueman maybe we should add this to the README?

@ueman
Copy link
Owner

ueman commented Aug 21, 2023

Feel free to create a PR and add it to the readme :)

@quoc-huynh-cosee
Copy link
Contributor Author

@ueman Can you give me write permissions?

@ueman
Copy link
Owner

ueman commented Aug 24, 2023

You don't need write permissions. You can fork the repo and then create a PR

@quoc-huynh-cosee
Copy link
Contributor Author

@ueman Oh didn't know that. Thanks!

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

Successfully merging a pull request may close this issue.

3 participants