I am an absolute beginner in Flutter Development. I have tried different combinations and searched a lot on web but due to the unawareness of Flutter norms I am unable to understand the differences even from my implementations.

I would request you to please clear the differences including their best uses.


Solution 1: Jay Mungara

A primary color is the color displayed most frequently across your app’s screens and components.

An Accent color(also known as secondary color) provides more ways to accent and distinguish your product. Accent colors are generally applied to: -Floating action buttons -Selection controls, like sliders and switches -Highlighting selected text -Progress bars -Links and headlines

Also, you should read out the ThemeData Class To understand how themes, colors and styles works and applies to the different widgets and pages in the flutter.

Theme Data has lots of properties like primarySwatch, accentColor, primaryColor, buttonColor and what not? You can checkout each one to briefly understand the material structure applies to the app themes and styles in the flutter.


Solution 2: Ravinder Kumar

Primary color

A primary color is the color displayed most frequently across your app’s screens and components.If you don’t have a secondary color, your primary color can also be used to accent elements.

enter image description here


Secondary color

Accent color is also known as Secondary color.

A secondary color provides more ways to accent and distinguish your product. Having a secondary color is optional, and should be applied sparingly to accent select parts of your UI.

Secondary colors are best for:

  • Floating action buttons
  • Selection controls, like sliders and switches
  • Highlighting selected text
  • Progress bars
  • Links and headlines

To read more head over to official link

enter image description here


How to declare theme in Flutter App?

  runApp(MaterialApp(
    theme: ThemeData(
      // Define the default brightness and colors.
      brightness: Brightness.light,
      primaryColor: Colors.lightBlue[800],
      accentColor: Colors.cyan[600],
    ),