here is my code.
class _ChatbotScreenState extends State<ChatbotScreen> {
DialogFlowtter? dialogFlowtter;
final TextEditingController _controller = TextEditingController();
List<Map<String, dynamic>> messages = [];
@override
void initState() {
DialogFlowtter.fromFile().then((instance) => dialogFlowtter = instance); // here
super.initState();
}
@override
Widget build(BuildContext context) {
.....
the error is, The method 'fromFile' isn't defined for the type 'DialogFlowtter'. Try correcting the name to the name of an existing method, or defining a method named 'fromFile'.
Added the json file to assets.
I added, the package 'dialog_flowtter: ' and import 'package:dialog_flowtter/dialog_flowtter.dart';