Skip to content

Instantly share code, notes, and snippets.

@johnpryan
johnpryan / main.dart
Last active November 19, 2019 18:47
Todo App
import 'package:flutter_web/material.dart';
import 'package:flutter_web_test/flutter_web_test.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
Future main() async {
await ui.webOnlyInitializePlatform();
runApp(TasksApp());
}
class Task {
@johnpryan
johnpryan / main.dart
Last active November 19, 2019 18:47
Sliding Square
import 'package:flutter_web/material.dart';
import 'package:flutter_web_test/flutter_web_test.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
Future main() async {
await ui.webOnlyInitializePlatform();
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: AnimatedAlignDemo(),
theme: ThemeData.dark(),
@johnpryan
johnpryan / main.dart
Created November 22, 2019 22:51 — forked from RedBrogdon/main.dart
Todo App
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() {
runApp(TasksApp());
}
@johnpryan
johnpryan / main.dart
Last active November 22, 2019 22:52 — forked from RedBrogdon/main.dart
Sliding Square
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
@johnpryan
johnpryan / main.dart
Created January 7, 2020 22:42
Custom notifications in Flutter
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
MyApp();
_MyAppState createState() => _MyAppState();
@johnpryan
johnpryan / main.dart
Last active January 16, 2020 22:23
Drawer navigation in Flutter
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: RootPage(),
));
}
class Destination {
@johnpryan
johnpryan / main.dart
Created April 8, 2022 18:56
Dart mixin precedence
void main() {
var animal = Bird();
print(animal.nextAction());
}
abstract class Animal {
String get name;
// 4th precedence
String makeNoise() => '(uninteligble animal sound)';
@johnpryan
johnpryan / main.dart
Created June 29, 2022 21:27
wild-snow-4456
/// This is a test of the new GitHub integration feature.
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@johnpryan
johnpryan / LICENSE
Last active September 21, 2022 19:36
go_router 5 sample
Copyright 2013 The Flutter Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
@johnpryan
johnpryan / main.dart
Created December 19, 2022 21:22
ubiquitous-cliff-4392
import 'package:flutter/material.dart';
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart';
import 'package:go_router/go_router.dart';
void main() {
runApp(DevToolsApp());
}
final _router = GoRouter(
routes: [