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
# Miscellaneous | |
*.class | |
*.log | |
*.pyc | |
*.swp | |
.DS_Store | |
.atom/ | |
.buildlog/ | |
.history | |
.svn/ |
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'; | |
class CustomAdaptivePage extends StatelessWidget { | |
const CustomAdaptivePage({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Center( | |
child: Column( |
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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const App()); | |
} | |
class App extends StatefulWidget { | |
const App({Key? key}) : super(key: key); |
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'; | |
void main() { | |
runApp( | |
MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), |
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
/* | |
Stream | |
Напишите функцию, которая считывает данные с клавиатуры до тех пор, пока не будет введен строка "exit". | |
Функция должна возвращать Stream<String>. | |
Напишите код, который прослушивает поток и распечатывает на консоль "Введена строка stroke_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
/* | |
Future | |
Напишите функцию, которая считывает данные с клавиатуры. Функция должна возвращать Future<String>. | |
Напишите код, который дожидается выполнения функции и распечатывает на консоль "Введена строка stroke_name". | |
Поэкспериментируйте с async/await и listen | |
*/ | |
import 'dart:io'; |
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
/* | |
Представьте, что разрабатывайте фентезийную игру. | |
В игре есть гоблины и орки. Они спавнятся в пещерах. | |
Создайте классы: | |
Goblin | |
Hobogoblin extends Goblin | |
Orc |
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() { | |
final list = <String>['текст', 'текст']; | |
} |
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() { | |
final val = someClass(); | |
print(val.somethingToString(1111)); | |
print(val.somethingToString(11.2)); | |
print(val.somethingToString('что-то')); | |
} |
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
/* | |
Задание 1 | |
Есть классы геометрических фигур - наследники Shape и класс страны - Country. | |
Эти классы хранят массив borders - в контексте фигур это количество граней фигуры, | |
а в контексте стран - это количество границ. | |
Требуется: | |
Реализовать миксин BorderHelper, который подмешивает в класс возможность вычисления | |
количества граней/границ. Вызов должен происходить следующим образом |
NewerOlder