This file contains hidden or 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'; | |
import 'dart:math'; | |
String generateScaleCommand( | |
int inputWidth, int inputHeight, int originalWidth, int originalHeight) { | |
final aspectRatio = originalWidth / originalHeight; | |
bool fitToWidth = inputWidth > inputHeight; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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/bash | |
chmod 777 ./hotreloader.sh | |
echo 'Script is running'; | |
while true | |
do | |
find lib/ -name '*.dart' | entr -dnp ./hotreloader.sh /_ | |
done |
This file contains hidden or 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
// ignore_for_file: public_member_api_docs, sort_constructors_first | |
import 'package:flutter/material.dart'; | |
const duration = Duration(milliseconds: 50); | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
This file contains hidden or 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' as math; | |
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
const duration = Duration(milliseconds: 50); | |
extension OffsetExtensions on Offset { | |
Offset offsetDistance(Offset end) { | |
double dx = end.dx - this.dx; |
This file contains hidden or 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'; | |
class DelayedDisplay extends StatefulWidget { | |
final Widget child; | |
final Duration delay; | |
final Duration fadingDuration; |
This file contains hidden or 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
// https://pub.dev/packages/file_picker | |
import 'package:file_picker/file_picker.dart'; | |
getMultipalFiles() async { | |
FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true); | |
List<File> files = []; | |
if (result != null) { | |
files = result.paths.map((path) => File(path)).toList(); | |
} else { |
This file contains hidden or 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:palette_generator/palette_generator.dart'; | |
class ColorGenrator { | |
Future<List<Color>> getImagePalette(ImageProvider imageProvider) async { | |
try { | |
final PaletteGenerator paletteGenerator = | |
await PaletteGenerator.fromImageProvider( | |
imageProvider, |