What the documentation says:
https://dart.dev/tools/linter-rules/prefer_relative_imports
and
https://dart.dev/tools/linter-rules/avoid_relative_lib_imports
void main() { | |
for (int i = 0; i < 10; i++) { | |
print('Sejam bem vindooooooooooooo ${i + 1}'); | |
} | |
} |
What the documentation says:
https://dart.dev/tools/linter-rules/prefer_relative_imports
and
https://dart.dev/tools/linter-rules/avoid_relative_lib_imports
// *** | |
// See comments at: https://gist.github.com/catalunha/580500220454241f2a762bdf5e2954b1 | |
// *** | |
// This code is distributed under the MIT License. | |
// Copyright (c) 2018 Felix Angelov. | |
// You can find the original at https://github.com/felangel/bloc. | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; |
void main() async { | |
/// Initialize a stream of integers 0-9 | |
Stream<int> stream = countStream(10); | |
/// Compute the sum of the stream of integers | |
int sum = await sumStream(stream); | |
/// Print the sum | |
print(sum); // 45 | |
} |
void main() { | |
String texto = 'Aaa bbb'; | |
int numero = 1; | |
print(texto); | |
print(numero); | |
print('Texto: $texto'); | |
print('Número: $numero'); | |
print('Texto: $texto e Número: $numero'); | |
print('Texto: ${texto.toUpperCase()} e Número: ${numero + 1}'); | |
} |
void main() async { | |
await getAll(); | |
} | |
Future<void> getAll() async { | |
final <Either>[name, value] = await Future.wait([ | |
getName(), | |
getIdade(), | |
]); |
void main() { | |
final String a = 'a'; | |
final String b; | |
b = a; | |
print(b); | |
final C c = D('d'); | |
final String f; | |
switch (c) { | |
case D(c: final dd): | |
f = dd; |
// switch com => retorna valor. Ambos analisam exaustão. | |
enum Valores { A, B, C } | |
void main() { | |
Valores vlr1 = Valores.B; | |
print(vlr1); | |
switch (vlr1) { | |
case Valores.A: | |
print('aa'); | |
print('aa2'); |
void main() { | |
for (int i = 0; i < 5; i++) { | |
print('hello ${i + 1}'); | |
} | |
} |
void main() { | |
for (int i = 0; i < 5; i++) { | |
print('hello ${i + 1}'); | |
} | |
} |