Skip to content

Instantly share code, notes, and snippets.

( ´・‿・`)

Masayuki Ono (mono) mono0926

( ´・‿・`)
View GitHub Profile
View index.html
@media (prefers-color-scheme: dark) {
body {
background-color: black;
mono0926 / pubspec.yaml
Created May 18, 2022
View pubspec.yaml
ref: 09cca32f7548fe8a31b5db0941ca142a13f0ed6e
path: json_serializable
mono0926 / dart.json
Created May 17, 2022
ThemeExtensionのUser Snippet
View dart.json
"Theme Extension": {
"prefix": "thmex",
"description": "Insert a Theme Extension class",
"body": [
"class $1 extends ThemeExtension<$1> {",
" const $1({",
" required this.$3,",
" });",
View main.dart
import 'package:test/test.dart';
import 'package:lexicographical_order/lexicographical_order.dart';
void main() {
test('Output', () {
final first = generateOrderKeys(1).first;
print('first: $first'); // a
final previous = between(next: first);
print('previous: $previous'); // N
final next = between(prev: first); // n
View main.dart
import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
Future<void> main() async {
runApp(const App());
final router = GoRouter(
View main.dart
// 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.
// Flutter code sample for ThemeExtension
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:intl/intl.dart';
View main.dart
const condition = false;
void main() {
// {} 省略はミスの元なので一般的に良くないと言われているけどdart format前提ならミスしなさそうで、ありな気もする🤔
if (condition) throw Exception('hello');
// `throw`の前で改行してFix Allすると自動的に {} 付けてくれて便利
if (condition) {
throw Exception('hello');
mono0926 / settings.json
Last active Mar 9, 2022 — forked from gaetschwartz/settings.json
Nest files in Flutter projects on VSCode, inspired from
View settings.json
"explorer.experimental.fileNesting.enabled": true,
"explorer.experimental.fileNesting.expand": false,
"explorer.experimental.fileNesting.patterns": {
"pubspec.yaml": ".flutter-plugins, .packages, .dart_tool, .flutter-plugins-dependencies, .metadata, .packages, pubspec.lock, build.yaml, analysis_options.yaml, all_lint_rules.yaml, l10n.yaml",
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
"readme.*": "authors,, changelog*, citation*,, codeowners,, contributors, copying, credits,,, license*, maintainers, readme*,,",
View count_state.dart
import 'package:flutter/foundation.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'count_state.freezed.dart';
class CountState with _$CountState {
const factory CountState({
@Default(0) int count,
}) = _CountState;
View count_controller.dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'count_state.dart';
final countProvider = StateNotifierProvider<CountController, CountState>(
(ref) => CountController(,
class CountController extends StateNotifier<CountState> {
CountController(this._read) : super(const CountState());