Files
game-tracker/lib/presentation/widgets/custom_alert_dialog.dart
Mathis Kirchner 4161e1e88b
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m5s
Pull Request Pipeline / lint (pull_request) Successful in 2m10s
add docs to custom_alert_dialog.dart
2026-01-13 20:50:54 +01:00

41 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
/// A custom alert dialog widget that follows the application's design theme.
///
/// This widget provides a styled alternative to the default Flutter AlertDialog,
/// with consistent colors, borders, and layout that match the app's custom theme.
class CustomAlertDialog extends StatelessWidget {
/// The title text displayed at the top of the dialog.
final String title;
/// The main content text displayed in the body of the dialog.
final String content;
/// A list of action widgets (typically buttons) displayed at the bottom of the dialog.
/// These actions are horizontally spaced around the dialog's width.
final List<Widget> actions;
const CustomAlertDialog({
super.key,
required this.title,
required this.content,
required this.actions,
});
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(title, style: const TextStyle(color: CustomTheme.textColor,),),
content: Text(content, style: const TextStyle(color: CustomTheme.textColor),),
actions: actions,
backgroundColor: CustomTheme.boxColor,
actionsAlignment: MainAxisAlignment.spaceAround,
shape: RoundedRectangleBorder(
borderRadius: CustomTheme.standardBorderRadiusAll,
side: BorderSide(color: CustomTheme.boxBorder),
),
);
}
}