1

I'm developing a chat application which allows users to reply to others' messages. I want to make it so that when user long pressed a chat bubble, a dialog will appear directly on top of the bubble with the options to either reply or forward. I tried using showDialog, but the dialog always appears in the center. Is there any way to do this with flutter? Any help will be appreciated.

treble18
  • 131
  • 7

4 Answers4

2

Please refer to this focused_menu plugin

Example

or

You can also try flutter menu

Tejaswini Dev
  • 1,311
  • 2
  • 8
  • 20
1

You can use show aligned dialog.

1

Just use flutter_smart_dialog: ^4.5.3+7

enter image description here

or use aligned_dialog: ^0.0.6

enter image description here

Anand
  • 4,355
  • 2
  • 35
  • 45
0

Make custom dialog by giving scaffold a transperant background. pass your custom widget to the body, align it wherever you want

            showGeneralDialog(
                              barrierColor: Colors.black.withOpacity(0.8),
                              context: context,
                              barrierDismissible: false,
                              barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
                              transitionDuration: const Duration(milliseconds: 200),
                              pageBuilder: (context, animation1, animation2) {
                                return Scaffold(
                       body:CustomWidgetDialog(), 

                                  );
                              },
                            );
Ninad7N
  • 544
  • 4
  • 13