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

TxToast.

Interactive preview

Timed status message; accept visibility changes in the application.

TxToast

ParameterTypeDefaultMeaning
visibleboolrequiredControls visibility.
messageStringrequiredNotification text.
onVisibleChangedValueChanged<bool>?nullReports visible; update controlled state in the callback.
typeTxToastTypeTxToastType.infoAppearance/input type; see the signature for allowed values.
displayTimeDurationconst Duration(milliseconds: 3500)Display duration; 0 or Duration.zero stays open.
Member / type / returnMeaning
static void show(BuildContext context, String message, {TxToastType type = TxToastType.info, Duration displayTime = const Duration(milliseconds: 3500)})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: 'Notify', onPressed: () => setState(() => visible = true)), TxToast(visible: visible, message: 'Saved', onVisibleChanged: (v) => setState(() => visible = v))]),
  );
}
dart
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';

void showToast(BuildContext context) {
  TxToast.show(context, 'Saved', type: TxToastType.success);
}