Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter mobile app dev- "the named parameter title' isn't defined. I have change it to label" but still getting error. What would be the problem?

This is the code:
Have changed title to label as below. But Text(….) was all highlighted in red. Error – "the argument type ‘Text’ can’t be assigned to the parameter type ‘String’."

    @override
 Widget build(BuildContext context) {
        var data = EasyLocalizationProvider.of(context).data;
  return EasyLocalizationProvider(
          data: data,
      child: Scaffold(
     body: callPage(currentIndex),
     bottomNavigationBar: Theme(
         data: Theme.of(context).copyWith(
             canvasColor: Colors.white,
             textTheme: Theme.of(context).textTheme.copyWith(
                 caption: TextStyle(color: Colors.black26.withOpacity(0.15)))),
         child: BottomNavigationBar(
          type: BottomNavigationBarType.fixed,
          currentIndex: currentIndex,
          fixedColor: Color(0xFF6991C7),
          onTap: (value) {
           currentIndex = value;
           setState(() {});
          },
BottomNavigationBarItem(
               icon: Icon(Icons.shop),
               label: Text(
                 AppLocalizations.of(context).tr('Produce'),
                style: TextStyle(fontFamily: "Berlin", letterSpacing: 0.5),
               )),

Error image

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try replace

label: Text(
   AppLocalizations.of(context).tr('Produce'),
   style: TextStyle(fontFamily: "Berlin", letterSpacing: 0.5),
),

with

label: AppLocalizations.of(context).tr('Produce')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading