View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
@media (prefers-color-scheme: dark) { | |
body { | |
background-color: black; | |
} | |
} | |
</style> |
View pubspec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependency_overrides: | |
json_serializable: | |
git: | |
url: https://github.com/google/json_serializable.dart | |
ref: 09cca32f7548fe8a31b5db0941ca142a13f0ed6e | |
path: json_serializable |
View dart.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Theme Extension": { | |
"prefix": "thmex", | |
"description": "Insert a Theme Extension class", | |
"body": [ | |
"@immutable", | |
"class $1 extends ThemeExtension<$1> {", | |
" const $1({", | |
" required this.$3,", | |
" });", | |
"", |
View main.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:adaptive_dialog/adaptive_dialog.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:go_router/go_router.dart'; | |
Future<void> main() async { | |
GoRouter.setUrlPathStrategy(UrlPathStrategy.path); | |
runApp(const App()); | |
} | |
final router = GoRouter( |
View main.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const condition = false; | |
void main() { | |
// {} 省略はミスの元なので一般的に良くないと言われているけどdart format前提ならミスしなさそうで、ありな気もする🤔 | |
// https://dart-lang.github.io/linter/lints/always_put_control_body_on_new_line.html | |
if (condition) throw Exception('hello'); | |
// `throw`の前で改行してFix Allすると自動的に {} 付けてくれて便利 | |
if (condition) { | |
throw Exception('hello'); |
View settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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, backers.md, changelog*, citation*, code_of_conduct.md, codeowners, contributing.md, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors.md", | |
}, |
View count_state.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart'; | |
import 'package:freezed_annotation/freezed_annotation.dart'; | |
part 'count_state.freezed.dart'; | |
@freezed | |
class CountState with _$CountState { | |
const factory CountState({ | |
@Default(0) int count, | |
}) = _CountState; |
View count_controller.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
import 'count_state.dart'; | |
final countProvider = StateNotifierProvider<CountController, CountState>( | |
(ref) => CountController(ref.read), | |
); | |
class CountController extends StateNotifier<CountState> { | |
CountController(this._read) : super(const CountState()); |
NewerOlder