Handle for closing or updating an existing notification.
TxNotifyHandle
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| close | VoidCallback | required | Closes the associated notification. |
| update | void Function({String? message, TxToastType? type, Duration? displayTime}) | required | Updates a notification or record. |
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';
Future<void> example() async {
// Obtain the handle inside a widget callback, below MaterialApp.
void showMessage(BuildContext context) {
final handle = txNotify(context, message: 'Working', displayTime: Duration.zero);
handle.update(message: 'Done', type: TxToastType.success);
handle.close();
}
print(showMessage);
}