Skip to content

Instantly share code, notes, and snippets.

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]) {
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;
// 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) {
// 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';
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();
}
{
"@@locale": "es",
"helloWorld": "Hola Mundo!"
}
name: l10n_new_arb
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
{
"@@locale": "en",
"helloWorld": "Hello World!",
"@helloWorld": {
"description": "The conventional newborn programmer greeting"
}
}
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;
# Options used by the localizations tool
## The directory where locale-specific ".arb" message catalog files can
## be found. The output directory will match the input directory if the
#W# `output-directory` option is not specified.
arb-dir: lib/l10n
## Names the template arb file that will be used to check and validate the
## remaining arb files when generating `output-class` and its supporting
## classes.