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

[material_ui] An untitled AlertDialog pads its content 16 from the top, not 24

Aperta Adatta ai principianti
#195,096 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@LahaLuhem ci sta già lavorando.

Dal 23/10/2026.

  • #13399 di @LahaLuhem — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter
Ambito
frontend, mobile

Direzione di ricerca

Inizia dall’implementazione di AlertDialog nel package material_ui ed esamina come viene scelto il padding del contenuto quando non viene fornito un titolo. Esegui il test widget fornito con TargetPlatformVariant.all() per riprodurre l’inset superiore di 16dp. Il lavoro è completato quando il messaggio di un dialogo senza titolo ha un padding superiore di 24dp e il test passa su tutte le piattaforme.

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

Descrizione

p: material_ui package team-design
What package does this bug report belong to?

material_ui

What target platforms are you seeing this bug on?

Android, iOS, macOS, Linux, Windows

Have you already upgraded your packages?

Yes

Dependency versions
pubspec.lock
  material_ui:
    dependency: "direct main"
    description:
      name: material_ui
      sha256: e4031746f96c8316864d9b92bce375f1320a36ed56e166307e1e1bda9d90b4ab
      url: "https://pub.dev"
    source: hosted
    version: "1.8.0"
Steps to reproduce
  1. Run the code sample.
  2. Tap Delete list.
Expected results

The message sits 24 from the top. The M3 dialog specs pad a dialog 24dp on every side, with 16dp only between title and body.
Compose's AlertDialog follows them.

Actual results

It sits 16 from the top, the title-to-body gap, though there's no title. The framework's own AlertDialog (Flutter 3.47.7) does the same. contentPadding: .all(24) works around it.

Code sample
Code sample
import 'package:flutter/widgets.dart';
import 'package:material_ui/material_ui.dart';

const message = 'This deletes the list and its reminders.';

void main() => runApp(const MaterialApp(home: DialogPage()));

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

  @override
  Widget build(BuildContext context) => Scaffold(
    body: Center(
      child: TextButton(
        onPressed: () => showDialog<void>(
          context: context,
          builder: (_) => const AlertDialog(content: Text(message)),
        ),
        child: const Text('Delete list'),
      ),
    ),
  );
}
Widget test
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';

// DialogPage and message from the code sample above.

void main() {
  testWidgets('an untitled message sits as far from the top as from the side', (tester) async {
    await tester.pumpWidget(const MaterialApp(home: DialogPage()));
    await tester.tap(find.text('Delete list'));
    await tester.pumpAndSettle();

    final text = tester.getRect(find.text(message));
    final dialog = tester.getRect(
      find.ancestor(of: find.text(message), matching: find.byType(Material)).first,
    );

    expect(text.top - dialog.top, text.left - dialog.left); // Fails: 16.0, not 24.0.
  }, variant: TargetPlatformVariant.all());
}
Screenshots or Videos

None, the widget test shows it.

Logs
Logs
$ flutter test
an untitled message sits as far from the top as from the side (variant: TargetPlatform.android)
Expected: <24.0>
  Actual: <16.0>

The same on every other variant.

Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.47.7, on macOS 15.7.9 24G830 darwin-arm64, locale en-US)
    • Framework revision abaf9c5237 (2 weeks ago), 2026-10-08 09:51:21 -0700
    • Engine revision deb287481e
    • Dart version 3.13.5
Lingua principale
Dart
Stelle
180k
Fork
33.9k
Merge medio
2g 57m
PR unite (30g)
292

Preparare l'ambiente

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 flutter/flutter

Tutte le issue di flutter/flutter

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.