openLineWeightBottomSheet method
void
openLineWeightBottomSheet()
Opens a bottom sheet to adjust the line weight when drawing.
Implementation
void openLineWeightBottomSheet() {
showModalBottomSheet(
context: context,
backgroundColor:
imageEditorTheme.paintingEditor.lineWidthBottomSheetColor,
builder: (BuildContext context) {
return StatefulBuilder(builder: (context, setState) {
return Material(
color: Colors.transparent,
textStyle: platformTextStyle(context, designMode),
child: SingleChildScrollView(
physics: const ClampingScrollPhysics(),
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
BottomSheetHeaderRow(
title: i18n.paintEditor.lineWidth,
theme: initConfigs.theme,
textStyle: imageEditorTheme
.paintingEditor.lineWidthBottomSheetTitle,
closeButton:
customWidgets.paintEditorLineWidthCloseButton,
),
StatefulBuilder(builder: (context, setState) {
if (customWidgets.sliderPaintEditorLineWidth != null) {
return customWidgets.sliderPaintEditorLineWidth!(
_paintCtrl.strokeWidth, (value) {
setStrokeWidth(value);
setState(() {});
}, (onChangedEnd) {});
}
return Slider.adaptive(
max: 40,
min: 2,
divisions: 19,
value: _paintCtrl.strokeWidth,
onChanged: (value) {
setStrokeWidth(value);
setState(() {});
},
);
}),
],
),
),
),
);
});
},
);
}