- Начать писать логику непосредственно в
mapEventToState,
он у вас быстренько превратится в нечитаемую портянку и придете жаловаться на бойлерплейт.
Если правильно готовить блок, то бойлерплейтом там и не пахнет,
эвенты + стейты + блок умещаются все вместе на 1-2 экранах.
Все запредельно воздушно, даже не надо создавать отдельные файлы под эвенты и стейты.
Все ультра емко получается.
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 org.apache.kafka.clients.producer.KafkaProducer; | |
| import org.apache.kafka.clients.producer.ProducerConfig; | |
| import org.apache.kafka.clients.producer.ProducerRecord; | |
| import org.apache.kafka.common.Metric; | |
| import org.apache.kafka.common.MetricName; | |
| import java.util.Map; | |
| import java.util.Properties; | |
| import java.util.WeakHashMap; | |
| import java.util.concurrent.ConcurrentLinkedQueue; |
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
| /* | |
| * GET SUPER PROVIDER XXL | |
| * From GetX Architects and for GetX Architects | |
| * with L<3VE | |
| * | |
| * https://gist.github.com/PlugFox/fa6ff53257c7bd8edb11ebc2fe889d8e | |
| * https://dartpad.dev/fa6ff53257c7bd8edb11ebc2fe889d8e | |
| */ | |
| /// SUPER LIBRARY: |
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
| /* | |
| * https://dartpad.dev/?null_safety=true&id=6f13157effce2c1a525f8355dc35b0cc | |
| * https://gist.github.com/PlugFox/6f13157effce2c1a525f8355dc35b0cc/ | |
| */ | |
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runZonedGuarded( |
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
| abstract class Hero { | |
| void say(); | |
| } | |
| mixin Fly { | |
| void canFly(int mySpeed) { | |
| print('Я могу летать со скоростью ${mySpeed} км/ч'); | |
| } | |
| } | |
| mixin Jump { |
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
| List<Map<String, dynamic>> data = [ | |
| {'name': 'Batman', 'age': 30}, | |
| {'name': 'Spiderman', 'age': 18}, | |
| {'name': 'Kung fury', 'age': 23}, | |
| {'name': 'Tor', 'age': 550}, | |
| {'name': 'Halk', 'age': 44}, | |
| {'name': 'Iron man', 'age': 35}, | |
| ]; | |
| Map<String, dynamic> findUser( |
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() { | |
| List<String> users = ['anna', 'viKtor', 'Mike', 'aleX', 'dan']; | |
| print(users); | |
| List<String> newUsers = []; | |
| int i = 0; | |
| for (i; i < users.length; i++) { | |
| String element = users[i]; | |
| String newElement = (element.substring(0, 1).toUpperCase() + | |
| element.substring(1).toLowerCase()); | |
| newUsers.add(newElement); |
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<int?> myAvoidTest(a) async { | |
| final b = 2; | |
| final c = a + b; | |
| print('sum a + b: $a + $b = $c'); | |
| if (a == b) { | |
| return null; | |
| } else { | |
| return (c); | |
| } | |
| } |
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() { | |
| Object a = 7; | |
| final List<Object> myListInt = [1, 3, 5, a]; | |
| print(myListInt);// | |
| var myNewList = myListInt.cast<int>(); // if we are sure for int | |
| myNewList.last = myNewList.last * 100; // last | |
| myNewList.first = myNewList.first * 100; // first | |
| print('myNewList $myNewList');// |
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
| // continue Dart lessons. Lesson 2 | |
| //import 'dart:io'; | |
| String? sliyanieStrok(String a, String b) { | |
| return a + b; | |
| } | |
| void main(List<String> args) { | |
| var myResult = sliyanieStrok('1: hello', ', world!'); | |
| print(myResult); |
NewerOlder