ueman / feedback

A simple widget for getting better feedback.
https://pub.dev/packages/feedback
387 stars 93 forks source link

Dialog is rendered above the Feedback UI #233

Closed quoc-huynh-cosee closed 1 year ago

quoc-huynh-cosee commented 1 year ago

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

Output of flutter doctor -v

No response

ueman commented 1 year ago

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

quoc-huynh-cosee commented 1 year ago

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 commented 1 year ago

This is how it would look

Bildschirmfoto 2023-08-01 um 09 55 45
ueman commented 1 year ago

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

Bungeefan commented 1 year ago

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

quoc-huynh-cosee commented 1 year ago

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

ueman commented 1 year ago

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

quoc-huynh-cosee commented 1 year ago

@ueman Can you give me write permissions?

ueman commented 1 year ago

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

quoc-huynh-cosee commented 1 year ago

@ueman Oh didn't know that. Thanks!