Skip to content

Instantly share code, notes, and snippets.

View sethladd's full-sized avatar

Seth Ladd sethladd

View GitHub Profile
import 'package:flutter/material.dart';
import 'eventdetails/eventdetails.dart';
class SquanchyFlutterApp extends StatelessWidget {
@override
build(context: BuildContext): Widget {
final theme = ThemeData(
primarySwatch: MaterialColor(0XFFE65B77, {
var stack = Stack (
key: 1
Image.asset ( // background photo
"assets/texture.jpg"
fit: ImageFit.cover
height: 600.0
)
Positioned ( // headline
analyzer:
strong-mode: true
linter:
rules:
- always_declare_return_types
- always_specify_types
- annotate_overrides
- avoid_as
- avoid_empty_else
- avoid_init_to_null
// Real libraries and modules.
library search;
import 'dart:async' show Future;
import 'package:flutter/http.dart' as http;
// Future (aka Promise), type annotations, and top-level functions!
// And yes, async/await without translators!
Future<List<SearchResult>> fetchResults(String query) async {
// single-quote strings, and string interpolation!
import 'package:flutter/material.dart';
void main() {
runApp(
new MaterialApp(
title: "Flutter Demo",
routes: <String, RouteBuilder>{
'/': (RouteArguments args) => new FlutterDemo()
}
)
sayHi() {
print('hi');
}
@sethladd
sethladd / animated_text_flutter.dart
Created December 19, 2015 19:03
My first animated text with Flutter. This is using a very early version of Flutter. This probably won't work by the time you stumble across this code. :)
import 'package:flutter/material.dart'
show
BuildContext,
Positioned,
Stack,
State,
StatefulComponent,
Text,
Widget,
runApp;
@sethladd
sethladd / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
#core_header_panel {
@sethladd
sethladd / simple_serialization_tests.dart
Created August 5, 2014 21:07
Looking at both a simple by-hand JSON serialization, and an "automatic" serialization via mirrors. Note: this is by design extremely limited and only for illustration in a mailing list thread. Your need are almost certainly different and will need something custom.
import 'dart:convert';
import 'package:smoke/smoke.dart' as smoke;
@MirrorsUsed(targets: const [SimpleWithMirrors, Simple], override: '*')
import 'dart:mirrors';
class Simple {
int id;
String name;
@sethladd
sethladd / pubspec.yaml
Created March 24, 2014 17:12
dart:js and package:js test for code size
name: testjsinterop
description: A sample web application
dependencies:
browser: any
js: any
quiver: any