Resources for studying immutability in the context of OOP languages.
The numbering below is simply for differentiation.
~90% of the resources below come from Marcelo Glasberg.
/// Using `n == 1` won't work usually because the `n` input can be `0`. | |
int factorial(int n) => n == 0 ? 1 : n * factorial(n - 1); |
#j:: | |
Send, nuclear launch codes | |
return |
/// To run this, you can simply use: | |
/// | |
/// ```sh | |
/// dart different_fixed_list_initializations.dart | |
/// ``` | |
/// For more, check out the [`List` docs][list_docs]. | |
/// | |
/// The `UnmodifiableListMixin` and `FixedLengthListMixin` are actually | |
/// abstract classes, not mixins. They are both inside |
Unfortunately, [since mirrors currently bloat compiled code][no_support_mirrors], it isn't supported for Flutter or web apps. A [workaround][source_gen_tutorial] would be to use a package like [
source_gen
][source_gen].
Most of the info here, comes from [Understanding Reflection and Annotations in Dart tutorial][reflection_tutorial], from the Fullstack Dart and Flutter Tutorials YouTube channel. He also created a [gist][gist_tutorial] with it.
coverage
package:
pub global activate coverage
.test_coverage.dart
โ:
dart --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=NNNN test/.test_coverage.dart
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<h1>Web Component Dart Test</h1> |