mirror of
https://github.com/sony/flutter-elinux-plugins.git
synced 2025-08-06 15:11:38 +08:00
49 lines
903 B
Dart
49 lines
903 B
Dart
import 'package:audioplayers_elinux_example/components/btn.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class SimpleDlg extends StatelessWidget {
|
|
final String message;
|
|
final String action;
|
|
|
|
const SimpleDlg({
|
|
required this.message,
|
|
required this.action,
|
|
super.key,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Dlg(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Text(message),
|
|
Btn(
|
|
txt: action,
|
|
onPressed: Navigator.of(context).pop,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class Dlg extends StatelessWidget {
|
|
final Widget child;
|
|
|
|
const Dlg({
|
|
required this.child,
|
|
super.key,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Dialog(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: child,
|
|
),
|
|
);
|
|
}
|
|
}
|