'"HexColor" is not defined flutterc

Performing hot restart...
Syncing files to device sdk gphone x86 arm...
Error: Couldn't resolve the package 'hexcolor' in 'package:hexcolor/hexcolor.dart'.
lib/screens/home.dart:2:8: Error: Error when reading 'lib/widgets/left_bar.dart': The system cannot find the path specified.

import 'package:bmi/widgets/left_bar.dart';
       ^
lib/screens/home.dart:3:8: Error: Error when reading 'lib/widgets/right_bar.dart': The system cannot find the path specified.

import 'package:bmi/widgets/right_bar.dart';
       ^
lib/constants/app_constants.dart:2:8: Error: Not found: 'package:hexcolor/hexcolor.dart'
import 'package:hexcolor/hexcolor.dart';
       ^
lib/screens/home.dart:135:15: Error: The method 'LeftBar' isn't defined for the class '_HomeScreenState'.
 - '_HomeScreenState' is from 'package:bmi/screens/home.dart' ('lib/screens/home.dart').
Try correcting the name to the name of an existing method, or defining a method named 'LeftBar'.
              LeftBar(
              ^^^^^^^
lib/screens/home.dart:141:15: Error: The method 'LeftBar' isn't defined for the class '_HomeScreenState'.
 - '_HomeScreenState' is from 'package:bmi/screens/home.dart' ('lib/screens/home.dart').
Try correcting the name to the name of an existing method, or defining a method named 'LeftBar'.
              LeftBar(barWidth: 70),
              ^^^^^^^
lib/screens/home.dart:145:15: Error: The method 'LeftBar' isn't defined for the class '_HomeScreenState'.
 - '_HomeScreenState' is from 'package:bmi/screens/home.dart' ('lib/screens/home.dart').
Try correcting the name to the name of an existing method, or defining a method named 'LeftBar'.
              LeftBar(
              ^^^^^^^
lib/screens/home.dart:151:15: Error: The method 'RightBar' isn't defined for the class '_HomeScreenState'.
 - '_HomeScreenState' is from 'package:bmi/screens/home.dart' ('lib/screens/home.dart').
Try correcting the name to the name of an existing method, or defining a method named 'RightBar'.
              RightBar(barWidth: 70),
              ^^^^^^^^
lib/screens/home.dart:155:15: Error: The method 'RightBar' isn't defined for the class '_HomeScreenState'.
 - '_HomeScreenState' is from 'package:bmi/screens/home.dart' ('lib/screens/home.dart').
Try correcting the name to the name of an existing method, or defining a method named 'RightBar'.
              RightBar(barWidth: 70),
              ^^^^^^^^
lib/constants/app_constants.dart:4:28: Error: Method not found: 'HexColor'.
final Color mainHexColor = HexColor("#1C1C1C");
                           ^^^^^^^^
lib/constants/app_constants.dart:5:30: Error: Method not found: 'HexColor'.
final Color accentHexColor = HexColor("#FCC91C");
                             ^^^^^^^^
Restarted application in 621ms.

![https://i.stack.imgur.com/sJzJN.png]



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source