-
Book Overview & Buying
-
Table Of Contents
Flutter for Beginners - Fourth Edition
By :
While you have been developing code in VS Code, you will probably have seen that the IDE suggests code completions for you. For example, if you are in a widget's code and you type set, then the IDE may suggest that you are trying to write setState.
The IDE works this out by looking at what methods or functions are in scope so that it can suggest code completions that will not cause compilation errors. You may have also noticed that when you press the dot on a variable, if there are methods or fields on the variable that you can access, then the IDE will supply a list of methods or fields that you can choose from. Again, these will not cause compilation errors because the IDE is checking against the available methods and fields.

Figure A.1: Code completion suggestions for the Icons class
This code completion is only really possible because Dart is a statically-typed language. Therefore, the compiler, and in turn the IDE, knows exactly which methods and...