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

>Solution :

Try replace

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

with

label: AppLocalizations.of(context).tr('Produce')

Leave a Reply