-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rfac: full refactor; removed flutter hooks
- Loading branch information
Showing
47 changed files
with
2,494 additions
and
1,342 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,24 +1,9 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_drawing_board/view/drawing_page.dart'; | ||
import 'package:flutter_drawing_board/src/src.dart'; | ||
|
||
void main() { | ||
runApp(const MyApp()); | ||
runApp(const LetsDrawApp()); | ||
} | ||
|
||
const Color kCanvasColor = Color(0xfff2f3f7); | ||
const String kGithubRepo = 'https://github.com/JideGuru/flutter_drawing_board'; | ||
|
||
class MyApp extends StatelessWidget { | ||
const MyApp({super.key}); | ||
|
||
// This widget is the root of your application. | ||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
title: 'Let\'s Draw', | ||
theme: ThemeData(primarySwatch: Colors.blue, useMaterial3: false), | ||
debugShowCheckedModeBanner: false, | ||
home: const DrawingPage(), | ||
); | ||
} | ||
} |
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 @@ | ||
export 'values.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
double markerDefaultOpacity = 0.7; | ||
double markerDefaultSize = 25; |
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 @@ | ||
export 'models/models.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_drawing_board/src/src.dart'; | ||
|
||
class DrawingCanvasOptions { | ||
final Color strokeColor; | ||
final double size; | ||
final double opacity; | ||
final DrawingTool currentTool; | ||
final Color backgroundColor; | ||
final bool showGrid; | ||
final int polygonSides; | ||
final bool fillShape; | ||
|
||
const DrawingCanvasOptions({ | ||
this.strokeColor = blackAccent, | ||
this.size = 10, | ||
this.opacity = 1, | ||
this.currentTool = DrawingTool.pencil, | ||
this.backgroundColor = lightAccent, | ||
this.showGrid = false, | ||
this.polygonSides = 3, | ||
this.fillShape = false, | ||
}); | ||
|
||
DrawingCanvasOptions copyWith({ | ||
Color? strokeColor, | ||
double? size, | ||
double? opacity, | ||
DrawingTool? currentTool, | ||
Color? backgroundColor, | ||
bool? showGrid, | ||
int? polygonSides, | ||
bool? fillShape, | ||
}) { | ||
return DrawingCanvasOptions( | ||
strokeColor: strokeColor ?? this.strokeColor, | ||
size: size ?? this.size, | ||
opacity: opacity ?? this.opacity, | ||
currentTool: currentTool ?? this.currentTool, | ||
backgroundColor: backgroundColor ?? this.backgroundColor, | ||
showGrid: showGrid ?? this.showGrid, | ||
polygonSides: polygonSides ?? this.polygonSides, | ||
fillShape: fillShape ?? this.fillShape, | ||
); | ||
} | ||
} |
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,19 @@ | ||
enum DrawingTool { | ||
pencil, | ||
marker, | ||
fill, | ||
line, | ||
eraser, | ||
polygon, | ||
square, | ||
circle; | ||
|
||
bool get isEraser => this == DrawingTool.eraser; | ||
bool get isLine => this == DrawingTool.line; | ||
bool get isFill => this == DrawingTool.fill; | ||
bool get isMarker => this == DrawingTool.marker; | ||
bool get isPencil => this == DrawingTool.pencil; | ||
bool get isPolygon => this == DrawingTool.polygon; | ||
bool get isSquare => this == DrawingTool.square; | ||
bool get isCircle => this == DrawingTool.circle; | ||
} |
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,5 @@ | ||
export 'drawing_canvas_options.dart'; | ||
export 'drawing_tool.dart'; | ||
export 'stroke.dart'; | ||
export 'tool_type.dart'; | ||
export 'undo_redo_stack.dart'; |
Oops, something went wrong.