t×tecexpressby TeKOcloud
DEv0.7.1
Navigation & feedback / FLUTTER

TxPopup.

Interactive preview

Dialog with a title and content. Before-events can be cancelled synchronously; external visibility remains authoritative.

TxPopup

ParameterTypeDefaultMeaning
visibleboolrequiredControls visibility.
childWidgetrequiredContent or target widget.
titleString'Dialog'View title.
actionsList<Widget>const []Dialog or card actions.
onVisibleChangedValueChanged<bool>?nullReports visible; update controlled state in the callback.
onShownVoidCallback?nullAfter showing, without a payload.
onHiddenVoidCallback?nullAfter hiding, without a payload.
showCloseButtonbooltrueShows a close action.
hideOnOutsideClickboolfalseAllows closing by clicking outside.
widthdouble480Width; Vue numbers use pixels, Flutter uses logical pixels.
heightdouble?nullHeight; Vue numbers use pixels, Flutter uses logical pixels.
fullScreenboolfalseFills the screen.
dragEnabledboolfalseAllows dragging the dialog.
resizeEnabledboolfalseAllows resizing the dialog.
alignmentAlignmentAlignment.centerContent alignment.
onShowingValueChanged<TxChange<bool>>?nullBefore showing: TxChange<bool>; set cancel synchronously to abort.
onHidingValueChanged<TxChange<bool>>?nullBefore user-initiated closing: TxChange<bool>; synchronously cancellable.
Member / type / returnMeaning
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.
dart
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'))]),
  );
}
dart
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');
}