PersistentBottomNavBar icon indicating copy to clipboard operation
PersistentBottomNavBar copied to clipboard

Flutter 3.22.2-stable The getter 'backgroundColor' isn't defined for the class 'ThemeData'

Open sniperxenocide opened this issue 1 year ago • 3 comments

I encountered this error while building my app for android.

/C:/Users/DELL/AppData/Local/Pub/Cache/hosted/pub.dev/persistent_bottom_nav_bar-5.0.2/lib/neumorphic_package_by_serge_software/neumorphic_card.dart:57:57: Error: The getter 'backgroundColor' isn't defined for the class 'ThemeData'.

  • 'ThemeData' is from 'package:flutter/src/material/theme_data.dart' ('flutter_windows_3.22.2-stable/flutter/packages/flutter/lib/src/material/theme_data.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'backgroundColor'. final color = decoration.color ?? Theme.of(context).backgroundColor; ^^^^^^^^^^^^^^^

sniperxenocide avatar Jun 24 '24 03:06 sniperxenocide

Three PR's have been opened to fix this issue, I hope it gets solved soon.

  • https://github.com/BilalShahid13/PersistentBottomNavBar/pull/363
  • https://github.com/BilalShahid13/PersistentBottomNavBar/pull/364
  • https://github.com/BilalShahid13/PersistentBottomNavBar/pull/365

SilkeAtSiip avatar Jun 24 '24 13:06 SilkeAtSiip

I forked this repository and added the fix for Flutter 3.22. If you want to use in your project, take from here https://pub.dev/packages/persistent_bottom_nav_bar_2

ElyasAsmad avatar Jun 27 '24 21:06 ElyasAsmad

/C:/Users/DELL/AppData/Local/Pub/Cache/hosted/pub.dev/persistent_bottom_nav_bar-5.0.2/lib/neumorphic_package_by_serge_software/neumorphic_card.dart:57:57 go to this file and replace it

Replace:

final color = decoration.color ?? Theme.of(context).backgroundColor;

With:

final color = decoration.color ?? Theme.of(context).colorScheme.background;

naidu199 avatar Aug 02 '24 11:08 naidu199