-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PAINTROID-639 Make tool options disappear when tapping the tool
Fix some issues from CR
- Loading branch information
1 parent
f3bd8c3
commit 0418ca3
Showing
8 changed files
with
222 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
enum BottomNavBarItem { | ||
TOOLS, | ||
CURRENT_TOOL, | ||
COLOR, | ||
LAYERS, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ToolOption extends StatelessWidget { | ||
final bool isIgnoring; | ||
final double opacity; | ||
final Widget child; | ||
final Duration duration; | ||
|
||
const ToolOption({ | ||
Key? key, | ||
required this.isIgnoring, | ||
required this.opacity, | ||
required this.child, | ||
this.duration = const Duration(milliseconds: 300), | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return IgnorePointer( | ||
ignoring: isIgnoring, | ||
child: AnimatedOpacity( | ||
opacity: opacity, | ||
duration: duration, | ||
child: child, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:paintroid/tool/src/tool_types.dart'; | ||
import 'package:paintroid/ui/drawing_space/stroke_cap_tool_option.dart'; | ||
import 'package:paintroid/ui/drawing_space/stroke_width_tool_option.dart'; | ||
|
||
class ToolOptionsConfig { | ||
static final ToolOptionsConfig _instance = ToolOptionsConfig._internal(); | ||
|
||
factory ToolOptionsConfig() { | ||
return _instance; | ||
} | ||
|
||
ToolOptionsConfig._internal(); | ||
|
||
List<Widget> getToolSpecificOptions(ToolType toolType) { | ||
switch (toolType) { | ||
case ToolType.BRUSH: | ||
case ToolType.ERASER: | ||
return _defaultOptions; | ||
default: | ||
return []; | ||
} | ||
} | ||
|
||
final List<Widget> _defaultOptions = [ | ||
const StrokeWidthToolOption(), | ||
const Spacer(), | ||
const StrokeCapToolOption(), | ||
]; | ||
} |
4 changes: 2 additions & 2 deletions
4
.../drawing_space/tool_options_provider.dart → ...ol_options_visibility_state_provider.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.