Skip to content

Instantly share code, notes, and snippets.

class Parent {}
class Sub implements Parent {
String get blah => "blah";
}
String fnSub(Sub sub) => sub.blah;
String aProblem(Parent parent) => fnSub(parent);
@atreeon
atreeon / pubspec.yaml
Created September 6, 2018 10:52
testing test yaml
name: testTesting
description: Its all about tests here.
dev_dependencies:
test: 1.3.0
@atreeon
atreeon / testingTest.dart
Last active September 6, 2018 10:49
testingTest
import "package:test/test.dart";
void main() {
test("String.split() splits the string on the delimiter", () {
var string = "foo,bar,baz";
expect(string.split(","), equals(["foo", "bar", "baz"]));
});
}
@atreeon
atreeon / TextAndDropdown.dart
Created July 26, 2018 08:07
Text and Dropdown, changing focus
import 'package:flutter/material.dart';
class TextAndDropdown extends StatefulWidget {
@override
_TextAndDropdownState createState() => _TextAndDropdownState();
}
class _TextAndDropdownState extends State<TextAndDropdown> {
int selectedDropdown;
String selectedText;
/*
Firebase Security Rules
{
"rules": {
".read": "auth != null",
}
}
*/
@atreeon
atreeon / onebyteString.dart
Last active May 17, 2018 13:31
OneByteString from regex split
void main() {
var sourceText = '**this** and **my other string** please';
var regexAsterisk = new RegExp(r"\*\*(.*?)\*\*");
var splits = sourceText.split(regexAsterisk);
for (var split in splits) {
print("IsEmpty:" + split.isEmpty.toString() + ":" + split);
}
}
@atreeon
atreeon / asterisk.dart
Last active May 17, 2018 11:32
regular expressions dart asterisk
void main() {
var sourceText = 'find me **this** and **my other string** please';
var regexAsterisk = new RegExp("\*\*(.*?)\*\*");
var splits = sourceText.split(regexAsterisk);
for (var split in splits) {
print(split);
}
}