Skip to content

Instantly share code, notes, and snippets.

Avatar

Hans Muller HansMuller

View GitHub Profile
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) {
View overflow_bar_demo.dart
// A demo of the OverflowBar widget. Resize DartPad's browser window to see the overflow layout.
//
// Uses the old button classes because DartPad.
// @dart = 2.8
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
View scroll_fade_demo.dart
import 'package:flutter/material.dart';
class DemoShader extends StatefulWidget {
const DemoShader({ Key key, this.child }) : super(key: key);
final Widget child;
@override
_DemoShaderState createState() => _DemoShaderState();
}
View app_es.arb
{
"@@locale": "es",
"helloWorld": "Hola Mundo!"
}
View sample_l10n_pubspec.yaml
name: l10n_new_arb
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
View app_en.arb
{
"@@locale": "en",
"helloWorld": "Hello World!",
"@helloWorld": {
"description": "The conventional newborn programmer greeting"
}
}
View l10n_sample.dart
import 'package:flutter/material.dart';
import 'l10n/app_localizations.dart'; // L10N
class AppLocale extends StatelessWidget {
const AppLocale({ Key key, this.locale, this.child }) : super(key: key);
final Locale locale;
final Widget child;
You can’t perform that action at this time.