I get an error :
prefer_const_literals_to_create_immutables
on this widget:
child: Column(
children: <Widget>[
Hyperlink('https://t.me/egorka', 'chat with me'),
],
),
where class Hyperlink is defined like:
class Hyperlink extends StatelessWidget {
const Hyperlink(this._url, this._text);
final String _url;
final String _text;
I can't figure out how to change the code to get rid of it?
Your code is absolutely fine .But remove the const
keyword from the constructor.
jump to file analysis_options.yaml
add this code prefer_const_literals_to_create_immutables: false
below property rules :
then Ctrl+s
rules:
prefer_const_literals_to_create_immutables: false
prefer_typing_uninitialized_variables: false
prefer_const_constructors: false
file_names: false
another solution
child: Column(
children: <Widget> const[
Hyperlink('https://t.me/egorka', 'chat with me'),
], <enter code here>
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With