Skip to content

Instantly share code, notes, and snippets.

@jifalops
jifalops / designer.html
Last active August 29, 2015 14:19
designer
<link rel="import" href="../topeka-elements/topeka-datasource.html">
<link rel="import" href="../paper-calculator/paper-calculator.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@jifalops
jifalops / designer.html
Last active August 29, 2015 14:24
designer
<link rel="import" href="../ace-element/ace-element.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;

Polymer element 1->2 upgrade checklist

Do these in order.

bower.json

Between "main" and "dependencies":

"authors": ["Jacob Phillips (https://github.com/jifalops) <jifalops@gmail.com>"],
"license": "MIT",
"keywords": [

""

@jifalops
jifalops / Example_usage.dart
Last active June 30, 2021 21:14
Creating a BLoC for formatted currency, and using it in Flutter.
...
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
title: 'My App',
home: CurrencyProviderRoot(
child: MyHomePage(),
));
}
@jifalops
jifalops / bin--build_themes.dart
Last active October 5, 2018 02:42
First run prep for web package using shared_theme.
import 'dart:io';
import 'package:<project_name>/themes.dart';
void main() async {
await File('lib/src/_themes.g.scss').writeAsString(themeset.toString(), flush: true);
}
@jifalops
jifalops / main.dart
Created September 28, 2018 00:12
Example main.dart for Flutter using shared_theme.
import 'package:flutter/material.dart';
import 'package:<project_name>/config.dart';
import 'package:<project_name>/themes.dart';
import 'package:shared_theme_flutter/shared_theme_flutter.dart' as themer;
import 'package:shared_preferences/shared_preferences.dart';
void main() => runApp(App());
class App extends StatefulWidget {
_AppState createState() => _AppState();
@jifalops
jifalops / shared_theme_howto_table.md
Last active September 28, 2018 01:42
shared_theme how-to table
File Description
[bin/build_themes.dart][8] Script to generate lib/src/_themes.g.scss.
[web/index.html][9] Add small script to load saved theme.
[web/styles.scss][10] Global styles for the web app.
[lib/app_component.dart][11] The main component of the app.
[lib/app_component.html][12] The main component of the app.
[lib/app_component.scss][13] The main component of the app.
[lib/src/example_list/example_list.dart][14] Demo of current theme.
[lib/src/example_list/example_list.html][15] Demo of current theme.
@jifalops
jifalops / shared_theme_howto_screenshots.md
Created September 28, 2018 01:45
shared_theme how-to screenshots
Mobile light Mobile dark
mobile-light mobile-dark
Web light Web dark
![web-light][22] ![web-dark][23]
import 'package:flutter/material.dart';
class ABCModel extends InheritedModel<String> {
ABCModel({
Key key,
this.a,
this.b,
this.c,
Widget child,
}) : super(key: key, child: child);
@jifalops
jifalops / main.dart
Last active November 5, 2018 19:13
SimpleObserver & Debouncer demo
import 'dart:async';
import 'dart:math';
void main() {
/// Use of the SimpleObservable base class.
final observable = SimpleObservable<String>(printCallback);
observable.values.listen(printStream);
/// Recursively listens to [nextValue] and prints changes.
printFuture(observable);