I have dart class for app's state, I want to be able to set the state of this flutter's app after its built and embedded in a react app.
I have made this app using FlutterFlow and this class is also generated one. I want to modify it to use @JSExport so that I can pass the state object in some event listener as listen it on react side.
import 'package:flutter/material.dart';
class FFAppState extends ChangeNotifier {
static FFAppState _instance = FFAppState._internal();
factory FFAppState() {
return _instance;
}
FFAppState._internal();
static void reset() {
_instance = FFAppState._internal();
}
Future initializePersistedState() async {}
void update(VoidCallback callback) {
callback();
notifyListeners();
}
int _counter = 0;
int get counter => _counter;
set counter(int value) {
_counter = value;
}
}