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'; | |
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( |
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'; | |
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( |
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'; | |
class MyHomePage extends StatefulWidget { | |
@override | |
_MyHomePageState createState() => new _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin { | |
final int numTabs = 20; | |
TabController tabController; |
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
// 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 |
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'; | |
class TabsDemo extends StatefulWidget { | |
TabsDemo({Key key}) : super(key: key); | |
@override | |
_TabsDemoState createState() => new _TabsDemoState(); | |
} | |
class _TabsDemoState extends State<TabsDemo> with TickerProviderStateMixin { |
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
// See https://github.com/flutter/flutter/issues/11222 | |
import 'package:flutter/material.dart'; | |
class TestPage2 extends StatefulWidget { | |
@override | |
_TestPageState2 createState() => new _TestPageState2(); | |
} |
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: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); |
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: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: |
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'; | |
class NewsCardLayout extends MultiChildLayoutDelegate { | |
NewsCardLayout(); | |
static const String title = 'title'; | |
static const String description = 'description'; | |
static const String source = 'source'; | |
@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 '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', |
OlderNewer