mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-07 11:39:29 +00:00
35 lines
610 B
Dart
35 lines
610 B
Dart
|
|
import 'package:flutter/material.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: const Text('OK'),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
class CancelButton extends StatelessWidget {
|
||
|
|
const CancelButton({
|
||
|
|
super.key,
|
||
|
|
});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return TextButton(
|
||
|
|
onPressed: () {
|
||
|
|
Navigator.of(context).pop();
|
||
|
|
},
|
||
|
|
child: const Text('Cancel'),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|