This file contains hidden or 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'; | |
| void main() { | |
| var streamController = StreamController(); | |
| streamController.stream.listen( | |
| (data) => print('Got eem! $data'), | |
| onError: (err) => print('Got an error! $err'), | |
| onDone: () => print('Mission complete!'), | |
| cancelOnError: false, |
This file contains hidden or 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:math'; | |
| void main() { | |
| runApp(new MaterialApp(home: PositionedTiles())); | |
| } |
This file contains hidden or 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:math'; | |
| void main() { | |
| runApp(new MaterialApp(home: PositionedTiles())); | |
| } |
This file contains hidden or 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:math'; | |
| void main() { | |
| runApp(new MaterialApp(home: PositionedTiles())); | |
| } | |
| class PositionedTiles extends StatefulWidget { |
This file contains hidden or 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:math'; | |
| void main() { | |
| runApp(new MaterialApp(home: PositionedTiles())); | |
| } |
This file contains hidden or 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:math'; | |
| void main() { | |
| runApp(new MaterialApp(home: PositionedTiles())); | |
| } |
This file contains hidden or 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'; | |
| abstract class ExampleStateBase { | |
| @protected | |
| String initialText; | |
| @protected | |
| String stateText; | |
| String get currentText => stateText; | |
| void setStateText(String text) { |
This file contains hidden or 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() { | |
| Map<String,dynamic> bob = { | |
| 'name': 'Bob', | |
| }; | |
| Map<String,dynamic> bobLike = { | |
| 'name': 'Bob', | |
| }; | |
| if(bob == bobLike) { |
This file contains hidden or 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
| class Student{ | |
| var _id; | |
| var _name; | |
| Student({this._id, this._name}); // error - имена параметров не могут начинаться с _ | |
| void set id(int id) => _id = id; | |
| void set name(String name) => _name = name; | |
| } |
This file contains hidden or 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
| String scream(int length) => "A${'a' * length}h!"; | |
| main() { | |
| final values = [1, 2, 3, 5, 10, 50]; | |
| //Normal not functional: | |
| print('Normal, not functional: '); | |
| for (var length in values) { | |
| print(scream(length)); | |
| } |