Skip to content

Instantly share code, notes, and snippets.

View PlugFox's full-sized avatar
🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊

Plague Fox PlugFox

🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊
View GitHub Profile
@PlugFox
PlugFox / main.dart
Last active June 4, 2019 16:36
Побитовое хранилище int и bool
/*
* Побитовое хранилище int и bool
* https://gist.github.com/PlugFox/13363e58a2f8a454a518444a90282825
* https://dartpad.dartlang.org/13363e58a2f8a454a518444a90282825
*/
/*
+-------------------------
| ВЫВОД //
@PlugFox
PlugFox / main.dart
Last active June 4, 2019 16:39
Sample nested BLoCs architecture with singltone repository
///////////////////////////////////////////////////////////////
/// Sample nested BLoCs architecture with singltone repository
/// https://felangel.github.io/bloc/#/gettingstarted
/// https://gist.github.com/PlugFox/99c6118789c4bbc7d04690f5ca93ee21
/// https://dartpad.dartlang.org/99c6118789c4bbc7d04690f5ca93ee21
///////////////////////////////////////////////////////////////
import 'dart:async';
import 'dart:math' as m show Random; // Нужен только в примере, для представления провайдеров
/*
import 'package:flutter_bloc/flutter_bloc.dart';
@PlugFox
PlugFox / main.dart
Last active June 8, 2019 17:31
Демонстрация реактивного программирования для https://t.me/rudart
/*
* Демонстрация реактивного программирования для https://t.me/rudart
* https://gist.github.com/PlugFox/6e79a1f5cc6e32a4df1081bd27edb38c
* https://dartpad.dartlang.org/6e79a1f5cc6e32a4df1081bd27edb38c
*/
import 'dart:async';
class MyString {
final StreamController<String> _sc = new StreamController<String>.broadcast();
@PlugFox
PlugFox / main.dart
Created June 13, 2019 04:58
Title register in dart
/*
* Title register in dart for https://t.me/rudart
* https://gist.github.com/PlugFox/973fdcaa9f49613ec4b57aaea0a60b5d
* https://dartpad.dartlang.org/973fdcaa9f49613ec4b57aaea0a60b5d
*/
String toTitleRegister(String string) =>
string
.split(RegExp(r'\s'))
.map<String>((String val)
@PlugFox
PlugFox / main.dart
Created June 17, 2019 13:14
json example mapping for https://t.me/rudart
/* json example mapping for https://t.me/rudart */
import "dart:math";
import "dart:convert";
void main() {
String raw = '''
{"rooms": [
{
"id": "49",
@PlugFox
PlugFox / main.dart
Last active June 17, 2019 13:58
Пример парсинга json с использованием каскадной нотации для https://t.me/rudart
/*
* Пример парсинга json с использованием каскадной нотации
* для https://t.me/rudart
* https://gist.github.com/PlugFox/0f4c182950895f7033d26204911dad6a/
* https://dartpad.dartlang.org/0f4c182950895f7033d26204911dad6a
*/
// Описание каскадной нотации:
// https://dart.dev/guides/language/language-tour#cascade-notation-
@PlugFox
PlugFox / LICENSE
Last active June 18, 2019 19:32
async in dart example
The MIT License
Copyright (c) 2019 Plague Fox
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
furnished to do so, subject to the following conditions:
@PlugFox
PlugFox / main.dart
Last active September 11, 2019 13:28
Expand object list with factory
/*
https://gist.github.com/PlugFox/18826a7169a6ea632d51c665cc7357e1
https://dartpad.dartlang.org/18826a7169a6ea632d51c665cc7357e1
*/
// A
class A {
final int _value;
int get value => this._value;
A([int value])
@PlugFox
PlugFox / main.dart
Last active September 17, 2019 15:59
Repository with local provider
/*
https://gist.github.com/PlugFox/a013510572bb2115d6ac2e434cb8d197
https://dartpad.dartlang.org/a013510572bb2115d6ac2e434cb8d197
*/
import 'dart:html'; // for _LocalProviderStorage
abstract class Repository {
static final RepositoryProvider _repository = RepositoryProvider();
@PlugFox
PlugFox / main.dart
Last active September 18, 2019 08:09
Repository realisation in dart
/*
Repository realisation in dart
https://gist.github.com/PlugFox/bb2cf58f199886cc0971d75a3e337b6a
https://dartpad.dartlang.org/bb2cf58f199886cc0971d75a3e337b6a
*/
import 'dart:async';
// Repository controller
abstract class Repository {
static final RepositoryProvider _repository = RepositoryProvider();