Skip to content

Instantly share code, notes, and snippets.

@johnpryan
johnpryan / main.dart
Created March 2, 2023 21:24
tangled-gust-5485
import 'package:flutter/material.dart';
import 'package:flame/flame.dart';
import 'dart:async';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@johnpryan
johnpryan / main.dart
Last active April 24, 2023 23:23
Patterns example
class Drink {
int ounces;
Drink(this.ounces);
}
class Coffee extends Drink {
final bool decaf;
Coffee(int ounces, {this.decaf = false}) : super(ounces);
}
@johnpryan
johnpryan / main.dart
Created October 10, 2023 17:46
lively-performance-3668
void main() {
var record = ("Hello", "World");
var record2 = ("Hello", "World");
print(record == record2);
print(record.hashCode);
print(record2.hashCode);
}
@johnpryan
johnpryan / main.dart
Created October 18, 2023 16:50
lively-performance-3668
bool isVertical = false;
Widget build() {
return const Column(
direction: isVertical ? 'vertical' : 'horizontal',
children: [
Widget(),
Widget(),
],
);
}