Files
GitJournal/lib/widgets/note_delete_dialog.dart
Vishesh Handa 2e0a3cfd6a chore: Moving folder_listing to bloc
First implementation of a screen using bloc. I'd like to slowly move all
the screens to bloc.
2024-08-18 20:12:26 +02:00

53 lines
1.4 KiB
Dart

/*
* SPDX-FileCopyrightText: 2019-2021 Vishesh Handa <me@vhanda.in>
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import 'package:flutter/material.dart';
import 'package:gitjournal/l10n.dart';
class NoteDeleteDialog extends StatelessWidget {
final int num;
const NoteDeleteDialog({super.key, required this.num});
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(context.loc.widgetsNoteDeleteDialogTitle(num)),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: Text(context.loc.widgetsNoteDeleteDialogNo),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
child: Text(context.loc.widgetsNoteDeleteDialogYes),
),
],
);
}
}
class NotesFolderDeleteDialog extends StatelessWidget {
const NotesFolderDeleteDialog({super.key});
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(context.loc.widgetsNotesFolderDeleteDialogTitle),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: Text(context.loc.widgetsNoteDeleteDialogNo),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
child: Text(context.loc.widgetsNoteDeleteDialogYes),
),
],
);
}
}