Skip to content

Instantly share code, notes, and snippets.

abstract class CustomColors with Diagnosticable{
const CustomColors();
CustomColors lerp(CustomColors other, double t);
}
class MyCustomColors implements CustomColors {
const MyCustomColors({ this.foo, this.bar });
final Color foo;
final Color bar;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// Enables sharing keyword value data with an entire app.
//
// AppModel.set(context, keyword, value) adds an entry to the shared data table.
//
// AppModel.get(context, keyword) returns the value for keyword or null.
//
// A widget whose build method uses AppModel.get(context, keyword)
return Scaffold(
body: SignInForm(
authentication: Authentication.OAuth,
stateFeedbackBuilder: (state, ..) {
if (state is SigningIn) return const CircularProgressIndicator();
if (state is AuthFailed) return ErrorText(state.exception);
return null;
},
providers: [
const ProviderButton<Google>();
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
const Home({ Key? key }) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
import 'package:flutter/material.dart';
/// This class demonstrates how to replace a [ButtonBar[ which specifies a
/// [MainAxisAlignment] with an [OverflowBar].
///
/// By default the ButtonBar separates the buttons by 8 and pads either
/// end of its row with 8. If the alignment is [MainAxisAlignment.spaceAround]
/// the the padding at the ends is reduced to 4, and if the alignment is
/// [MainAxisAlignment.spaceEvenly] the padding at the ends is zero.
class OverflowButtonBar extends StatelessWidget {
import 'package:flutter/material.dart';
class DemoRow extends StatelessWidget {
DemoRow(this.alignment);
final MainAxisAlignment alignment;
@override
Widget build(BuildContext context) {
const List<Widget> items = <Widget>[
/// Flutter code sample for AnimatedSize
// This example makes a [Container] react to being touched, causing the child
// of the [AnimatedSize] widget, here a [FlutterLogo], to animate.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
/// This is the main application widget.
Hello world Hello world Hello world Hello world Hello world Hello world 0</br>
Hello world Hello world Hello world Hello world Hello world Hello world 1</br>
Hello world Hello world Hello world Hello world Hello world Hello world 2</br>
Hello world Hello world Hello world Hello world Hello world Hello world 3</br>
Hello world Hello world Hello world Hello world Hello world Hello world 4</br>
Hello world Hello world Hello world Hello world Hello world Hello world 5</br>
Hello world Hello world Hello world Hello world Hello world Hello world 6</br>
Hello world Hello world Hello world Hello world Hello world Hello world 7</br>
Hello world Hello world Hello world Hello world Hello world Hello world 8</br>
Hello world Hello world Hello world Hello world Hello world Hello world 9</br>
// 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:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
class StaggerAnimation extends StatelessWidget {
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextButton.icon(
icon: const Icon(Icons.check_box),
label: const Text('TextButton'),