Advanced Dart course
For those who know the basics: the techniques used in real projects. In DMarlon Studio, Dart is the language of the Flutter targets (mobile and desktop): design the screens on the phone canvas and the studio writes the Dart.
Start- 1Classes and initializer listsDefine Dart classes with final fields, this-shorthand constructors and initializer lists that prepare the data before the constructor body runs.Lesson 1
- 2Named and factory constructorsBuild Dart objects in several ways: named, redirecting and private constructors, plus factory constructors that validate input or reuse objects.Lesson 2
- 3Getters, setters and private membersProtect the state of your Dart classes with private members (_), computed getters and validating setters, using a bank account as the example.Lesson 3
- 4Inheritance and @overrideInherit Dart classes with extends, pass data to the parent with super and replace methods with @override, using a payroll example.Lesson 4
- 5Abstract classes and interfacesDefine contracts in Dart with abstract classes and interfaces, and see the difference between extends and implements with several payment methods.Lesson 5
- 6MixinsReuse behaviour in Dart with mixins: with to apply them, on to restrict them and abstract members that ask the class for data.Lesson 6
- 7Extension methodsAdd methods and getters to int, String or List in Dart with extensions, generic ones included, without subclassing or changing those classes.Lesson 7
- 8Enhanced enumsGive your Dart enums fields, a constructor and methods, and use one to model an order's life cycle with a switch the compiler checks.Lesson 8
- 9GenericsWrite generic classes and functions in Dart, with bounded types (extends) and type inference, using an in-memory repository and a groupBy function.Lesson 9
- 10Records and destructuringReturn several values without writing a class using Dart 3 records, and destructure them into variables, in loops and in swaps.Lesson 10
- 11Patterns and sealed classesModel a screen's states with Dart 3 sealed classes and handle them with an exhaustive switch, object patterns, when guards and if-case.Lesson 11
- 12Operators, == and hashCodeDefine operators on your Dart classes, compare objects by value with == and hashCode, and sort them with Comparable, using a Money type.Lesson 12
- 13Futures, async and awaitUnderstand Dart Futures and write readable asynchronous code with async and await, simulating server calls with Future.delayed.Lesson 13
- 14Future.wait and async errorsRun several requests in parallel with Future.wait in Dart and handle their errors with try/catch, timeout and onError, with output that never changes.Lesson 14
- 15Streams with async* and await forCreate Dart streams with async* functions and yield, consume them with await for and transform them with where and map, using a simulated download.Lesson 15
- 16StreamController and eventsEmit your own events in Dart with a StreamController and listen to them with listen, onError and onDone, using a shopping cart as the example.Lesson 16
- 17Isolates with Isolate.runMove heavy computation off Dart's main thread with Isolate.run, run several isolates in parallel and catch their errors.Lesson 17
- 18JSON with fromJson and toJsonRead and write JSON in Dart with jsonDecode and jsonEncode, and turn it into typed objects with fromJson and toJson, just as Flutter apps do.Lesson 18
- 19Iterables and generatorsProduce lazy sequences in Dart with sync*, yield and yield*: work with infinite series and compute only what is actually requested.Lesson 19
- 20Project: order processingCombine Dart sealed classes, generics, async and JSON in a small order processing system: the logic that sits behind a Flutter app.Lesson 20