Hello everyone I am using the Get.to(Page()) and when I navigate to the page I get the following error and I don't understand why:
Error:
======== Exception caught by widgets library
=======================================================
The following TypeErrorImpl was thrown building personalDocs$(dirty, state: _personalDocsState#333f6):
Expected a value of type 'String', but got one of type 'Null'
The relevant error-causing widget was:
personalDocs$ personalDocs:file:///home/ivanoiupaul/StudioProjects/hipt/lib/DashBoardControl/userData.dart:152:32
When the exception was thrown, this was the stack:
I will attach the userData.dart so you can see were it gives me the error:
TextButton(
onPressed: () async {
userDataForPersonalData = await getData(userDataID);
Get.to(personalDocs());
},
child: ContainerCustom(
MediaQuery.of(context).size.width / 2,
100,
25,
"PERSONAL DOCUMENTS",
FontWeight.w600),
),
Now I will attach the page where it goes to:
class _personalDocsState extends State<personalDocs> {
bool? enabledd = false;
Map<String, dynamic>? userDataToSendToDashBoard3 = {};
@override
void initState() {
// TODO: implement initState
super.initState();
() async {
userDataToSendToDashBoard3 = await getData(userDataID);
setState(() {});
}();
}
@override
Can anyone indicate me what I am doing wrong ? Thank you