This file contains 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://www.chriswrites.com/boost-your-macs-performance-by-disabling-unnecessary-animations/ | |
defaults write -g NSScrollViewRubberbanding -int 0 | |
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false | |
defaults write -g NSScrollAnimationEnabled -bool false | |
defaults write -g NSWindowResizeTime -float 0.001 | |
defaults write -g QLPanelAnimationDuration -float 0 | |
defaults write -g NSScrollViewRubberbanding -bool false | |
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false | |
defaults write -g NSToolbarFullScreenAnimationDuration -float 0 | |
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0 |
This file contains 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 'dart:async'; | |
typedef Listener = void Function(); | |
int _actionsProcessing = 0; | |
Set<Observable>? _currentReactives; | |
Set<Observable>? _scheduledReactives; | |
class Observable<T> { | |
Observable(T initialValue) : _value = initialValue; |
This file contains 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
extension on int? { | |
p() => print('int, ${this.runtimeType}'); | |
} | |
extension on Null { | |
p() => print('null'); | |
} | |
const _defaultNull = null; | |
// class Ii implements int {} | |
This file contains 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
@sealed | |
abstract class _CarPart { | |
Engine(int cylinders, int horsepower); | |
Transmission(int gears, bool isManual); | |
} | |
class Car { | |
const Car( | |
this.model, { | |
required this.parts, |
This file contains 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 CarPart {} | |
class Engine implements CarPart { | |
const Engine({ | |
required this.cylinders, | |
required this.horsepower, | |
}); | |
final int cylinders; | |
final int horsepower; | |
} |
This file contains 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
class CarPart { | |
const CarPart(); | |
// METHOD COULD BE GENERATED | |
T match<T>({ | |
required T Function(Engine v) engine, | |
required T Function(Transmission v) transmission, | |
}) { | |
// ignore_for_file: curly_braces_in_flow_control_structures | |
if (this is Engine) return engine(this as Engine); |
This file contains 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 CarPart {} | |
class Engine implements CarPart { | |
const Engine({ | |
required this.cylinders, | |
required this.horsepower, | |
}); | |
final int cylinders; | |
final int horsepower; | |
} |
This file contains 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
class CarPart { | |
const CarPart(this.type); | |
final CarPartType type; | |
} | |
enum CarPartType<T extends CarPart> { | |
engine<Engine>(), | |
transmission<Transmission>(), | |
} |
This file contains 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 CarPart { | |
CarPartType get type; | |
} | |
enum CarPartType<T extends CarPart> { | |
engine<Engine>(), | |
transmission<Transmission>(), | |
} | |
class Engine implements CarPart { |
This file contains 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:data_classes/data_classes.dart'; | |
import 'package:common/const.dart'; | |
part 'change_log.g.dart'; | |
typedef FieldValueGetter<T> = T Function(dynamic); | |
enum EntityType { | |
series, |
NewerOlder