Skip to content

Instantly share code, notes, and snippets.

View EsinShadrach's full-sized avatar
:shipit:

Rafe Esin EsinShadrach

:shipit:
View GitHub Profile
import 'package:playcope/lib.dart';
class GamesAddedCounter extends StatefulWidget {
const GamesAddedCounter({
super.key,
this.isVisible = true,
required this.controller,
this.offsetY = 0,
this.date,
});
import 'package:flutter/material.dart';
class CustomExpansionTile extends StatefulWidget {
final Widget title;
final List<Widget> children;
final bool initiallyExpanded;
final EdgeInsetsGeometry? margin;
final VoidCallback? onToggle;
const CustomExpansionTile({
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class _RiskIndicatorPainter extends CustomPainter {
final double risk;
final Color color;
const _RiskIndicatorPainter({required this.risk, required this.color});
@override
void paint(Canvas canvas, Size size) {
const strokeWidth = 8.0;
final radius = (size.shortestSide - strokeWidth) / 2;
final center = Offset(size.width / 2, size.height / 2);
import 'package:shorebird_code_push/shorebird_code_push.dart';
import 'package:restart_app/restart_app.dart';
// uses the drops package [https://pub.dev/packages/drops]
class Updater {
final BuildContext context;
final _updater = ShorebirdUpdater();
Updater({required this.context}) {
_updater.readCurrentPatch().then((patch) {
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
import 'package:flutter/services.dart';
class CircularMotion extends StatefulWidget {
final bool useBuilder;
final IndexedWidgetBuilder? builder;
final List<Widget>? children;
class ScorePickerListView extends StatefulWidget {
const ScorePickerListView({super.key});
@override
State<ScorePickerListView> createState() => _ScorePickerListViewState();
}
class _ScorePickerListViewState extends State<ScorePickerListView> {
static const itemCount = 10;
late FixedExtentScrollController fixedExtentController;
class DashedBorder extends BoxBorder {
const DashedBorder({
this.top = BorderSide.none,
this.right = BorderSide.none,
this.bottom = BorderSide.none,
this.left = BorderSide.none,
this.dashLength = 5.0,
this.dashGap = 3.0,
});
@EsinShadrach
EsinShadrach / levenshtein_distance.dart
Last active March 23, 2025 22:03
If you've ever felt .contains just doens't work for your usecase in dart.
// A string search algorithm that can handle typographical errors and misspellings
// Returns true if there is a match or if strings are similar enough
bool isFound(String string, String search) {
if (search.isEmpty) return true;
final String lowerString = string.toLowerCase();
final String lowerSearch = search.toLowerCase();
// Quick check for exact substring match
if (lowerString.contains(lowerSearch)) return true;
class AnimatedDigit extends StatefulWidget {
final int value;
final TextStyle? style;
const AnimatedDigit({
super.key,
required this.value,
this.style,
});