DartBlockSettings.fromBrightness constructor
DartBlockSettings.fromBrightness({
- bool canChange = true,
- bool canDelete = true,
- bool canReorder = true,
- List<
DartBlockNativeFunctionCategory> allowedNativeFunctionCategories = DartBlockNativeFunctionCategory.values, - List<
DartBlockNativeFunctionType> allowedNativeFunctionTypes = DartBlockNativeFunctionType.values, - DartBlockColors? colors,
- required Brightness brightness,
Convenience factory that automatically resolves colors based on brightness.
Implementation
factory DartBlockSettings.fromBrightness({
bool canChange = true,
bool canDelete = true,
bool canReorder = true,
List<DartBlockNativeFunctionCategory> allowedNativeFunctionCategories =
DartBlockNativeFunctionCategory.values,
List<DartBlockNativeFunctionType> allowedNativeFunctionTypes =
DartBlockNativeFunctionType.values,
DartBlockColors? colors,
required Brightness brightness,
}) {
final resolvedColors = colors ?? DartBlockColors.native();
return DartBlockSettings(
canChange: canChange,
canDelete: canDelete,
canReorder: canReorder,
allowedNativeFunctionCategories: allowedNativeFunctionCategories,
allowedNativeFunctionTypes: allowedNativeFunctionTypes,
colors: resolvedColors,
colorFamily: DartBlockColorFamily.fromColors(resolvedColors, brightness),
);
}