Skip to content

Instantly share code, notes, and snippets.

View guid-empty's full-sized avatar

guid-empty guid-empty

View GitHub Profile
// wrike.commons
class SymbolResolvedValue {
String name;
Symbol symbol;
SymbolResolvedValue(this.name, this.symbol);
}
I model<T, I extends T>(I model) => model;
SymbolResolvedValue resolve(dynamic resolved) => resolved as SymbolResolvedValue;
Symbol symbolOf(dynamic resolved) => (resolved as SymbolResolvedValue).symbol;
String nameOf(dynamic model, dynamic resolved) => (resolved as SymbolResolvedValue).name;
SymbolResolvedValue resolve(dynamic model, dynamic resolved) => resolved as SymbolResolvedValue;
Symbol symbolOf(dynamic model, dynamic resolved) => (resolved as SymbolResolvedValue).symbol;
class SymbolResolvedValue {
String name;
Symbol symbol;
SymbolResolvedValue(this.name, this.symbol);
@guid-empty
guid-empty / main.dart
Created April 10, 2018 09:37
replace Watcher.toSymbol usings
import 'dart:async';
import 'dart:io';
import 'package:path/path.dart';
main(List<String> arguments) async {
Stream<FileSystemEntity> entityList = Directory.current.list(recursive: true, followLinks: false);
Set types = new Set();
await for (FileSystemEntity entity in entityList) {
FileSystemEntityType type = await FileSystemEntity.type(entity.path);
@guid-empty
guid-empty / main.dart
Created August 23, 2020 17:56
Explicit Animations - AnimatedWidget - FadeOutAngleTransition
import 'package:flutter/material.dart';
import 'dart:math';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(),
@guid-empty
guid-empty / main.dart
Last active August 24, 2020 00:32
Explicit Animations - Timer based
import 'package:flutter/material.dart';
import 'dart:async';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(),
@guid-empty
guid-empty / main.dart
Created September 22, 2020 20:13
TypewriterTween as Example to show How to implement custom Tween Animation
// Copyright 2019 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
@guid-empty
guid-empty / main.dart
Last active September 28, 2020 09:04
Isolate and same demonstration how you can kill your UI )
import 'package:flutter/material.dart';
// Copyright 2019-present the Flutter authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
@guid-empty
guid-empty / hint.txt
Last active September 29, 2020 22:25
Function Declaration - использование Function без явного определения сигнатуры
Попробуйте задать явным образом тип коллбек-функции с использованием typedef.
Во вкладке solution мы можете увидеть решение проблемы с неявно заданной сигнатурой коллбек функции.
@guid-empty
guid-empty / hint.txt
Last active October 1, 2020 13:20
Collection If operator
Подумайте, как можно было бы упростить метод build()?
Попробуйте самостоятельно или посмотрите solution
@guid-empty
guid-empty / main.dart
Created October 9, 2020 22:20
Dart & Strings
///
/// Flutter Mobile Developer
/// Strings
/// https://api.dart.dev/stable/2.10.1/dart-core/String-class.html
void main() {
// что насчет объявления строк?
final currentDateString = 'Current Date is ' + DateTime.now().toString();
print(currentDateString);