Skip to content

Instantly share code, notes, and snippets.

View RobertBrunhage's full-sized avatar

Robert Brunhage RobertBrunhage

View GitHub Profile
@RobertBrunhage
RobertBrunhage / .gitconfig
Last active July 21, 2023 18:45
Ignore files/folders that makes me cringe
[core]
excludesfile = ~/.gitignore
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@RobertBrunhage
RobertBrunhage / material_bottomsheet_hell.dart
Last active May 9, 2023 05:41
A usage of material bottomsheet that should push the bottomsheet up in case of keyboard, but doesn't
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@RobertBrunhage
RobertBrunhage / main.dart
Last active May 7, 2023 11:38
Dart 3 examples
// ------- Different class declarations -------
base class BaseClassExample {}
mixin class MiximClassExample {}
final class FinalClassExample {}
// ------- Different class usages -------
@RobertBrunhage
RobertBrunhage / nnoremap.lua
Last active December 23, 2022 13:06
nnoremap
-- vimscript way
-- nnoremap <leader>fd :below new output:///flutter-dev <CR>
-- lua way
vim.keymap.set("n", "<leader>fd", ":below new output:///flutter-dev <CR>")
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(HomePage());
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@RobertBrunhage
RobertBrunhage / Flutter_test_snippets.code-snippets
Created January 2, 2021 15:07
These snippets I have gotten from FilledStacks so make sure to follow him!
{
"Main Test Suite Setup": {
"prefix": "testm",
"body": [
"import 'package:flutter_test/flutter_test.dart';",
"",
"void main() {",
" group('${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} -', (){",
"",
" });",
import 'dart:async';
import 'package:flutter/widgets.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
int useInfiniteTimer(BuildContext context) {
return use(const _InfiniteTimer());
}
class _InfiniteTimer extends Hook<int> {
[dev-command]: register dev command
[sdk]: which flutter command => C:\Users\Robert-windows\Development\flutter\bin\flutter.BAT
[sdk]: flutter command path => C:\Users\Robert-windows\Development\flutter\bin\flutter.BAT
[sdk]: dart sdk home => C:\Users\Robert-windows\Development\flutter\bin\cache\dart-sdk
[sdk]: analyzer path => C:\Users\Robert-windows\Development\flutter\bin\cache\dart-sdk\bin\snapshots\analysis_server.dart.snapshot
[sdk]: dart command path => C:\Users\Robert-windows\Development\flutter\bin\cache\dart-sdk\bin\dart.exe
[sdk]: dart version: v2.11.0
[lsp-server]: rightVersion true
[Trace - 05:59:22] Sending request 'initialize - (0)'.
Params: {
include: all_lint_rules.yaml
analyzer:
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
# This is generated from the i18n vscode extension
- "**/i18n.dart"
strong-mode:
implicit-casts: false
implicit-dynamic: false