-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #370
- Loading branch information
Showing
7 changed files
with
82 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,33 @@ | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:saber/data/prefs.dart'; | ||
|
||
class Tool { | ||
abstract class Tool { | ||
@protected | ||
@visibleForTesting | ||
const Tool(); | ||
|
||
static const Tool textEditing = Tool(); | ||
/// An identifier for the tool, | ||
/// used to save the last-used tool in [Prefs.lastTool]. | ||
ToolId get toolId; | ||
|
||
static const Tool textEditing = _TextEditingTool(); | ||
} | ||
|
||
class _TextEditingTool extends Tool { | ||
const _TextEditingTool(); | ||
|
||
@override | ||
ToolId get toolId => ToolId.textEditing; | ||
} | ||
|
||
enum ToolId { | ||
fountainPen('fountainPen'), | ||
ballpointPen('ballpointPen'), | ||
highlighter('Highlighter'), | ||
eraser('Eraser'), | ||
select('Select'), | ||
textEditing('TextEditingTool'); | ||
|
||
final String id; | ||
const ToolId(this.id); | ||
} |
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
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
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