Google Flutter RSS
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...
Method Cascades in Dart
Introduction Method cascades can help with the brevity of your code. Lets Run Some Code class Logger { void log(dynamic v){ print(DateTime.now().toString() + ' ' + v); } } main(){ // Without method cascades new Logger().log('program started'); new Logger().log('doing something'); new Logger().log('program finished'); // With method cascades new Logger() ..log('program started') ..log('going something') ..log('program finished'); } What Happens When You Run the Code 2018-12-30 09:28:39.686 program started 2018-12-30 09:28:39.686 doing something 2018-12-30 09:28:39.686 program finished 2018-12-30 09:28:39.686 program started 2018-12-30 09:28:39.686 going something 2018-12-30 09:28:39.686 program finished
Asynchronous Processing in Dart and Flutter - Part Three - Async and Await
Async When an async method is called, a Future is immediately returned, and the body of the method is executed later. Later on, as the body of the async function is executed, the Future returned by the function call will be completed along with its result. At the end of the async method, the value (from the completed Future) can be returned. Await Await expressions are used in async methods. They enable you to invoke asynchronous code (that returns a Future). Once the asynchronous code is invoked, the currently running function is suspended until the Future has completed or there is...