Issue
I was trying to add different useState in my page with Flutter hook but i can't find a way to do it by giving them a type first, because of the inital value requested.
i can't initialize my useState with :
QRViewController? controller = useState();
or
final controller = useState<QRViewController>()
or
QRViewController? controller = useState(null);
How can i initialized controller with custom type ?
Solution
final ValueNotifier<QRViewController?> controller = useState(null);
Or
final controller = useState<QRViewController?>(null);
You were very close.
Answered By - Tim Jacobs
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.