Skip to content

Instantly share code, notes, and snippets.

// 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.
// For more information see "Updating the Material Buttons and their Themes #54776"
// https://github.com/flutter/flutter/issues/54776
import 'dart:math' as math;
import 'dart:ui' show lerpDouble;
// 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.
// For more information see "Updating the Material Buttons and their Themes #54776"
// https://github.com/flutter/flutter/issues/54776
import 'dart:math' as math;
import 'dart:ui' show lerpDouble;
Widget TextButtonTheme.fromColor({ Color color, Widget child }) {
return TextButtonTheme(
data: TextButtonThemeData(
style: TextButton.styleFrom(primary: color),
),
child: child,
);
}
// 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.
// For more information see "Updating the Material Buttons and their Themes #54776"
// https://github.com/flutter/flutter/issues/54776
import 'dart:math' as math;
import 'dart:ui' show lerpDouble;
/*
This examples defines a widget called "Destination" that displays two
widgets in a column: an "icon" and a "label". The Destination widget's
height is the height of the icon + the height of the label multiplied
by the Destination's "progress" parameter, a value between 0 and 1.
When progress is zero, the Destination's height is the same as the
icon's height, and when progress is 1.0 the Destination's height is the
sum of the icon and label's height
Tapping on the demo animates the Destination's progress value. The
/*
This example defines a widget called "Destination" that displays two
widgets in a column: an "icon" and a "label". The Destination widget's
height is the height of the icon + the height of the label multiplied
by the Destination's "progress" parameter, a value between 0 and 1.
When progress is zero, the Destination's height is the same as the
icon's height, and when progress is 1.0 the Destination's height is the
sum of the icon and label's height
Tapping on the demo animates the Destination's progress value. The
import 'dart:math' as math;
import 'package:flutter/material.dart';
class Indicator extends StatefulWidget {
Indicator({ Key key, this.link, this.offset }) : super(key: key);
final LayerLink link;
final Offset offset;
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
class DataTreeRule extends StatelessWidget {
const DataTreeRule({ Key key }) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
height: 2,
import 'package:flutter/material.dart';
class ScaleFactorAppBar extends StatelessWidget {
const ScaleFactorAppBar({
this.textScaleFactor = 1,
this.textDirection = TextDirection.ltr,
this.centerTitle = false,
});
final double textScaleFactor;
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: MyHomePage()));
}
final TextEditingController controller = TextEditingController();
// It's possible to see the problem without using an EditableText subclass,
// by just adding a print statement to _TextInputClientHandler in