OpenFlutter / flutter_oktoast

Toast library for Flutter.

Home Page:https://pub.dev/packages/oktoast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

oktoast: ^3.3.2, sdk: '>=2.19.2 <3.0.0', error

inprivacy opened this issue · comments

Used:
class MainApp extends StatelessWidget {
const MainApp({super.key});
@OverRide
Widget build(BuildContext context) {
return OKToast(
textStyle: const TextStyle(fontSize: 16.0, color: Colors.white),
backgroundColor: Colors.grey,
duration: const Duration(seconds: 3),
child: MaterialApp.router(
routerConfig: routes,
),
);
}
}
Another way of writing, still reporting an identical error

Error content:
/C:/Users/YFZH/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/oktoast-3.3.2/lib/src/widget/overlay.dart:582:9: Error: A cnstant constructor can't call a non-constant super constructor.
const Theatre({
^
/C:/Users/YFZH/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/oktoast-3.3.2/lib/src/widget/container.dart:96:32: Error: Mmber not found: 'MediaQueryData.fromView'.
bottom: MediaQueryData.fromView(currentView).viewInsets.bottom,
^^^^^^^^
/C:/Users/YFZH/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/oktoast-3.3.2/lib/src/widget/container.dart:94:27: Error: Te getter 'View' isn't defined for the class '_ToastContainerState'.

  • '_ToastContainerState' is from 'package:oktoast/src/core/toast.dart' ('/C:/Users/YFZH/AppData/Local/Pub/Cache/hosted/pubflutter-io.cn/oktoast-3.3.2/lib/src/core/toast.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'View'.
    final currentView = View.of(context);
    ^^^^

Duplicate of #102

Duplicate of #102

"oktoast: 3.3.1" is ok ,but "oktoast: ^3.3.1" and "oktoast: ^3.3.2" are error.