This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui'; | |
class QuadraticBezier { | |
final Offset p0; | |
final Offset p1; | |
final Offset p2; | |
/// Returns a list of [QuadraticBezier]s which represent smooth line joins between knots. | |
/// | |
/// To reduce the smoothing at the joins reduce [maxJoinSegmentLength]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui'; | |
/// Returns control points which can be used to create a bezier path which is smooth at the joins between [knots]. | |
/// | |
/// The result contains one less set of control points than there are [knots]. To construct a path start by moving to | |
/// the first knot and add cubic bezier segments for the other knots. | |
/// | |
/// Ported from https://www.codeproject.com/Articles/31859/Draw-a-Smooth-Curve-through-a-Set-of-2D-Offsets-wit | |
List<List<Offset>> bezierSplineControlOffsets(List<Offset> knots) { | |
assert(knots != null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FirebaseDatabase } from '@blaugold/angular-firebase' | |
import 'rxjs/add/operator/map' | |
/** | |
* This example demonstrates the type checking ability when the database is used with a schema. | |
* Open this file with an ide like VS Code or WebStorm and you should see error highlighting. | |
*/ | |
interface DBSchema { | |
todoLists: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use the TypeScript compiler to check your database rules. | |
// You'll get the most out of type checking if you define a database schema | |
// through interfaces and use it both in the web client and with the database rules. | |
// The compiler will catch misspellings and structural errors. | |
// It won't check for completeness since all properties are optional. | |
// Only works with TypeScript 2.1 and up because of mapped types being used. | |
interface DatabaseRuleSet { | |
'.read'?: string | boolean | |
'.write'?: string | boolean |
NewerOlder