Skip to content

Instantly share code, notes, and snippets.

// Seventh AppBar Parts example: ReszingHeaderSliver with ContactBar.prototype
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';
class _ContactBarButton extends StatelessWidget {
// Fifth AppBarParts example - auto scroll
// 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';
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';
// The pinned item at the top of the list. This is an implicitly
// animated widget: when the opacity changes the title and divider
// fade in or out.
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';
// The pinned item at the top of the list. This is an implicitly
// animated widget: when the opacity changes the title and divider
// fade in or out.
import 'package:flutter/material.dart';
// The pinned item at the top of the list. This is an implicitly
// animated widget: when the opacity changes the title and divider
// fade in or out.
class TitleBar extends StatelessWidget {
const TitleBar({ super.key, required this.opacity, required this.child });
final double opacity;
final Widget child;
import 'package:flutter/material.dart';
// The pinned item at the top of the list. This is an implicitly
// animated widget: when the opacity changes the title and divider
// fade in or out.
class TitleBar extends StatelessWidget {
const TitleBar({ super.key, required this.opacity, required this.child });
final double opacity;
final Widget child;
// First AppBar Parts example: iOS Settings app layout
// https://gist.github.com/HansMuller/6d272ec6712a045ab2121bc8fb324797
import 'package:flutter/material.dart';
// The pinned item at the top of the list. This is an implicitly
// animated widget: when the opacity changes the title and divider
// fade in or out.
class TitleBar extends StatelessWidget {
import 'package:flutter/material.dart';
void main() {
runApp(const ThemeDataExampleApp());
}
// This app's theme specifies an overall ColorScheme as well as overrides
// for the default configuration of FloatingActionButtons. To customize
// the appearance of other components, add additional component specific
// themes, rather than tweaking the color scheme.
import 'package:flutter/material.dart';
/// Flutter code sample for [ReorderableListView].
void main() {
runApp(const ReorderableApp());
}
class ReorderableApp extends StatelessWidget {
const ReorderableApp({ super.key });
// https://gist.github.com/HansMuller/7e0a38380d059058b71d6e7b03b9cd6d
/*
PinnedSliver is a distillation of SliverPersistentHeader
that just supports the pinned:true configuration and whose size is
the size of the child.
The child widget is built with a callback rather than a sliver
delegate subclass. The callback is passed the parent BuildContext