mirror of
https://github.com/flutter/samples.git
synced 2026-06-18 04:09:14 +00:00
@@ -30,6 +30,6 @@ l10n: gen-l10n format
|
||||
|
||||
.PHONY: update-code-segments
|
||||
update-code-segments:
|
||||
cd $(ROOT)/codeviewer_cli/ && pub get
|
||||
cd $(ROOT)/codeviewer_cli/ && $(FLUTTER) pub get
|
||||
$(DART) $(ROOT)/codeviewer_cli/bin/main.dart
|
||||
$(FLUTTER) format $(ROOT)/gallery/lib/codeviewer/code_segments.dart
|
||||
|
||||
@@ -9453,6 +9453,252 @@ class CodeSegments {
|
||||
]);
|
||||
}
|
||||
|
||||
static TextSpan snackbarsDemo(BuildContext context) {
|
||||
final CodeStyle codeStyle = CodeStyle.of(context);
|
||||
return TextSpan(children: [
|
||||
TextSpan(
|
||||
style: codeStyle.commentStyle,
|
||||
text: '// Copyright 2019 The Flutter team. All rights reserved.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a'),
|
||||
TextSpan(
|
||||
style: codeStyle.commentStyle,
|
||||
text:
|
||||
'// Use of this source code is governed by a BSD-style license that can be'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a'),
|
||||
TextSpan(
|
||||
style: codeStyle.commentStyle, text: '// found in the LICENSE file.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a\u000a'),
|
||||
TextSpan(style: codeStyle.keywordStyle, text: 'import'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(
|
||||
style: codeStyle.stringStyle,
|
||||
text: '\u0027package:flutter/material.dart\u0027'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a'),
|
||||
TextSpan(style: codeStyle.keywordStyle, text: 'import'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(
|
||||
style: codeStyle.stringStyle,
|
||||
text: '\u0027package:gallery/l10n/gallery_localizations.dart\u0027'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a\u000a'),
|
||||
TextSpan(style: codeStyle.keywordStyle, text: 'class'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'SnackbarsDemo'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.keywordStyle, text: 'extends'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'StatelessWidget'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '{'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.keywordStyle, text: '@override'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Widget'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' build'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'BuildContext'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ')'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '{'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.keywordStyle, text: 'return'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Scaffold'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a appBar'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'AppBar'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a title'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Text'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'GalleryLocalizations'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'of'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ').'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'demoSnackbarsTitle'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a body'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Builder'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(
|
||||
style: codeStyle.commentStyle,
|
||||
text:
|
||||
'// Create an inner BuildContext so that the snackBar onPressed methods'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(
|
||||
style: codeStyle.commentStyle,
|
||||
text: '// can refer to the Scaffold with Scaffold.of().'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a builder'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ')'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '{'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.keywordStyle, text: 'return'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Center'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a child'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'RaisedButton'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a child'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Text'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'GalleryLocalizations'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'of'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ').'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'demoSnackbarsButtonLabel'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a onPressed'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '()'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '{'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Scaffold'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'of'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ').'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'showSnackBar'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'SnackBar'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a content'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Text'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'GalleryLocalizations'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'of'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ').'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'demoSnackbarsText'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a action'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'SnackBarAction'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a label'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'GalleryLocalizations'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'of'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ')'),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: 'demoSnackbarsActionButtonLabel'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle,
|
||||
text: '\u000a onPressed'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '()'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '{'),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Scaffold'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'of'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ').'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'showSnackBar'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'SnackBar'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle,
|
||||
text: '\u000a content'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'Text'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.classStyle, text: 'GalleryLocalizations'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'of'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ').'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: 'demoSnackbarsAction'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||
TextSpan(
|
||||
style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '));'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '},'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '));'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '},'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '},'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '}'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a'),
|
||||
TextSpan(style: codeStyle.punctuationStyle, text: '}'),
|
||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a\u000a'),
|
||||
]);
|
||||
}
|
||||
|
||||
static TextSpan buttonDemoFlat(BuildContext context) {
|
||||
final CodeStyle codeStyle = CodeStyle.of(context);
|
||||
return TextSpan(children: [
|
||||
|
||||
@@ -18,6 +18,7 @@ import 'package:gallery/demos/material/chip_demo.dart';
|
||||
import 'package:gallery/demos/material/dialog_demo.dart';
|
||||
import 'package:gallery/demos/material/list_demo.dart';
|
||||
import 'package:gallery/demos/material/selection_controls_demo.dart';
|
||||
import 'package:gallery/demos/material/snackbar_demo.dart';
|
||||
import 'package:gallery/demos/material/tabs_demo.dart';
|
||||
import 'package:gallery/demos/material/text_field_demo.dart';
|
||||
import 'package:gallery/demos/reference/colors_demo.dart';
|
||||
@@ -320,6 +321,22 @@ List<GalleryDemo> materialDemos(BuildContext context) {
|
||||
),
|
||||
],
|
||||
),
|
||||
GalleryDemo(
|
||||
title: GalleryLocalizations.of(context).demoSnackbarsTitle,
|
||||
icon: GalleryIcons.snackbar,
|
||||
subtitle: GalleryLocalizations.of(context).demoSnackbarsSubtitle,
|
||||
configurations: [
|
||||
GalleryDemoConfiguration(
|
||||
title: GalleryLocalizations.of(context).demoSnackbarsTitle,
|
||||
description:
|
||||
GalleryLocalizations.of(context).demoSnackbarsDescription,
|
||||
documentationUrl:
|
||||
'https://api.flutter.dev/flutter/material/SnackBar-class.html',
|
||||
buildRoute: (context) => SnackbarsDemo(),
|
||||
code: CodeSegments.snackbarsDemo,
|
||||
),
|
||||
],
|
||||
),
|
||||
GalleryDemo(
|
||||
title: GalleryLocalizations.of(context).demoTabsTitle,
|
||||
icon: GalleryIcons.tabs,
|
||||
|
||||
51
gallery/gallery/lib/demos/material/snackbar_demo.dart
Normal file
51
gallery/gallery/lib/demos/material/snackbar_demo.dart
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright 2019 The Flutter team. 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:gallery/l10n/gallery_localizations.dart';
|
||||
|
||||
// BEGIN snackbarsDemo
|
||||
|
||||
class SnackbarsDemo extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(GalleryLocalizations.of(context).demoSnackbarsTitle),
|
||||
),
|
||||
body: Builder(
|
||||
// Create an inner BuildContext so that the snackBar onPressed methods
|
||||
// can refer to the Scaffold with Scaffold.of().
|
||||
builder: (context) {
|
||||
return Center(
|
||||
child: RaisedButton(
|
||||
child: Text(
|
||||
GalleryLocalizations.of(context).demoSnackbarsButtonLabel),
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
GalleryLocalizations.of(context).demoSnackbarsText,
|
||||
),
|
||||
action: SnackBarAction(
|
||||
label: GalleryLocalizations.of(context)
|
||||
.demoSnackbarsActionButtonLabel,
|
||||
onPressed: () {
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
GalleryLocalizations.of(context).demoSnackbarsAction,
|
||||
),
|
||||
));
|
||||
},
|
||||
),
|
||||
));
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// END
|
||||
@@ -83,6 +83,10 @@ class GalleryLocalizations {
|
||||
/// Returns a list of localizations delegates containing this delegate along with
|
||||
/// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
|
||||
/// and GlobalWidgetsLocalizations.delegate.
|
||||
///
|
||||
/// Additional delegates can be added by appending to this list in
|
||||
/// MaterialApp. This list does not have to be used at all if a custom list
|
||||
/// of delegates is preferred or required.
|
||||
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
|
||||
<LocalizationsDelegate<dynamic>>[
|
||||
delegate,
|
||||
@@ -1820,6 +1824,56 @@ class GalleryLocalizations {
|
||||
desc: r'Title for the simple dialog component demo.');
|
||||
}
|
||||
|
||||
String get demoSnackbarsAction {
|
||||
return Intl.message(r'You pressed the snackbar action.',
|
||||
locale: _localeName,
|
||||
name: 'demoSnackbarsAction',
|
||||
desc: r'Text that appears when you press on a snackbars’ action.');
|
||||
}
|
||||
|
||||
String get demoSnackbarsActionButtonLabel {
|
||||
return Intl.message(r'ACTION',
|
||||
locale: _localeName,
|
||||
name: 'demoSnackbarsActionButtonLabel',
|
||||
desc: r'Label for action button text on the snackbar.');
|
||||
}
|
||||
|
||||
String get demoSnackbarsButtonLabel {
|
||||
return Intl.message(r'SHOW A SNACKBAR',
|
||||
locale: _localeName,
|
||||
name: 'demoSnackbarsButtonLabel',
|
||||
desc: r'Label for button to show a snackbar.');
|
||||
}
|
||||
|
||||
String get demoSnackbarsDescription {
|
||||
return Intl.message(
|
||||
r'Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn’t interrupt the user experience, and they don’t require user input to disappear.',
|
||||
locale: _localeName,
|
||||
name: 'demoSnackbarsDescription',
|
||||
desc: r'Description for snackbars demo.');
|
||||
}
|
||||
|
||||
String get demoSnackbarsSubtitle {
|
||||
return Intl.message(r'Snackbars show messages at the bottom of the screen',
|
||||
locale: _localeName,
|
||||
name: 'demoSnackbarsSubtitle',
|
||||
desc: r'Subtitle for snackbars demo.');
|
||||
}
|
||||
|
||||
String get demoSnackbarsText {
|
||||
return Intl.message(r'This is a snackbar.',
|
||||
locale: _localeName,
|
||||
name: 'demoSnackbarsText',
|
||||
desc: r'Text to show on a snackbar.');
|
||||
}
|
||||
|
||||
String get demoSnackbarsTitle {
|
||||
return Intl.message(r'Snackbars',
|
||||
locale: _localeName,
|
||||
name: 'demoSnackbarsTitle',
|
||||
desc: r'Title for snackbars demo.');
|
||||
}
|
||||
|
||||
String get demoTabsDescription {
|
||||
return Intl.message(
|
||||
r'Tabs organize content across different screens, data sets, and other interactions.',
|
||||
|
||||
@@ -754,6 +754,34 @@
|
||||
"@demoTabsDescription": {
|
||||
"description": "Description for tabs demo."
|
||||
},
|
||||
"demoSnackbarsTitle": "Snackbars",
|
||||
"@demoSnackbarsTitle": {
|
||||
"description": "Title for snackbars demo."
|
||||
},
|
||||
"demoSnackbarsSubtitle": "Snackbars show messages at the bottom of the screen",
|
||||
"@demoSnackbarsSubtitle": {
|
||||
"description": "Subtitle for snackbars demo."
|
||||
},
|
||||
"demoSnackbarsDescription": "Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn’t interrupt the user experience, and they don’t require user input to disappear.",
|
||||
"@demoSnackbarsDescription": {
|
||||
"description": "Description for snackbars demo."
|
||||
},
|
||||
"demoSnackbarsButtonLabel": "SHOW A SNACKBAR",
|
||||
"@demoSnackbarsButtonLabel": {
|
||||
"description": "Label for button to show a snackbar."
|
||||
},
|
||||
"demoSnackbarsText": "This is a snackbar.",
|
||||
"@demoSnackbarsText": {
|
||||
"description": "Text to show on a snackbar."
|
||||
},
|
||||
"demoSnackbarsActionButtonLabel": "ACTION",
|
||||
"@demoSnackbarsActionButtonLabel": {
|
||||
"description": "Label for action button text on the snackbar."
|
||||
},
|
||||
"demoSnackbarsAction": "You pressed the snackbar action.",
|
||||
"@demoSnackbarsAction": {
|
||||
"description": "Text that appears when you press on a snackbars’ action."
|
||||
},
|
||||
"demoSelectionControlsTitle": "Selection controls",
|
||||
"@demoSelectionControlsTitle": {
|
||||
"description": "Title for selection controls demo."
|
||||
|
||||
@@ -713,6 +713,34 @@
|
||||
name="demoTabsDescription"
|
||||
description="Description for tabs demo."
|
||||
>Tabs organize content across different screens, data sets, and other interactions.</string>
|
||||
<string
|
||||
name="demoSnackbarsTitle"
|
||||
description="Title for snackbars demo."
|
||||
>Snackbars</string>
|
||||
<string
|
||||
name="demoSnackbarsSubtitle"
|
||||
description="Subtitle for snackbars demo."
|
||||
>Snackbars show messages at the bottom of the screen</string>
|
||||
<string
|
||||
name="demoSnackbarsDescription"
|
||||
description="Description for snackbars demo."
|
||||
>Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn’t interrupt the user experience, and they don’t require user input to disappear.</string>
|
||||
<string
|
||||
name="demoSnackbarsButtonLabel"
|
||||
description="Label for button to show a snackbar."
|
||||
>SHOW A SNACKBAR</string>
|
||||
<string
|
||||
name="demoSnackbarsText"
|
||||
description="Text to show on a snackbar."
|
||||
>This is a snackbar.</string>
|
||||
<string
|
||||
name="demoSnackbarsActionButtonLabel"
|
||||
description="Label for action button text on the snackbar."
|
||||
>ACTION</string>
|
||||
<string
|
||||
name="demoSnackbarsAction"
|
||||
description="Text that appears when you press on a snackbars’ action."
|
||||
>You pressed the snackbar action.</string>
|
||||
<string
|
||||
name="demoSelectionControlsTitle"
|
||||
description="Title for selection controls demo."
|
||||
|
||||
@@ -470,6 +470,19 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"demoSimpleDialogDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"A simple dialog offers the user a choice between several options. A simple dialog has an optional title that is displayed above the choices."),
|
||||
"demoSimpleDialogTitle": MessageLookupByLibrary.simpleMessage("Simple"),
|
||||
"demoSnackbarsAction": MessageLookupByLibrary.simpleMessage(
|
||||
"You pressed the snackbar action."),
|
||||
"demoSnackbarsActionButtonLabel":
|
||||
MessageLookupByLibrary.simpleMessage("ACTION"),
|
||||
"demoSnackbarsButtonLabel":
|
||||
MessageLookupByLibrary.simpleMessage("SHOW A SNACKBAR"),
|
||||
"demoSnackbarsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn’t interrupt the user experience, and they don’t require user input to disappear."),
|
||||
"demoSnackbarsSubtitle": MessageLookupByLibrary.simpleMessage(
|
||||
"Snackbars show messages at the bottom of the screen"),
|
||||
"demoSnackbarsText":
|
||||
MessageLookupByLibrary.simpleMessage("This is a snackbar."),
|
||||
"demoSnackbarsTitle": MessageLookupByLibrary.simpleMessage("Snackbars"),
|
||||
"demoTabsDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Tabs organize content across different screens, data sets, and other interactions."),
|
||||
"demoTabsSubtitle": MessageLookupByLibrary.simpleMessage(
|
||||
|
||||
@@ -22,6 +22,9 @@ class MaterialDemoThemeData {
|
||||
indicatorColor: _colorScheme.onPrimary,
|
||||
primaryColor: _colorScheme.primary,
|
||||
scaffoldBackgroundColor: _colorScheme.background,
|
||||
snackBarTheme: SnackBarThemeData(
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
typography: Typography(
|
||||
platform: defaultTargetPlatform,
|
||||
englishLike: Typography.englishLike2018,
|
||||
|
||||
Reference in New Issue
Block a user