Skip to content

Instantly share code, notes, and snippets.

View sthefanoss's full-sized avatar
🏠
Working from home

Sthefano Schiavon sthefanoss

🏠
Working from home
View GitHub Profile
@sthefanoss
sthefanoss / add_dart_2_9.sh
Last active February 22, 2023 21:19
Adds "//@Dart=2.9" on every .dart file inside /lib folder. Useful when migrating to null-safety.
# Adds "//@dart=2.9" on every .dart file inside /lib folder.
# Useful when migrating to null-safety.
addDart29ToFile() {
echo "//@dart=2.9" > tmpfile
cat "$1" >> tmpfile
mv tmpfile "$1"
}
runFolderRecursively () {
import "dart:math";
class Complex {
double real;
double imaginary;
Complex(this.real, this.imaginary);
Complex.polar(double magnitude, double angle) {
this.real = magnitude * cos(angle);
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: StrangeWidget(),
),
);
}
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(home: MyHomePage());
}
@sthefanoss
sthefanoss / kmeans_flutter_app.dart
Created July 18, 2020 23:27
Flutter app for kmeans visualization.
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override