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.fileNesting.enabled": true, | |
"explorer.fileNesting.expand": false, | |
"explorer.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", | |
".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", | |
"*.dart": "$(capture).g.dart, $(capture).freezed.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
void main() { | |
const String accessLevel = "user"; | |
if (accessLevel != "user // Check if admin ") { | |
print("You are an admin."); | |
} | |
} |
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
class C { | |
C(); | |
int i = 0; | |
} | |
void main() { | |
final myClass = C(); | |
for (final i = myClass; i.i < 5; i.i++) {} |
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 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return const MaterialApp( |
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/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override |
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 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
void sound() => SystemSound.play(SystemSoundType.alert); | |
void main() { | |
FlutterError.onError = (e) => sound(); | |
runZonedGuarded<void>(() => runApp(MyApp()), (e, s) => sound()); |
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
void main() async { | |
final a = A(); | |
print(a is N); | |
print(a is M); | |
} | |
mixin M { | |
int get number => 20; | |
} |
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
/// Flutter code sample for LogicalKeyboardKey | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
void main() => runApp(MyApp()); | |
/// This is the main application widget. | |
class MyApp extends StatelessWidget { | |
static const String _title = 'Flutter Code Sample'; |
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/material.dart'; | |
import 'package:freezed_annotation/freezed_annotation.dart'; | |
part 'colorscheme.freezed.dart'; | |
part 'colorscheme.g.dart'; | |
@freezed | |
abstract class SerializableColorScheme with _$SerializableColorScheme { | |
@ColorConverter() | |
factory SerializableColorScheme({ |
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
final _fetcher = Fetcher(); | |
final _futureRouteProvider = ChangeNotifierProvider<Fetcher>((ref) { | |
_fetcher.fetch(ref); | |
return _fetcher; | |
}); | |
class Fetcher extends ChangeNotifier { | |
RouteStates _state = const RouteStates.empty(); |
NewerOlder