AppTheme constructor

AppTheme(
  1. {required String id,
  2. required ThemeData data,
  3. required String description,
  4. AppThemeOptions? options}
)

Constructs a AppTheme. data is required.

id is required and it has to be unique. Use _ separated lowercase strings. Id cannot have spaces.

options can ba any object. Use it to pass

description is optional. If not given it takes default to as 'Light Theme' or 'Dark Theme'.

Implementation

AppTheme({
  required this.id,
  required this.data,
  required this.description,
  this.options,
}) {
  assert(description.length < 30, "Theme description too long ($id)");
  assert(id.isNotEmpty, "Id cannot be empty");
  assert(id.toLowerCase() == id, "Id has to be a lowercase string");
  assert(!id.contains(" "), "Id cannot contain spaces. (Use _ for spaces)");
}