@@ -35,13 +35,13 @@ class Toaster {
3535 child: Container (
3636 alignment: Alignment .topCenter,
3737 padding: EdgeInsets .only (
38- top: 640. wmax * 10. sr ,
39- left: 640. wmax * 20. sr ,
40- right: 640. wmax * 15. sr ,
41- bottom: 640. wmax * 10. sr ,
38+ top: 10. vp ,
39+ left: 20. vp ,
40+ right: 15. vp ,
41+ bottom: 10. vp ,
4242 ),
4343 decoration: BoxDecoration (
44- borderRadius: BorderRadius .circular (640. wmax * 32. sr ),
44+ borderRadius: BorderRadius .circular (32. vp ),
4545 color: Colors .redAccent,
4646 ),
4747 child: Row (
@@ -52,14 +52,14 @@ class Toaster {
5252 behavior: HitTestBehavior .opaque,
5353 child: Container (
5454 alignment: Alignment .center,
55- padding: EdgeInsets .only (left: 640. wmax * 10. sr ),
55+ padding: EdgeInsets .only (left: 10. vp ),
5656 child: IntrinsicWidth (
5757 child: Text (
5858 message! ,
5959 style: TextStyle (
60- fontSize: 640. wmax * 14. sr,
61- fontWeight: FontWeight .w600,
6260 color: Colors .white,
61+ fontWeight: FontWeight .w600,
62+ fontSize: 14. fp,
6363 height: 1.3 ,
6464 ),
6565 ),
@@ -74,11 +74,11 @@ class Toaster {
7474 ),
7575 ),
7676 SizedBox (
77- width: 640. wmax * 24. sr ,
78- height: 640. wmax * 24. sr ,
77+ width: 24. vp ,
78+ height: 24. vp ,
7979 child: IconButton (
8080 color: Colors .white,
81- iconSize: 640. wmax * 24. sr ,
81+ iconSize: 24. vp ,
8282 padding: const EdgeInsets .all (0 ),
8383 icon: const Icon (Icons .close),
8484 onPressed: () => fToast.removeCustomToast (),
@@ -90,9 +90,9 @@ class Toaster {
9090 toastDuration: duration ?? const Duration (seconds: 3 ),
9191 positionedToastBuilder: (context, child, gravity) {
9292 return Positioned (
93- top: max (640. wmax * 48. sr , mediaPadding.top + 640. wmax * 6. sr ),
94- left: 640. wmax * 20. sr ,
95- right: 640. wmax * 20. sr ,
93+ top: max (48. vp , mediaPadding.top + 6. vp ),
94+ left: 20. vp ,
95+ right: 20. vp ,
9696 child: child,
9797 );
9898 },
@@ -127,13 +127,13 @@ class Toaster {
127127 child: Container (
128128 alignment: Alignment .topCenter,
129129 padding: EdgeInsets .only (
130- top: 640. wmax * 10. sr ,
131- left: 640. wmax * 20. sr ,
132- right: 640. wmax * 15. sr ,
133- bottom: 640. wmax * 10. sr ,
130+ top: 10. vp ,
131+ left: 20. vp ,
132+ right: 15. vp ,
133+ bottom: 10. vp ,
134134 ),
135135 decoration: BoxDecoration (
136- borderRadius: BorderRadius .circular (640. wmax * 32. sr ),
136+ borderRadius: BorderRadius .circular (32. vp ),
137137 color: Color (0xffffc107 ),
138138 ),
139139 child: Row (
@@ -144,14 +144,14 @@ class Toaster {
144144 behavior: HitTestBehavior .opaque,
145145 child: Container (
146146 alignment: Alignment .center,
147- padding: EdgeInsets .only (left: 640. wmax * 10. sr ),
147+ padding: EdgeInsets .only (left: 10. vp ),
148148 child: IntrinsicWidth (
149149 child: Text (
150150 message! ,
151151 style: TextStyle (
152- fontSize: 640. wmax * 14. sr,
153- fontWeight: FontWeight .w600,
154152 color: Colors .white,
153+ fontWeight: FontWeight .w600,
154+ fontSize: 14. fp,
155155 height: 1.3 ,
156156 ),
157157 ),
@@ -166,11 +166,11 @@ class Toaster {
166166 ),
167167 ),
168168 SizedBox (
169- width: 640. wmax * 24. sr ,
170- height: 640. wmax * 24. sr ,
169+ width: 24. vp ,
170+ height: 24. vp ,
171171 child: IconButton (
172172 color: Colors .white,
173- iconSize: 640. wmax * 24. sr ,
173+ iconSize: 24. vp ,
174174 padding: const EdgeInsets .all (0 ),
175175 icon: const Icon (Icons .error_outline),
176176 onPressed: () => fToast.removeCustomToast (),
@@ -182,9 +182,9 @@ class Toaster {
182182 toastDuration: duration ?? const Duration (seconds: 3 ),
183183 positionedToastBuilder: (context, child, gravity) {
184184 return Positioned (
185- top: max (640. wmax * 48. sr , mediaPadding.top + 640. wmax * 6. sr ),
186- left: 640. wmax * 20. sr ,
187- right: 640. wmax * 20. sr ,
185+ top: max (48. vp , mediaPadding.top + 6. vp ),
186+ left: 20. vp ,
187+ right: 20. vp ,
188188 child: child,
189189 );
190190 },
@@ -219,13 +219,13 @@ class Toaster {
219219 child: Container (
220220 alignment: Alignment .topCenter,
221221 padding: EdgeInsets .only (
222- top: 640. wmax * 10. sr ,
223- left: 640. wmax * 20. sr ,
224- right: 640. wmax * 15. sr ,
225- bottom: 640. wmax * 10. sr ,
222+ top: 10. vp ,
223+ left: 20. vp ,
224+ right: 15. vp ,
225+ bottom: 10. vp ,
226226 ),
227227 decoration: BoxDecoration (
228- borderRadius: BorderRadius .circular (640. wmax * 32. sr ),
228+ borderRadius: BorderRadius .circular (32. vp ),
229229 color: const Color (0xff52c41b ),
230230 ),
231231 child: Row (
@@ -236,14 +236,14 @@ class Toaster {
236236 behavior: HitTestBehavior .opaque,
237237 child: Container (
238238 alignment: Alignment .center,
239- padding: EdgeInsets .only (left: 640. wmax * 10. sr ),
239+ padding: EdgeInsets .only (left: 10. vp ),
240240 child: IntrinsicWidth (
241241 child: Text (
242242 message! ,
243243 style: TextStyle (
244- fontSize: 640. wmax * 14. sr,
245- fontWeight: FontWeight .w600,
246244 color: Colors .white,
245+ fontWeight: FontWeight .w600,
246+ fontSize: 14. fp,
247247 height: 1.3 ,
248248 ),
249249 ),
@@ -258,11 +258,11 @@ class Toaster {
258258 ),
259259 ),
260260 SizedBox (
261- width: 640. wmax * 24. sr ,
262- height: 640. wmax * 24. sr ,
261+ width: 24. vp ,
262+ height: 24. vp ,
263263 child: IconButton (
264+ iconSize: 24. vp,
264265 color: Colors .white,
265- iconSize: 640. wmax * 24. sr,
266266 padding: const EdgeInsets .all (0 ),
267267 icon: const Icon (Icons .check),
268268 onPressed: () => fToast.removeCustomToast (),
@@ -274,9 +274,9 @@ class Toaster {
274274 toastDuration: duration ?? const Duration (seconds: 3 ),
275275 positionedToastBuilder: (context, child, gravity) {
276276 return Positioned (
277- top: max (640. wmax * 48. sr , mediaPadding.top + 640. wmax * 6. sr ),
278- left: 640. wmax * 20. sr ,
279- right: 640. wmax * 20. sr ,
277+ top: max (48. vp , mediaPadding.top + 6. vp ),
278+ left: 20. vp ,
279+ right: 20. vp ,
280280 child: child,
281281 );
282282 },
0 commit comments