I want to add a text widget to the body if no data was return. Otherwise, I want to display the data. However, the following error is returned:
flutter: type '_CompactLinkedHashSet<Widget>' is not a subtype of type 'Widget'
My Code:
body: SafeArea(
child: (isLoading)
? Center(
child: new CircularProgressIndicator(),
)
: Stack(
children: <Widget>[
(jobDetail == null && !isLoading)
? noDataFound()
: {
detailWidget(context, jobDetail),
applyWidget(context, jobDetail)
}
],
),
),
This is my code for the text widget
Widget noDataFound() {
return Container(
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"We could not get the detail. Please try again later",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
),
)),
);
}