Skip to content

Instantly share code, notes, and snippets.

View alert_dialog_actions_alignment.dart
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
const Home({ Key? key }) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
View overflow_button_bar.dart
import 'package:flutter/material.dart';
/// This class demonstrates how to replace a [ButtonBar[ which specifies a
/// [MainAxisAlignment] with an [OverflowBar].
///
/// By default the ButtonBar separates the buttons by 8 and pads either
/// end of its row with 8. If the alignment is [MainAxisAlignment.spaceAround]
/// the the padding at the ends is reduced to 4, and if the alignment is
/// [MainAxisAlignment.spaceEvenly] the padding at the ends is zero.
class OverflowButtonBar extends StatelessWidget {
View overflow_bar_alignment_demo.dart
import 'package:flutter/material.dart';
class DemoRow extends StatelessWidget {
DemoRow(this.alignment);
final MainAxisAlignment alignment;
@override
Widget build(BuildContext context) {
const List<Widget> items = <Widget>[
View animated_size_sample.dart
/// Flutter code sample for AnimatedSize
// This example makes a [Container] react to being touched, causing the child
// of the [AnimatedSize] widget, here a [FlutterLogo], to animate.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
/// This is the main application widget.
View ten_thousand.html
Hello world Hello world Hello world Hello world Hello world Hello world 0</br>
Hello world Hello world Hello world Hello world Hello world Hello world 1</br>
Hello world Hello world Hello world Hello world Hello world Hello world 2</br>
Hello world Hello world Hello world Hello world Hello world Hello world 3</br>
Hello world Hello world Hello world Hello world Hello world Hello world 4</br>
Hello world Hello world Hello world Hello world Hello world Hello world 5</br>
Hello world Hello world Hello world Hello world Hello world Hello world 6</br>
Hello world Hello world Hello world Hello world Hello world Hello world 7</br>
Hello world Hello world Hello world Hello world Hello world Hello world 8</br>
Hello world Hello world Hello world Hello world Hello world Hello world 9</br>
View color_tween_sample.dart
// Copyright 2017 The Chromium 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 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
class StaggerAnimation extends StatelessWidget {
View disabled_text_button.dart
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextButton.icon(
icon: const Icon(Icons.check_box),
label: const Text('TextButton'),
View new_button_universe.dart
import 'package:flutter/material.dart';
class DialogButtons extends StatelessWidget {
@override
Widget build(BuildContext context) {
void dismissDialog() {
Navigator.of(context).pop();
}
void showDemoDialog(String message, ButtonStyle style1, [ButtonStyle style2]) {
View outline_button_hover_example.dart
import 'package:flutter/scheduler.dart' show timeDilation;
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ButtonStyle style = ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(Colors.white),
elevation: MaterialStateProperty.resolveWith<double>((Set<MaterialState> states) {
return states.contains(MaterialState.hovered) ? 2 : null;
View thb_fail.dart
// 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';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {