Marks Dart and Flutter Blog RSS
Google Flutter - Hot Restarting and Reloading
Introduction This is a very short chapter, but it contains valuable information that you will use all the time. When are running a Flutter app and you make code changes, you can tell your editor to reload them. That is the subject of this chapter. Hot Reloads In fact, one of the great things about Dart is its ability to hot reload code. The Official Documentation Says: Flutter’s hot reload feature helps you quickly and easily experiment, build UIs, add features, and fix bugs. Hot reload works by injecting updated source code files into the running Dart Virtual Machine (VM)....
Google Flutter - Creating Your First Project and Review Its Folders and Files
Introduction You can create a Flutter project from your IDE or from the command line. The default project displays a counter. You can increment the counter by hitting the floating "e;+"e; button on the bottom right. Lets create this Flutter project and take a review of the folders and files that are created for you. Install Your Editor For me, its between Android Studio (heavy but comprehensive) and Visual Studio code (lighter weight). Flutter SDK Download the Flutter SDK and unzip it into a folder. Add that folder plus 'bin' to your path in your shell script. For example on...
Google Flutter SDK Commands
Here is a list of the Flutter SDK commands: flutter --help Lists flutter commands. flutter analyze Analyze the project's Dart code. flutter attach Attach to a running application. flutter bash-completion Output command line shell completion setup scripts. flutter build Flutter build commands. flutter channel List or switch flutter channels. flutter clean Delete the build/ and .dart_tool/ directories. flutter config Configure Flutter settings. flutter create Create a new Flutter project. flutter devices List all connected devices. flutter doctor Show information about the installed tooling. flutter drive Runs Flutter Driver tests for the current project. flutter emulators List, launch and create emulators....
Introduction to Google Flutter
Introduction The purpose of this chapter is to give the reader a quick introduction to Flutter before installing it and starting to use it. What is Flutter? Flutter is not a language (like JavaScript, for example). Flutter uses Dart for its language. Flutter is Google’s mobile SDK / UI framework that enables developers to build native apps that run on a wide variety of devices. Developers write code in a single codebase that works on both platforms. High Productivity Flutter was written for high productivity, to get apps out fast. You can change your code and hot reload the changes,...
Arrow Functions in Dart
Introduction Dart offers arrow functions, which enable the developer to shorten single-line functions that calculate & return something. You can use: => xxx instead of: { return xxx; } Arrow functions are often used by event handlers and when you set state (more on that later). Lets Run Some Code num divideNonLambda(num arg1, num arg2) { return arg1 / arg2; } num divideLambda(num arg1, num arg2) => arg1 / arg2; void main() { print('non-lambda ${divideNonLambda(6, 2)}'); print('non-lambda ${divideNonLambda(9, 2)}'); print('non-lambda ${divideNonLambda(9, 2.5)}'); print('lambda ${divideLambda(6, 2)}'); print('lambda ${divideLambda(9, 2)}'); print('lambda ${divideLambda(9, 2.5)}'); } What Happens When You Run the Code non-lambda...