remixie / Blueprint-Touch

A technical drawing app
Apache License 2.0
4 stars 0 forks source link

Blueprint Touch

Hey everyone. I'm Remixie and this is my entry for the Flutter Create contest. It's a technical drawing app that's optimized for touchscreen devices.

Tech Specs

Visual Layout

Layout of Blueprint Touch!

Setup

  1. Make a new Flutter Project (Flutter Application) in Android Studio
  2. Replace the generated main.dart file with the one provided in the zip file
  3. Replace the generated pubspec.yaml with the one provided in the zip file
  4. Make an assets directory in the same directory as lib
  5. Move Blueprint-Paper-by-RetinaShots.png to the assets directory
  6. Click packages get while in the pubspec.yaml tab and verify that nothing is underlined with red in main.dart upon saving it
  7. Run flutter run --release -d <device id> on the Flutter project directory but not before replacing <device id>

Usage Guide

Note: If you tap on the straightedge at around the same coordinates where an existing point is located, your tap will be registered as a reuse, not as a new point aligned with the straightedge.

Execution Notes

In terms of UI/UX, tons of details were taken into account. These are some of them:

Documentation

The main() function runs MyApp.
MyApp is a StatelessWidget that builds a MaterialApp whose home property is set to DrawPage.
DrawPage is a StatefulWidget that builds ScopedModel<MathModel> and returns a Scaffold.

The Scaffold returns a Stack widget whose children are a Container and another Stack. The Container has a Listener that detects when a user taps on it and calls MathModel.moveSEdge() and Painter. Its background is set to the public domain grid image asset provided by Retina Shots. The child Stack returns two instances of DragDot.

DragDot

This is a Stateful widget that creates a DragDotState.

DragDotState

This builds a Container that has a GestureDetector child.
This GestureDetector calls MathModel.moveSEdge() so this dot moves properly as an end-user drags it around.

MathModel

This handles the model logic.

Painter

This is a CustomPainter class that handles the rendering of blueprint paper objects.

Roadmap

Blueprint Touch has a long way to go before it becomes the standard for technical drawings on touchscreen devices. This is the current list of future developments, ordered by priority:

  1. A protractor tool for making exact angles
  2. The addition of non-obstrusive labels and measurements
  3. An eraser tool to delete a particular line segment or point
  4. Transform the blueprint paper area to be a zoomable viewport

ETA for these developments: Q3 2019

References

boeledi. (2018, March 21). Flutter: how to prevent device orientation changes and force portrait? Retrieved March 21, 2019, from https://stackoverflow.com/questions/44179889/flutter-sdk-set-background-image

Bourne, M. (n.d.). Perpendicular Distance from a Point to a Line. Retrieved March 21, 2019, from https://www.intmath.com/plane-analytic-geometry/perpendicular-distance-point-line.php

Choudhary, H. (2018, September 05). Installation of Flutter and setup on MAC. Retrieved March 22, 2019, from https://www.youtube.com/watch?v=Xy-qHlaHr6c

Kumar, A. (2017, May 25). Flutter SDK Set Background image. Retrieved March 20, 2019, from https://stackoverflow.com/questions/44179889/flutter-sdk-set-background-image

Rumann. (2019, January 22). Drawing Custom Shapes in Flutter using a Custom Painter. Retrieved from https://zocada.com/drawing-custom-shapes-in-flutter-using-custompainter/

SnakeyHips. (2018, December 15). SnakeyHips/drawapp. Retrieved March 10, 2019, from https://github.com/SnakeyHips/drawapp

Stacky. (2014, November 2). How to calculate corner positions/marks of a rotated/tilted rectangle? Retrieved March 11, 2019, from https://gamedev.stackexchange.com/questions/86755/how-to-calculate-corner-positions-marks-of-a-rotated-tilted-rectangle

StrokeCap property. (n.d.). Retrieved March 20, 2019, from https://docs.flutter.io/flutter/dart-ui/Paint/strokeCap.html

Write your first Flutter app, part 1. (n.d.). Retrieved March 1, 2019, from https://flutter.dev/docs/get-started/codelab

Write Your First Flutter App, part 2. (n.d.). Retrieved March 3, 2019, from https://codelabs.developers.google.com/codelabs/first-flutter-app-pt2/

Xia, M., Sullivan, M., & Williams, J. (n.d.). Build Native Mobile Apps with Flutter. Retrieved March 6, 2019, from https://www.udacity.com/course/build-native-mobile-apps-with-flutter--ud905