Files
zapstore/lib/utils/extensions.dart
T
2024-05-07 12:29:33 -03:00

20 lines
637 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
extension ContextX on BuildContext {
ThemeData get theme => Theme.of(this);
void showError(String message) {
showToast(
message,
duration: Duration(seconds: 5),
textStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
animDuration: Duration(milliseconds: 300),
animation: StyledToastAnimation.fade,
reverseAnimation: StyledToastAnimation.fade,
backgroundColor: Color.fromARGB(230, 244, 67, 54),
position: StyledToastPosition.center,
context: this,
);
}
}