@@ -39,33 +39,37 @@ ToastFuture showToast(
39
39
BuildContextPredicate buildContextPredicate = _defaultContextPredicate,
40
40
Duration ? duration,
41
41
ToastPosition ? position,
42
- TextStyle ? textStyle,
43
- EdgeInsetsGeometry ? textPadding,
44
42
Color ? backgroundColor,
45
43
double ? radius,
46
44
VoidCallback ? onDismiss,
47
- TextDirection ? textDirection,
48
45
bool ? dismissOtherToast,
49
- TextAlign ? textAlign,
50
46
OKToastAnimationBuilder ? animationBuilder,
51
47
Duration ? animationDuration,
52
48
Curve ? animationCurve,
53
49
BoxConstraints ? constraints,
54
50
EdgeInsetsGeometry ? margin = const EdgeInsets .all (50 ),
51
+ TextDirection ? textDirection,
52
+ EdgeInsetsGeometry ? textPadding,
53
+ TextAlign ? textAlign,
54
+ TextStyle ? textStyle,
55
+ int ? textMaxLines,
56
+ TextOverflow ? textOverflow,
55
57
}) {
56
58
if (context == null ) {
57
59
_throwIfNoContext (_contextMap.values, 'showToast' );
58
60
}
59
61
context ?? = buildContextPredicate (_contextMap.values);
60
62
61
63
final ToastTheme theme = ToastTheme .of (context);
62
- textStyle ?? = theme.textStyle;
63
- textAlign ?? = theme.textAlign;
64
- textPadding ?? = theme.textPadding;
65
64
position ?? = theme.position;
66
65
backgroundColor ?? = theme.backgroundColor;
67
66
radius ?? = theme.radius;
68
67
textDirection ?? = theme.textDirection;
68
+ textPadding ?? = theme.textPadding;
69
+ textAlign ?? = theme.textAlign;
70
+ textStyle ?? = theme.textStyle;
71
+ textMaxLines ?? = theme.textMaxLines;
72
+ textOverflow ?? = theme.textOverflow;
69
73
70
74
final Widget widget = Container (
71
75
constraints: constraints,
@@ -75,7 +79,15 @@ ToastFuture showToast(
75
79
borderRadius: BorderRadius .circular (radius),
76
80
color: backgroundColor,
77
81
),
78
- child: ClipRect (child: Text (msg, style: textStyle, textAlign: textAlign)),
82
+ child: ClipRect (
83
+ child: Text (
84
+ msg,
85
+ style: textStyle,
86
+ textAlign: textAlign,
87
+ maxLines: textMaxLines,
88
+ overflow: textOverflow,
89
+ ),
90
+ ),
79
91
);
80
92
81
93
return showToastWidget (
@@ -93,7 +105,7 @@ ToastFuture showToast(
93
105
);
94
106
}
95
107
96
- /// Show [widget] with oktoast .
108
+ /// Show a [widget] and returns a [ToastFuture] .
97
109
ToastFuture showToastWidget (
98
110
Widget widget, {
99
111
BuildContext ? context,
0 commit comments