mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-28 23:25:52 +01:00
Two-button confirmations, single-choice settings sheets and header plus group slivers were hand-written at every call site. showAppConfirmDialog, showAppChoiceSheet and settingsSectionSlivers build the same trees, and SettingsGroup's four inset wrappers become one.
18 lines
557 B
Dart
18 lines
557 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:mornye/widgets/app_alert_dialog.dart';
|
|
import 'package:mornye/l10n/l10n.dart';
|
|
|
|
/// Shared discard-unsaved-changes confirmation dialog used by priority /
|
|
/// selection settings pages.
|
|
Future<bool> showDiscardChangesDialog(
|
|
BuildContext context, {
|
|
String? content,
|
|
}) => showAppConfirmDialog(
|
|
context,
|
|
title: context.l10n.dialogDiscardChanges,
|
|
message: content ?? context.l10n.dialogUnsavedChanges,
|
|
confirmLabel: context.l10n.dialogDiscard,
|
|
cancelIsDefault: true,
|
|
destructive: true,
|
|
);
|