i am trying to change the primary color based on a string value , meaning if the string value is this then main color = this , else main color =that color i have a color.dart file with this code:
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
Color mainColor = Color(0xfff04592);
and i have a string value stored in a class.
what i dont understand is how can i use conditional statement "if" in the colors.dart file ? like this :
if (value=='asd')
{mainColor = Color(0xfff04592);}
else
{mainColor = Color(0xfff09245);}