选择线条颜色

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