Skip to content

Instantly share code, notes, and snippets.

View hawkkiller's full-sized avatar
🎯
Focusing

Michael Lazebny hawkkiller

🎯
Focusing
View GitHub Profile
@hawkkiller
hawkkiller / badge.dart
Created May 20, 2024 14:11
Dead simple badge using custom single child layout
class RecommendedBadge extends StatelessWidget {
const RecommendedBadge({super.key});
@override
Widget build(BuildContext context) => DecoratedBox(
decoration: BoxDecoration(
color: Colors.of(context).tertiary,
borderRadius: BorderRadius.circular(4),
),
child: Padding(
@hawkkiller
hawkkiller / main.dart
Last active March 20, 2024 13:31
Full code for app that uses Popup
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:popups_showcase/popup.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@hawkkiller
hawkkiller / popup.dart
Last active December 11, 2023 13:57
A widget that shows a popup relative to a target widget.
import 'package:flutter/material.dart';
/// A widget that shows a popup relative to a target widget.
///
/// The popup is declaratively shown/hidden using an [OverlayPortalController].
///
/// It is positioned relative to the target widget using the [followerAnchor] and [targetAnchor] properties.
class Popup extends StatefulWidget {
const Popup({
required this.child,
@hawkkiller
hawkkiller / eventloop.dart
Created August 3, 2023 14:50
Event Loop unloading
import 'dart:async';
import 'package:crypto/crypto.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatefulWidget {
@hawkkiller
hawkkiller / main.dart
Last active July 8, 2023 12:33
Open-closed principle violation example
sealed class Shape {}
class Circle extends Shape {
Circle(this.radius);
final double radius;
}
class Rectangle extends Shape {
Rectangle(this.width, this.height);
@hawkkiller
hawkkiller / cronjob.yaml
Created April 29, 2023 10:45
mysql backup to s3
{{ if .Values.mysql.backup.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ .Release.Name }}-mysql-backup
spec:
schedule: {{ .Values.mysql.backup.schedule | quote }}
jobTemplate:
spec:
ttlSecondsAfterFinished: {{ .Values.mysql.backup.ttlSecondsAfterFinished }}
@hawkkiller
hawkkiller / animatable_textfield.dart
Last active August 12, 2022 20:21
A textfield that contain animated widget. Like telegram new update has. A breakthrough in mobile engineering as Durov said ✌️
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
@britannio
britannio / build.yaml
Last active September 23, 2022 10:37
Example build.yaml config for https://pub.dev/packages/build_runner using ferry, moor, freezed, json_serializable and injectable
targets:
$default:
sources:
exclude:
- "**/components/**"
- "**/exceptions/**"
- "test/**"
builders:
gql_build|schema_builder:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active August 31, 2024 18:34
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example