What Will I Learn?
- You will learn how to build a custom painter and canvas to build out shapes and animations
- You will learn how to use aligns, aspect ratios and position fill widgets
- You will learn how to use complex custom theme data sets
Requirements
- IDEA intellij or Visual Studio Code with the Dart/Flutter Plugins
- The Dart SDK and the Flutter SDK
- A fair understanding of Mobile development and Imperative or Object Oriented Programming
- Some understanding of basic trigonometry and geometry
Difficulty
- Intermediate
Description
In this Flutter video tutorial, we build out a countdown timer application. This application makes use of a custom painter and canvas to generate two circle shapes. The first circle shape acts as a background circle and the second one slowly fills out the background circle giving the user some idea of how much time has passed.
We are able to style the application by using a theme widget inside of the main root widget. This theme data widget lets us setup the canvas color, icon theme, accent color and the brightness of the colors. We are then able to access these values through the build context in any of our widgets. We also are able to access some of the default values that come in the basic flutter theme; including the subhead and display4 text sizes.
Inside of the circles in our animation, we place three zeroes, one for the minutes and two for the passing seconds. These numbers change in real-time based on the amount of time that is set for the duration of our animation. This means that if the animation runs for 240 seconds, then the countdown will count from 4 minutes to 0 seconds.
Our layout makes use of some new widgets; the positioned fill widget, the align widget, and the aspect ratio widget. Each of these widgets focus on one specific property. The position fill widget lets us will up a stack by default by setting the position properties to 0.0 by default. The align widget is a container with a focus on the alignment property and the aspect ratio widget is a container with a focus on the aspect ratio property.
The source code for this project can be found here
Video Tutorial
Curriculum
- Dart Flutter Cross Platform Chat Application Tutorial
- Building a Multi-Page Application with Dart's Flutter Mobile Framework
- Making Http requests and Using Json in Dart's Flutter Framework
- Building Dynamic Lists with Streams in Dart's Flutter Framework
- Using GridView, Tabs, and Steppers in Dart's Flutter Framework
- Using Global Keys to get State and Validate Input in Dart's Flutter Framework
- The Basics of Animation with Dart's Flutter Framework
- Advanced Physics Based Animations in Dart's Flutter Framework
- Building a Drag and Drop Application with Dart's Flutter Framework
- Building a Hero Animation and an Application Drawer in Dart's Flutter Framework
- Building a Temperature Conversion Application using Dart's Flutter Framework
- Using Inherited Widgets and Gesture Detectors in Dart's Flutter Framework
- Using Gradients, Fractional Offsets, Page Views and Other Widgets in Dart's Flutter Framework
- Building a Calculator Layout using Dart's Flutter Framework
- Finishing our Calculator Application with Dart's Flutter Framework
- Making use of Shared Preferences, Flex Widgets and Dismissibles with Dart's Flutter framework
- Using the Different Style Widgets and Properties in Dart's Flutter Framework
- Composing Animations and Chaining Animations in Dart's Flutter Framework
Posted on Utopian.io - Rewarding Open Source Contributors