For this project the goal was to create a native app that is able to scan QR codes and open
Having developed on Swift/Android before, it has always been a nightmare to develop naively for both platforms. So i was very excited to hear about the leaps and strides within Flutter. Flutter is a fast growing SDK for cross-platform development by Google. This was my first time developing with Flutter and I was able to build & publish an application for both Android and Iphone in record time!
After hearing the requirements for this project. I recommended Flutter seeing that this would be a simple application, and that it would only require camera access. Flutter is well suited for most applications, but there are some fringe cases like game design, where it does not make sense. One barrier to entry is that Flutter apps are written in Dart. Despite being a language I had never coded in, picking up Dart was straightforward. The idea in Flutter is that everything is re-used in 'Widgets'. The slogan of flutter being 'It's All Widgets!'.
For this project, I needed to create an application with two simple functions. Scan QR codes, and display an admin web page. One great thing about Flutter is that there is an extensive package library on pub.dev. In this case there was a package called barcode_scan which made this project a breeze. I began building the UI by creating a StatefulWidget with held the state of the application.
I laid out the user interface and divided the application into two BottomNavigationBarItems "Orders" and "Scan". Each one contained the relevant widgets, which I abstracted into other file.
|Left Tab 'Orders' A Webview with access to admin functionality|
|Right Tab 'Scan' A page with a camera button, which is designed to pass parameterized links to the Orders component|
Using the Flutter CLI i was able to test the application in real-time on my Iphone 8. This was a great experience because it is much more difficult to troubleshoot camera features using device simulators. After verifying everything, I compiled and published the app to both app stores.
Overall developing for Flutter was a hassle free experience, and much more enjoyable than creating two separate applications for both platforms. I was able to build this application in a third of the time, and the Flutter CLI was very helpful.