Marks Dart and Flutter Blog RSS

Dart, Google, Google Flutter -

Name Description dart Enables you to execute a .dart file within the Dart Virtual Machine. dart2js Compiles dart source code to JavaScript. dartanalyser Analyses dart source code. This is used by many of the code editors to provide error and warning highlighting. dartdevc Compiles dart source code to JavaScript. Similar to dart2js except that it supports incremental compilation, which lends itself to developers. dartdoc Generates Dart documentation from source code.  As the seminal book ‘Domain-Driven Design’ by Eric Evans states: ‘the code is the model and the model is the code’. dartfmt Formats Dart source code. This is used by...

Read more

Dart, Dynamic, Google, Typing -

Introduction Typically, computer languages have fallen into two camps: Statically-typed languages. Dynamically-typed languages. Statically-typed Languages These languages have specific variable types and the developer compiles the code using an ‘ahead-of-time’ compiler. The compiler type checking is performed before the code is run.  This is an excellent way to develop software as the compiler performs static-analysis of the code as part of the compilation, alerting the developer when issues arise. Software typically takes longer to develop in this method, but the software developed in this manner typically works better in complex scenarios. Dynamically-typed Languages These languages don’t have specific variable types...

Read more

Dynamic, Google, Google Flutter, Typing -

Interchangeable Most of the Time You can define untyped variables by declaring them using the ‘var’ or ‘dynamic’ keywords. The ‘var’ keyword declares a variable without specifying its type, leaving the variable as a dynamic. No type is specified. The ‘dynamic’ keyword declares a variable of the type ‘dynamic’ with optional typing. It marks variable as 'not type checked'. Exception (Methods) Methods need to return a type so they will work with 'dynamic' but  wont work with 'var': void main() {   print (multiplyMethod1(2,4));   print (multiplyMethod2(2,4)); }   dynamic multiplyMethod1(int a, int b){   return a * b; }  ...

Read more

Google, Google Flutter -

As mentioned at the start of this book, a Mixin is a class that contains methods for use by other classes without it having to be the parent class of those other classes.

So, a Mixin is a class you can use code from without having to inherit from...

Read more

Dart, Equality, Google, Google Flutter -

In Dart, you compare equality using the ‘==’ operator rather than an ‘equals’ method. Sometimes you need to override it this operator in your class to ensure that instances of the classes are compared correctly....


Read more