Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
class TwoLevelListDemo extends StatelessWidget {
static const String routeName = '/two-level-list';
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text('Expand/collapse list control')),
body: new Column(
import 'package:flutter/material.dart';
class TwoLevelListDemo extends StatelessWidget {
static const String routeName = '/two-level-list';
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text('Expand/collapse list control')),
body: new Column(
import 'package:flutter/material.dart';
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
final int numTabs = 20;
TabController tabController;
// See https://github.com/flutter/flutter/issues/10531
/*
In release mode the app is often asked to layout before the engine
has initialized to the point where the size of the screen is known.
In that case the app is built and laid out with 0x0 constraints and
then later with the screen's actual size.
The phantom tabbar scrolling seen here upon app startup is due to the
scrollable tabbar's scroll offset being "corrected" once the tab bar's
import 'package:flutter/material.dart';
class TabsDemo extends StatefulWidget {
TabsDemo({Key key}) : super(key: key);
@override
_TabsDemoState createState() => new _TabsDemoState();
}
class _TabsDemoState extends State<TabsDemo> with TickerProviderStateMixin {
// See https://github.com/flutter/flutter/issues/11222
import 'package:flutter/material.dart';
class TestPage2 extends StatefulWidget {
@override
_TestPageState2 createState() => new _TestPageState2();
}
import 'dart:math' as math;
import 'package:flutter/material.dart';
const _kHeadingGap = 8.0;
const _kMinHeadingsHeight = 90.0;
// Scroll animation from full-screen section heading column layout to row layout.
const Duration _kScrollDuration = const Duration(milliseconds: 400);
import 'dart:math' as math;
import 'package:flutter/material.dart';
const _kMidHeadingsHeight = 128.0;
const _kMinHeadingsHeight = 72.0;
// SectionHeadingsLayout computes the initial bounds of each heading based
// on the layout configuration:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
// Bezier demo does not hit 60fps
// https://github.com/flutter/flutter/issues/17889
import 'dart:math';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class Point {