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
class Adaptation<T> { | |
const Adaptation(); | |
Type get type => T; | |
T adapt(ThemeData theme, T defaultValue) => defaultValue; | |
} | |
class ThemeData { | |
factory ThemeData({ Iterable<Adaptation>? adaptations }) { | |
return ThemeData.raw( | |
adaptationMap: <Type, Adaptation>{ |
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'; | |
/// Animated text widget that will animate changes in [temperature] to match | |
/// the effect on the new thermostats. | |
class AnimatedTemperatureText extends StatefulWidget { | |
final int temperature; | |
final Color textColor; | |
const AnimatedTemperatureText({ | |
super.key, |
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/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
class Item extends StatelessWidget { | |
const Item({ super.key, required this.title, required this.color }); |
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
// From the original Flutter gallery demo | |
// dev/integration_tests/flutter_gallery/lib/demo/material/page_selector_demo.dart | |
import 'package:flutter/material.dart'; | |
class _PageSelector extends StatelessWidget { | |
const _PageSelector({ this.icons }); | |
final List<Icon>? icons; |
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
// A CoordinatedSliver that auto-scrolls to align itself with the | |
// top of the viewport when a scroll gesture leaves it partially visible. | |
// | |
// This demo must be run in a simulator or on a mobile device | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/scheduler.dart'; | |
class Item extends StatelessWidget { |
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'; | |
import 'package:flutter/rendering.dart'; | |
class Destination { | |
const Destination(this.index, this.title, this.icon, this.color); | |
final int index; | |
final String title; | |
final IconData icon; | |
final MaterialColor color; | |
} |
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
// ReszingHeaderSliver AppBar Parts example: contacts version with autoscroll | |
// New coordinator API; coordinated slivers report layout info directly. | |
// https://gist.github.com/HansMuller/fd7b154108a142a0ea2ef1be24d09e94 | |
// dartpad.dev/?id=fd7b154108a142a0ea2ef1be24d09e94 | |
import 'dart:math' as math; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; |
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
// Settings app bar demo with auto-scroll and new coordinator API. | |
// This demo must be run in a simulator or on a mobile device | |
import 'dart:math' as math; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/scheduler.dart'; |
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
// ReszingHeaderSliver AppBar Parts example: contacts version with autoscroll | |
// New coordinator API; coordinated slivers report layout info directly. | |
import 'dart:math' as math; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/scheduler.dart'; |