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:io'; | |
import 'package:figma_squircle/figma_squircle.dart'; | |
import 'package:flutter/widgets.dart'; | |
class RoundedRectangle extends StatelessWidget { | |
const RoundedRectangle({ | |
super.key, | |
this.radius = 10, | |
this.height, |
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
for f in $(find ./ -name '*.dart') | |
do | |
(echo "// @dart=2.9" && cat $f) > filename1 && mv filename1 $f | |
done |
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
main() { | |
BuildContext context; | |
final router = NavigationService(context); | |
return MaterialApp( | |
onGenerateRoute: (settings) => router.handleGenerateRoute( | |
settings, | |
routes: { | |
'/': (params, context) => HomeView(), |
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 'dart:io'; | |
class Database { | |
/// A simple JSON file database | |
Database(String path) : file = File(path); | |
final File file; | |
var _store = <String, dynamic>{}; |
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:math' show Random; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart' show RendererBinding; | |
void main() { | |
runApp(MaterialApp( | |
home: Home(), | |
)); | |
} |
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/widgets.dart'; | |
/// Conditionally wrap a subtree with a parent widget without breaking the code tree. | |
/// | |
/// [condition]: the condition depending on which the subtree [child] is wrapped with the parent. | |
/// [child]: The subtree that should always be build. | |
/// [conditionalBuilder]: builds the parent with the subtree [child]. | |
/// | |
/// ___________ | |
/// Usage: |
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
// MIT License | |
// | |
// Copyright (c) 2020 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
// MIT License | |
// | |
// Copyright (c) 2020 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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:logger/logger.dart'; | |
void main() async { | |
/// Setup logging service | |
final remoteUrl = Uri.parse('http://localhost:8080'); | |
final logger = LoggingService( | |
loggers: { | |
ConsoleLogger(), | |
RemoteLogger(baseUrl: remoteUrl), | |
}, |
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
#!/bin/sh | |
# To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script: | |
# sh ./fluttercleanrecursive.sh | |
# or | |
# sudo sh fluttercleanrecursive.sh | |
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)" | |
echo "Looking for projects... (may take a while)" |
NewerOlder