Skip to content

Instantly share code, notes, and snippets.

View jogboms's full-sized avatar
πŸ’™
Building Awesome w/ Dart & Flutter

Jeremiah Ogbomo jogboms

πŸ’™
Building Awesome w/ Dart & Flutter
View GitHub Profile
@sma
sma / flag.dart
Last active January 16, 2022 19:05
A Flag widget to display flags (doesn't work on Dart Pad)
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@slightfoot
slightfoot / bubble_effect.dart
Created March 18, 2021 00:42
3D Style Bubble Magnifying Effect - by Simon Lightfoot and Wilson Wilson @wilsonowilson - 18/03/2021
// MIT License
//
// Copyright (c) 2021 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@sma
sma / hyper.dart
Created February 28, 2021 08:58
a proof of concept micro web framework inspired by an older version of Jorge Bucaran's hyperapp
import 'dart:async';
import 'dart:html';
/// [H] is what you'd call a virtual DOM node, representing HTML elements.
///
/// You call it with a tag name that optionally contains one or more class
/// names prefixed by `.` and/or an ID prefixed by `#`. If you pass a `Map`,
/// it is used as properties. If you pass other objects, they are used as
/// children. `List` objects are flattened, `null` values are ignored, other
/// [H] instances are taken literally, everything else is converted into
@sma
sma / json.dart
Created December 14, 2020 18:11
a typesafe wrapper for accessing json
class Json extends Iterable<Json> {
Json(this.value);
Json.from(String s) : this(jsonDecode(s));
final dynamic value;
@override
String toString() => jsonEncode(value);
@timsneath
timsneath / PolarCoordinate.dart
Last active May 27, 2023 18:08
Demonstrates a polar coordinate system with Flutter
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/gestures.dart';
const double kTwoPi = 2 * math.pi;
class SectorConstraints extends Constraints {
const SectorConstraints({
@sma
sma / gap.dart
Created May 3, 2020 08:56
A widget to add gaps to Row and Column widgets
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@dwchiang
dwchiang / Makefile
Created May 1, 2020 14:42
Flutter: intl_translation: extract_to_arb & generate_from_arb
.PHONY: help l10n-extract-to-arb l10n-generate-from-arb
help:
@ echo 'Available commands:'
@ echo
@ echo ' l10n-extract-to-arb : Extract app_localizations.dart into intl_messages.arb'
@ echo ' Duplicate content of intl_messages.arb into intl_xx.arb'
@ echo ' l10n-generate-from-arb : Generate messages_*.dart files from intl_*.arb'
@ echo
@ echo
@antfu
antfu / πŸ“Š Weekly development breakdown
Last active November 5, 2025 05:23
πŸ“Š Weekly development breakdown
TypeScript 21 hrs 47 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘ 67.1%
Vue.js 6 hrs 21 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 19.6%
JSON 2 hrs 10 mins β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 6.7%
JavaScript 46 mins β–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.4%
import 'package:flutter/material.dart';
class FadeIndexedStack extends StatefulWidget {
final int index;
final List<Widget> children;
final Duration duration;
const FadeIndexedStack({
Key key,
this.index,
@lukepighetti
lukepighetti / extents_page_view.dart
Last active January 19, 2025 11:24
Flutter PageView that loads the next/previous page off-screen
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart' hide PageView;
/// This is copy-pasted from the Flutter framework with a support added for building
/// pages off screen using [Viewport.cacheExtents] and a [LayoutBuilder]
///
/// Based on commit 3932ffb1cd5dfa0c3891c60977ee4f9cd70ade66 on channel dev
// Having this global (mutable) page controller is a bit of a hack. We need it