A collapsible section containing markdown
Click to expand!
Heading
- A numbered
- list
- With some
- Sub bullets
import 'dart:async'; | |
Future main() async { | |
print('start'); | |
final li = await Future.wait([fetch(4), fetch(6)]); | |
print('results: ${li[0]} ${li[1]}'); // results: 4 2 | |
final li2 = await Future.wait([fetch(6), fetch(3)]); | |
print('results 2: ${li2[0]} ${li2[1]}'); // results: 6 3 |
class UpdateUserInteractor { | |
Future<void> call(String name) async { | |
print("done $name"); | |
return; | |
} | |
} | |
void main() async { | |
final updateUser = UpdateUserInteractor(); | |
await updateUser('Dan'); |
/// | |
/// The Result Monad | |
/// | |
abstract class Result<T> { | |
bool isSuccess() { | |
return this is Success; | |
} | |
Success<T> asSuccess() { | |
return this as Success<T>; |
/// | |
/// The Result Monad | |
/// | |
abstract class Result<T> { | |
bool isSuccess() { | |
return this is Success; | |
} | |
Success<T> asSuccess() { |
# https://www.regextester.com/109925 | |
CONVENTIONS_URL = "your link" | |
def validate_title_format | |
def valid_title_format?(title) | |
conventional_commit_regex = /^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?: .*$/ | |
result = title =~ conventional_commit_regex | |
result != nil | |
end |
class Person { | |
Person(this.name); | |
final String name; | |
String toString() => name; | |
} | |
void main() { | |
final items = [Person("juan"), Person("pedro"), Person("coso")]; |
Stream<String> otherNumbers() { | |
return Stream.fromIterable(["2", "3"]); | |
} | |
Stream<String> allNumbers() async* { | |
yield "1"; | |
yield* otherNumbers(); | |
} |
#!/usr/bin/env bash | |
# | |
# Runs dartfmt from dart_style to check if all of the source files are well formatted | |
# Requires you to have dartfmt already in your path with 'pub global activate dart_style' | |
# | |
echo "-> Running 'flutter format' to check project dart style 🤓" | |
RESULT=$(flutter format -n lib/main.dart lib/src/ test/) |
/// Function to get the changed value everytime | |
typedef GetChangeFunction<T> = T Function(); | |
extension AsStream<T> on ChangeNotifier { | |
Stream<T> statusAsStream(GetChangeFunction<T> getChange) { | |
final controller = StreamController<T>(); | |
// Redirect status changes into the Stream |