Profile constructor
Profile({
- Key? key,
- required double? radius,
- required String? text,
- OnPickerChange? onPickerChange,
- OnPickerChangeWeb? onPickerChangeWeb,
- OnPickerCompleted? onPickerCompleted,
- OnFilePickerCompleted? onFilePickerCompleted,
- OnBytesPickerCompleted? onBytesPickerCompleted,
- String? image,
- String? imageNetwork,
- Gradient? gradientBackgroundColor,
- double elevation = 0,
- Color? shadowColor = Colors.black,
- bool isBorderAvatar = false,
- Color? backgroundColor = Colors.green,
- BottomSheetStyles? bottomSheetStyles,
- Gradient? gradientWidthBorder = const LinearGradient(colors: [Colors.blue, Colors.deepPurple]),
- Color iconColor = Colors.black,
- double widthBorder = 5.0,
- Color backgroundColorCamera = Colors.white,
- IconData? icon = Icons.camera,
- OptionsCrop? optionsCrop,
- OptionsCropWindMacLinux? optionsCropWindMacLinux,
- TextStyle? style = const TextStyle(fontSize: 25, color: Colors.white, fontWeight: FontWeight.bold),
- bool randomColor = true,
- bool randomGradient = false,
- bool useMaterialColorForGradient = true,
- bool mixColorForGradient = false,
- Widget? child,
Implementation
Profile({
super.key,
required this.radius,
required this.text,
this.onPickerChange,
this.onPickerChangeWeb,
this.onPickerCompleted,
this.onFilePickerCompleted,
this.onBytesPickerCompleted,
this.image,
this.imageNetwork,
this.gradientBackgroundColor,
this.elevation = 0,
this.shadowColor = Colors.black,
this.isBorderAvatar = false,
this.backgroundColor = Colors.green,
this.bottomSheetStyles,
this.gradientWidthBorder = const LinearGradient(
colors: [Colors.blue, Colors.deepPurple],
),
this.iconColor = Colors.black,
this.widthBorder = 5.0,
this.backgroundColorCamera = Colors.white,
this.icon = Icons.camera,
this.optionsCrop,
this.optionsCropWindMacLinux,
this.style = const TextStyle(
fontSize: 25,
color: Colors.white,
fontWeight: FontWeight.bold,
),
bool randomColor = true,
bool randomGradient = false,
this.useMaterialColorForGradient = true,
this.mixColorForGradient = false,
this.child,
}) {
if (randomColor) {
backgroundColor = TextToColor.toColor(text);
} else if (randomGradient) {
gradientBackgroundColor = GradientRandomTools.getGradient(
text.toString(),
material: useMaterialColorForGradient,
dynamicMix: mixColorForGradient,
);
} else {
backgroundColor = backgroundColor;
}
}