Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

I hope that when using GFAlert and showDialog together, GFAlert can be vertically centered.

Aperta
#352 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
dart, flutter
Ambito
mobile

Direzione di ricerca

Start by reproducing the supplied showDialog example with GFAlert, then inspect GFAlert and GFFloatingWidget behavior around alignment and their container requirements. Done means GFAlert is vertically centered when used with showDialog and the requested Material dialog usage is supported without requiring the extra floating widget.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is your feature request related to a problem? Please describe.

It seems that the native GFAlert needs to be used with GFFloatingWidget because it requires providing some containers, masks, etc. This is too complicated and inflexible for popping up dialogs on other pages. Therefore, I want to use showDialog with Material to simplify the use of GFAlert. However, I found that GFAlert cannot be vertically centered even if I set the alignment of GFAlert to center. I also tried wrapping GFAlert with a layer of GFFloatingWidget, but it still doesn't work. So, I came here to ask questions, haha.

Describe the solution you'd like

just like:

static void showCustomDialog(BuildContext context,
      {required Widget widget, bool refuseBack = true, String? title, VoidCallback? onOk}) {
    showDialog(
      context: context,
      barrierDismissible: false,
      barrierColor: Colors.black54,
      builder: (BuildContext context) {
        return WillPopScope(
          onWillPop: () async => !refuseBack,
          child: GFAlert(
            title: title,
            content: widget,
            alignment: Alignment.center,
            onTapOk: () {
              onOk?.call();
              Navigator.pop(context);
            },
            onTapCancel: () {
              Navigator.pop(context);
            },
          ),
        );
      },
    );
  }

Describe alternatives you've considered

static void showCustomDialog(BuildContext context,
      {required Widget widget, bool refuseBack = true, String? title, VoidCallback? onOk}) {
    showDialog(
      context: context,
      barrierDismissible: false,
      barrierColor: Colors.black54,
      builder: (BuildContext context) {
        return WillPopScope(
          onWillPop: () async => !refuseBack,
          child: GFFloatingWidget(
            body: GFAlert(
              title: title,
              content: widget,
              alignment: Alignment.center,
              onTapOk: () {
                onOk?.call();
                Navigator.pop(context);
              },
              onTapCancel: () {
                Navigator.pop(context);
              },
            ),
          ),
        );
      },
    );
  }

Additional context
none

Lingua principale
Dart
Stelle
4.8k
Fork
649
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ionicfirebaseapp/getwidget

Tutte le issue di ionicfirebaseapp/getwidget

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.