[dart] learning record of dart constructor (including the writing method of dart singleton mode)

Normal constructor 1. Without specifying the constructor, dart will create a default parameterless constructor for you 2. If you specify a constructor Similar to Java, dart can use a function with the same name as class as its constructor, such as class Student { int age = 0; int id = 0; Student(int age, int id) { this.age = age; ...

Posted by NoPHPPhD on Fri, 05 Aug 2022 22:03:36 +0300

Flutter basic routing management, use of Fluro library and secondary encapsulation

In native development, Android and IOS have their own control page (Activity, ViewControl) function to jump, and in flutter, routing management has become more unified, flexible and efficient. Routing Management Requirements In Flutter, everything is a component, a page is also a component, and routing is a jump and value transfer between compo ...

Posted by dotbands on Tue, 24 May 2022 15:17:08 +0300

Standardize code naming to make your Dart code more pleasant to read

Click here to learn about the "Flutter Introduction and Combat" column, continuous update and systematic learning! foreword Good coding style is very important. Keeping consistent naming can make the code reading experience better and team collaboration more efficient. This article introduces the officially recommended naming conven ...

Posted by MBrody on Thu, 19 May 2022 02:17:31 +0300

Fluent asynchronous programming - event loop, Isolate, Stream

Event loop, Isolate Before we start, we need to understand that Dart is single threaded and that fluent depends on Dart If you know event loop in js The whole process of asynchronous dart is well understood Let's look at a piece of code first import 'dart:async'; Future eventLoop() async{ print('A'); Future((){ print('F'); scheduleMicrota ...

Posted by WinterDragon on Mon, 16 May 2022 23:21:38 +0300

Chapter 4 of the introduction to Dart -- Introduction to inheritance, abstract classes, interfaces and Mixins of object-oriented programming

inherit Use the keyword extends to inherit a classThe subclass inherits the properties and methods visible to the parent class and does not inherit the construction methodSubclasses can duplicate the methods, getter s and setter s of the parent classSingle inheritance, polymorphism We define an Animal class, Animal class, with name, age, and ...

Posted by Mzor on Wed, 27 Apr 2022 12:03:13 +0300