选择线条颜色

This commit is contained in:
toly
2023-05-09 08:41:11 +08:00
parent 2f9e47cddc
commit d3b48e094c

View File

@@ -34,15 +34,15 @@ class _PaperState extends State<Paper> {
Colors.purple,
Colors.pink,
// Colors.grey,
// Colors.redAccent,
// Colors.orangeAccent,
// Colors.yellowAccent,
// Colors.greenAccent,
// Colors.blueAccent,
// Colors.indigoAccent,
// Colors.purpleAccent,
// Colors.pinkAccent,
Colors.grey,
Colors.redAccent,
Colors.orangeAccent,
Colors.yellowAccent,
Colors.greenAccent,
Colors.blueAccent,
Colors.indigoAccent,
Colors.purpleAccent,
Colors.pinkAccent,
];
// 支持的线粗
@@ -55,7 +55,6 @@ class _PaperState extends State<Paper> {
onClear: _showClearDialog,
),
body: Stack(
alignment: Alignment.bottomLeft,
children: [
GestureDetector(
onPanStart: _onPanStart,
@@ -65,23 +64,26 @@ class _PaperState extends State<Paper> {
child: ConstrainedBox(constraints: const BoxConstraints.expand()),
),
),
Positioned(
bottom: 40,
child: ColorSelector(
supportColors: supportColors,
activeIndex: _activeColorIndex,
onSelect: _onSelectColor,
),
),
Positioned(
bottom: 0,
right: 10,
child: StorkWidthSelector(
supportStorkWidths: supportStorkWidths,
color: supportColors[_activeColorIndex],
activeIndex: _activeStorkWidthIndex,
onSelect: _onSelectStorkWidth,
)
width: MediaQuery.of(context).size.width,
child: Row(
children: [
Expanded(
child: ColorSelector(
supportColors: supportColors,
activeIndex: _activeColorIndex,
onSelect: _onSelectColor,
),
),
StorkWidthSelector(
supportStorkWidths: supportStorkWidths,
color: supportColors[_activeColorIndex],
activeIndex: _activeStorkWidthIndex,
onSelect: _onSelectStorkWidth,
),
],
),
),
],
),