Skip to content

Instantly share code, notes, and snippets.

View timmaffett's full-sized avatar

Tim Maffett timmaffett

View GitHub Profile
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+k",
"command": "-editor.action.addCommentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+1",
"command": "moveActiveEditor",
@timmaffett
timmaffett / asset_bundle_find_helpers.dart
Last active May 20, 2024 23:22
Flutter: AssetBundleFindHelpers extension class on AssetBundle
import 'package:flutter/services.dart';
/// Implements @matthew-carroll 's proposal in https://github.com/flutter/flutter/issues/137043
///
/// Example use/results
///
/// in main():
///
/// await rootBundle.initAssetBundleFindHelpers(); //strictly speaking this does not need to be awaited
///
@timmaffett
timmaffett / main.dart
Created April 19, 2024 22:32
Example of AutoComplete with support for focusNode and textEditingController
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/scheduler.dart';
import 'package:flutter/material.dart';
//import 'ink_well.dart';
//import 'material.dart';
//import 'text_form_field.dart';
@timmaffett
timmaffett / main.dart
Last active May 1, 2023 06:19
wild-gorge-8043
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@timmaffett
timmaffett / main.dart
Created April 24, 2023 18:21
wild-gorge-8043
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
import 'dart:ui';
import 'package:flutter/material.dart' hide Gradient;
import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame/effects.dart';
class SunSegment extends RectangleComponent {
SunSegment(int i)
: super(
@timmaffett
timmaffett / main.dart
Created July 4, 2022 17:00 — forked from immadisairaj/main.dart
Flame Water Wave #FlameEffectsChallenge
import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame/effects.dart';
import 'package:flutter/material.dart';
void main() {
runApp(
GameWidget(game: FlameWave()),
);
}
@timmaffett
timmaffett / index.html
Last active April 5, 2022 15:48 — forked from jcollins-g/index.html
Sunflower
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sunflower</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>
@timmaffett
timmaffett / index.html
Last active April 5, 2022 15:22
Vim Cheat Sheet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vim Cheat Sheet</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>
@timmaffett
timmaffett / index.html
Last active March 16, 2022 11:15
dartpad example for clear console branch
<h1 id="header"></h1>
<button id="clicker"
class="favorite styled"
type="button">
Click me to make console messages
</button>
<br/><br/><br/><br/>
<h3>Open the Console and click the clear console button
<image class="icon" src="https://timmaffett.github.io/clearconsole/pictures/clear-console.svg" />
in the upper right to clear the console messages that you