Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.title, this.icon, this.color);
final String title;
final IconData icon;
final MaterialColor color;
}
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;
}
// PinnedHeaderSliver demo
// https://github.com/flutter/flutter/pull/143196
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
// Copyright 2014 The Flutter 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 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
/// Flutter code sample for [ScrollEndNotification].
void main() {
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
void main() {
runApp(const ThumbDragApp());
}
class ThumbDragApp extends StatelessWidget {
const ThumbDragApp({ super.key });
// Allow arbitrary foreground and background elements for ButtonStyle
import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(home: Home()));
}
class Home extends StatefulWidget {
const Home({ super.key });
// Allow arbitrary foreground and background elements for ButtonStyle
import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(home: Home()));
}
class Home extends StatefulWidget {
const Home({ super.key });
// See "Add Decoration to ButtonStyleButton's styling"
// https://github.com/flutter/flutter/issues/130335#issuecomment-1782727064
import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(home: Home()));
}
class Home extends StatefulWidget {
// See Allow arbitrary foreground and background elements for ButtonStyle
// https://github.com/flutter/flutter/issues/139456
import 'package:flutter/material.dart';
void main() {
runApp(const MaterialApp(home: Home()));
}
class Home extends StatefulWidget {
import 'package:flutter/material.dart';
// Occupies the same width as the widest single digit used by AnimatedDigit.
class _PlaceholderDigit extends StatelessWidget {
const _PlaceholderDigit();
@override
Widget build(BuildContext context) {
final TextStyle textStyle = Theme.of(context).textTheme.displayLarge!.copyWith(
fontWeight: FontWeight.w500,