Skip to content

Instantly share code, notes, and snippets.

// Copyright 2017 The Chromium Authors. 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:async';
import 'package:meta/meta.dart' show required, visibleForTesting;
import 'method_channel_url_launcher.dart';
@collinjackson
collinjackson / coverage.sh
Last active September 23, 2019 22:55
Gets coverage data for Flutter packages
#!/bin/bash
set -e
if [ $# -eq 0 ]
then
echo Usage: ./coverage.sh package_1 package_2 ...
exit 1
fi
for package in $@; do
@collinjackson
collinjackson / main.dart
Last active February 19, 2021 15:07
ColorFilter example
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
/// Applies a color filter before painting its child.
class ColorFiltered extends SingleChildRenderObjectWidget {
/// Creates a widget that color filters its child.
///
/// The [colorFilter] argument must not be null.
const ColorFiltered({
@collinjackson
collinjackson / results.txt
Created May 13, 2019 23:05
results of running integration tests on flutter stable
jackson-macbookpro4:packages jackson$ pub global run flutter_plugin_tools drive-examples
RUNNING DRIVER TEST for cloud_firestore/example/test_driver/cloud_firestore.dart
Running "flutter packages get" in example... 1.4s
Using device Android SDK built for x86.
Starting application: test_driver/cloud_firestore.dart
Initializing gradle... 0.6s
Resolving dependencies... 2.0s
Installing build/app/outputs/apk/app.apk... 2.6s
Running Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
@deprecated('Use `FacebookAuthProvider` and `signInAndRetrieveData` instead')
Future<FirebaseUser> signInWithFacebook(
{@required String accessToken}) {
return signIn(credential: FacebookAuthProvider.getCredential(accessToken: accessToken));
}
/// Signs in with a Twitter account using the specified credentials.
///
/// The returned future completes with the signed-in user or a [PlatformException], if sign in failed.
@deprecated('Use `TwitterAuthProvider` and `signInAndRetrieveData` instead')
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@collinjackson
collinjackson / nested_scroll_view.dart
Last active September 25, 2022 05:29
nestedscrollview example
// Copyright 2017, the Flutter 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(new TestApp());
}
@collinjackson
collinjackson / nested_navigator.dart
Created November 28, 2017 20:07
Nested navigator example
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
home: new Container(
color: Colors.white,
child: new MyAppHome(),
),
));
}
@collinjackson
collinjackson / sentry_example.dart
Created August 25, 2017 14:34
Example of sentry wrapping http.Client
// Non-confidential feedback for Posse
class SentryHttpClient extends BaseClient {
SentryHttpClient(this._inner);
final Client _inner;
@override
Future<StreamedResponse> send(BaseRequest request) async {
try {
return _inner.send(request);
// Non-confidential feedback for Posse
import 'dart:async';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:meta/meta.dart';
import 'package:numberpicker/numberpicker.dart';
class _BirthDatePickerDialog extends StatefulWidget {