when i run this, i got this error: type 'Null' is not a subtype of type 'TextSpan'
child: SingleChildScrollView(child: Arguments_text['1']),
italic(String text) {
TextSpan(
text: text,
style: TextStyle(
fontSize: 17.0,
fontStyle: FontStyle.italic,
color: Colors.black,
),
);
}
Map<String, Column> Arguments_text = {
'1': Column(
children: [
RichText(
text: TextSpan(
children: <TextSpan>[
italic('Hello '),
italic('World'),
],
),
)
],
),
};
Someone know how can i solve this? Thanks.
Acoording to https://dart.dev/guides/language/language-tour#return-values:
Your
italic
function implicitly returns null, try this: