Dialog with a title and content. Before-events can be cancelled synchronously; external visibility remains authoritative.
TxPopup
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| visible | bool | required | Controls visibility. |
| child | Widget | required | Content or target widget. |
| title | String | 'Dialog' | View title. |
| actions | List<Widget> | const [] | Dialog or card actions. |
| onVisibleChanged | ValueChanged<bool>? | null | Reports visible; update controlled state in the callback. |
| onShown | VoidCallback? | null | After showing, without a payload. |
| onHidden | VoidCallback? | null | After hiding, without a payload. |
| showCloseButton | bool | true | Shows a close action. |
| hideOnOutsideClick | bool | false | Allows closing by clicking outside. |
| width | double | 480 | Width; Vue numbers use pixels, Flutter uses logical pixels. |
| height | double? | null | Height; Vue numbers use pixels, Flutter uses logical pixels. |
| fullScreen | bool | false | Fills the screen. |
| dragEnabled | bool | false | Allows dragging the dialog. |
| resizeEnabled | bool | false | Allows resizing the dialog. |
| alignment | Alignment | Alignment.center | Content alignment. |
| onShowing | ValueChanged<TxChange<bool>>? | null | Before showing: TxChange<bool>; set cancel synchronously to abort. |
| onHiding | ValueChanged<TxChange<bool>>? | null | Before user-initiated closing: TxChange<bool>; synchronously cancellable. |
| Member / type / return | Meaning |
|---|---|
static Future<T?> show<T>(BuildContext context, {required String title, required Widget child, List<Widget> actions = const [], double width = 480, bool hideOnOutsideClick = false}) | Opens the native overlay alternative; follow the return contract in the signature. |
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';
Widget example() {
var visible = false;
return StatefulBuilder(
builder: (context, setState) => Column(mainAxisSize: MainAxisSize.min, children: [TxButton(text: 'Open', onPressed: () => setState(() => visible = true)), TxPopup(visible: visible, onVisibleChanged: (v) => setState(() => visible = v), child: const Text('Hello'))]),
);
}import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';
Future<void> open(BuildContext context) async {
final result = await TxPopup.show<bool>(context, title: 'Confirm', child: const Text('Continue?'), actions: [Builder(builder: (dialogContext) => TextButton(onPressed: () => Navigator.of(dialogContext).pop(true), child: const Text('OK')))]);
debugPrint('$result');
}