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
void main() { | |
var result = <int>[]; | |
for (var (int x,int y) = (0,1); y < 100; (x+=y,y+=x)){ | |
result.add(x); | |
result.add(y); | |
} | |
print (result); | |
} |
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
void main() { | |
f(A1('1')); | |
f(A2(2)); | |
// f(A3()); // Abstract classes cannot be instantiated | |
f(A31('A3',31)); | |
f(A32('A3',32)); | |
f(A33('A3','33')); | |
} | |
void f(A x) { |
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
/// This sample demonstrates the difference between Ref.read() and Ref.watch() | |
/// This sample is broken to show that despite repoProvider is updated there is no update in the UI | |
// This is where our state is stored |
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
main (){} | |
abstract class A { | |
void listen({ | |
bool isOk, | |
required String isBad, | |
}); | |
} |
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
rules_version = '2'; | |
service cloud.firestore { | |
match /databases/{database}/documents { | |
function isAuthorised() { | |
return request.auth != null; | |
} | |
function isAuthorisedWithId(id) { | |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
final data = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20] | |
.map((x) => {'name':' Dart $x'}).toList(); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
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
void main() { | |
} | |
enum Moves { | |
FORWARD, | |
BACK, | |
LEFT, | |
RIGHT, | |
JUMP, |
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
void main() { | |
// an array is a collection of objects | |
var dance = [Moves.LEFT,Moves.RIGHT,Moves.JUMP,]; | |
print('${dance[0]}'); | |
for (var move in dance) { | |
print('$move'); | |
} |
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
void main() { | |
var breakfast = Breakfast( | |
tea: Tea( | |
milk: Milk(), | |
), | |
); | |
print('$breakfast was ${breakfast.getCalories()} calories'); | |
} |
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
void main(){ | |
var breakfast = Breakfast(); | |
print('$breakfast'); | |
} | |
class Breakfast { | |
} |
NewerOlder