Wipe all flutter data
nohup bash -c 'rm -rf ~/.pub-cache $PUB_CACHE \
&& cd $(dirname -- $(which flutter)) \
&& git clean -fdx \
&& (yes | flutter doctor --android-licenses)' > /dev/null 2>&1 &
/* | |
* Controlled Stateful Widget | |
* https://gist.github.com/PlugFox/629202b0a7bcde8de3a7503bd33308bc | |
* https://dartpad.dev?id=629202b0a7bcde8de3a7503bd33308bc | |
* Mike Matiunin <plugfox@gmail.com>, 05 July 2024 | |
*/ | |
import 'dart:async'; | |
import 'package:flutter/material.dart'; |
void main() { | |
void value = 'Hello world'; | |
print((value as dynamic).runtimeType); | |
print(Obj<void>().runtimeType); | |
print(Obj<void>().type); | |
print(Obj<void>().type is Type); | |
} | |
class Obj<T extends Object?> { | |
Type get type => T; |
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
void main() => runApp(SegmentWidget()); | |
class _SegmentPainter extends CustomPainter { | |
static const offset = -pi / 2; | |
double start; | |
double end; |
/* | |
* Animated Custom Painter | |
* https://gist.github.com/PlugFox/5a0d067bb945057ed2c8adf5702ed893 | |
* https://dartpad.dev?id=5a0d067bb945057ed2c8adf5702ed893 | |
* Mike Matiunin <plugfox@gmail.com>, 19 June 2024 | |
*/ | |
import 'dart:math' as math; | |
import 'dart:ui' as ui; |
id | amount | aegis | name | type | subtype | slots | |
---|---|---|---|---|---|---|---|
525 | 16 | Panacea | Panacea | Healing | |||
603 | 179 | Old_Blue_Box | Old Blue Box | Usable | |||
604 | 3899 | Branch_Of_Dead_Tree | Dead Branch | Usable | |||
606 | 701 | Aloebera | Aloevera | Delayconsume | |||
607 | 1973 | Yggdrasilberry | Yggdrasil Berry | Healing | |||
616 | 648 | Old_Card_Album | Old Card Album | Usable | |||
617 | 1494 | Old_Violet_Box | Old Purple Box | Usable | |||
658 | 45 | Union_Of_Tribe | Union of Tribe | Usable | |||
662 | 114 | Inspector_Certificate | Authoritative Badge | Usable |
CREATE TABLE IF NOT EXISTS offer_history ( | |
/* Primary keys */ | |
-- req offer_history id | |
id TEXT NOT NULL PRIMARY KEY CHECK(id <> '' AND id = (data ->> '$.id')), | |
/* Raw JSON data */ | |
-- req Raw json data | |
data TEXT NOT NULL CHECK(data <> '' AND length(data) > 5), |
Wipe all flutter data
nohup bash -c 'rm -rf ~/.pub-cache $PUB_CACHE \
&& cd $(dirname -- $(which flutter)) \
&& git clean -fdx \
&& (yes | flutter doctor --android-licenses)' > /dev/null 2>&1 &
import 'package:benchmark_harness/benchmark_harness.dart'; | |
void main() { | |
final letter = Example.values[25]; | |
final simple = Simple(letter).measure(); | |
final cache = Cache(letter).measure(); | |
print('$simple / $cache = ${simple / cache}'); // 4.074025631823892 | |
} | |
enum Example { |
// ignore_for_file: avoid_print | |
import 'dart:async'; | |
import 'dart:math' as math; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
// TODO(plugfox): пропадают элементы снизу при скролле и определенных размерах экранах | |
// TODO(plugfox): добавить скролл при наведении мыши на края экрана |
/* | |
* Seat Viewer | |
* https://gist.github.com/PlugFox/218f5884cf61130433cd684783fd58b7 | |
* https://dartpad.dev?id=218f5884cf61130433cd684783fd58b7 | |
* Mike Matiunin <plugfox@gmail.com>, 05 May 2024 | |
*/ | |
import 'dart:math' as math; | |
import 'package:flutter/foundation.dart' show listEquals; |