This is an example of the open closed principle. The first file (2.non_ocp.dart) shows an example not using the principle and the second (3.using_ocp.dart) shows a refactor of it using the principle.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update Gradle, Java and other Android project settings in a Flutter project | |
# See: https://gradle.org/releases/ | |
DESIRED_GRADLE_VERSION="8.9" | |
# Build errors often show the required Java version | |
DESIRED_JAVA_VERSION="17" | |
# See: https://developer.android.com/ndk/downloads | |
DESIRED_NDK_VERSION="27.0.12077973" | |
# The minimum Android SDK version |
Learning Rust
The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.
Warning
Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.
The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.