Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Artur Rymarz artrmz

🎯
Focusing
View GitHub Profile
View gist:38f8b79efa5f71f8667db609013db5bb
// loading from bundle
Environment(loader: FileSystemLoader(bundle: [Bundle.main]))
// loading from disk
Environment(loader: FileSystemLoader(paths: []))
@artrmz
artrmz / .zshrc
Created Aug 5, 2019
Terminal config
View .zshrc
autoload -U colors && colors
function gi() { curl -sLw n https://www.gitignore.io/api/$@ ;}
function get_pwd() { echo "${PWD/$HOME/~}" }
PS1="
%{$fg[blue]%}%n %{$fg[yellow]%}%(5~|%-1~/.../%3~|%4~) %{$reset_color%}%
"
View wave_clipper.dart
class WaveClipper extends CustomClipper<Path> {
final double percentage;
final double animation;
WaveClipper(this.percentage, this.animation);
@override
Path getClip(Size size) {
var progress = (percentage > 100.0 ? 100.0 : percentage) / 100.0;
progress = 1.0 - progress;
View water_drop.dart
Stack(
alignment: Alignment.center,
children: <Widget>[
Center(child: Image.asset('assets/images/drop.png')),
Center(
child: AnimatedBuilder(
animation: CurvedAnimation(
parent: animationController,
curve: Curves.easeInOut),
builder: (context, child) => ClipPath(
View bubbles.dart
class Bubbles extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _BubblesState();
}
}
class _BubblesState extends State<Bubbles> with TickerProviderStateMixin {
AnimationController animationController;
final bubbles = <Bubble>[];
View toggle_animation.dart
@override
initState() {
final Curve curve = Curves.easeOut;
_animationController =
AnimationController(vsync: this, duration: Duration(milliseconds: 500));
_translateButton = Tween<double>(
begin: _fabHeight,
end: -8.0,
).animate(CurvedAnimation(
View menu.dart
toggleMenu() {
if (!isOpened) {
_animationController.forward();
} else {
_animationController.reverse();
}
View container_wrapper.dart
class ContainerWrapper extends StatelessWidget {
final Widget child;
final double widthScale;
ContainerWrapper({@required this.child, this.widthScale = 0.8});
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
return SizedBox(
View database_manager.dart
void insert(List<DatabaseModel> models) async {
var db = await database;
var batch = db.batch();
for (var model in models) {
DatabaseTable table = _tables[model.runtimeType];
if (table == null) {
return;
}
batch.insert(table.name, model.toMap());
View Watermaniac.dart
@override
void paint(Canvas canvas, Size size) {
Paint paint = new Paint()
..color = Color(0xFFc7d0df)
..strokeWidth = 6.0
..strokeCap = StrokeCap.round
..style = PaintingStyle.stroke;
canvas.drawLine(Offset(0.0, 6.0), Offset(size.width * 0.15, size.height - 6.0), paint);
canvas.drawLine(Offset(0.0, 6.0), Offset(size.width, 6.0), paint);