theme static method

dynamic theme({
  1. required dynamic context,
  2. required dynamic darkTheme,
  3. required dynamic lightTheme,
})

Implementation

static theme({required context, required darkTheme, required lightTheme}) {
  // In data get the  value of light and dark theme and return  to user
  var data = Theme.of(context).brightness == Brightness.light
      ? lightTheme
      : darkTheme;

  //return the data
  return data;
}