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
// What if you need a variable that can hold a null | |
// value? You can declare it nullable by adding a | |
// question mark to the end of the type. In this | |
// case, try `int?`. | |
void main() { | |
int a; | |
a = null; | |
print('a is $a.'); | |
} |
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
// Welcome to the null safety version of DartPad! | |
// This is the first in a series of code examples | |
// designed to illustrate the new syntax and | |
// coding patterns for null safety. | |
// | |
// Each snippet starts off in a bad or broken | |
// state. You’ll probably see warnings from the | |
// Dart analyzer, and the code probably won't | |
// compile. But by following the instructions | |
// and making edits to the code, you can update |
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
// Flutter code sample for NavigationRail | |
// This example shows a [NavigationRail] used within a Scaffold with 3 | |
// [NavigationRailDestination]s. The main content is separated by a divider | |
// (although elevation on the navigation rail can be used instead). The | |
// `_selectedIndex` is updated by the `onDestinationSelected` callback. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); |
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 'dart:math'; | |
import 'package:flutter/material.dart'; | |
// Colors. | |
const crossColor = const Color(0xFF1ABDD5); | |
const circleColor = const Color(0xFFD8B9FA); | |
const accentColor = const Color(0xFF90A4AE); | |
void main() => runApp(MyApp()); |
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 'dart:ui'; | |
void main() { | |
runApp(MyApp()); | |
} | |
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
/* | |
MIT License | |
Copyright (c) 2020 Mariano Zorrilla | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
/* | |
MIT License | |
Copyright (c) 2020 Mariano Zorrilla | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
//Made with dartpad.dartlang.org <3 | |
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
final Color cellColor = Colors.lightBlue; | |
final Color bgColor = new Color.fromARGB(255, 245, 245, 255); | |
final TargetPlatform platform = TargetPlatform.android; | |
List<List<bool>> cells; | |
final width = 700.0, height = 700.0; |
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( | |
MaterialApp( | |
home: Center( | |
child: Image.network( | |
'http://placekitten.com/200/200', | |
), | |
), | |
), |
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 'dart:async'; | |
class MyClass { | |
final myMap = <String, int>{'zero':0 }; | |
final controller = StreamController<List<int>>(); | |
void addNumber(String s, int i) { | |
controller.add(myMap.entries.map((e) => e.value).toList()); | |
myMap[s] = i; |