mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 06:19:35 +00:00
39 lines
750 B
Dart
39 lines
750 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:vaani/generated/l10n.dart';
|
|
|
|
class OkButton<T> extends StatelessWidget {
|
|
const OkButton({
|
|
super.key,
|
|
this.onPressed,
|
|
});
|
|
|
|
final void Function()? onPressed;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return TextButton(
|
|
onPressed: onPressed,
|
|
child: Text(S.of(context).ok),
|
|
);
|
|
}
|
|
}
|
|
|
|
class CancelButton extends StatelessWidget {
|
|
const CancelButton({
|
|
super.key,
|
|
this.onPressed,
|
|
});
|
|
|
|
final void Function()? onPressed;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return TextButton(
|
|
onPressed: () {
|
|
onPressed?.call();
|
|
Navigator.of(context).pop();
|
|
},
|
|
child: Text(S.of(context).cancel),
|
|
);
|
|
}
|
|
}
|