mirror of
https://github.com/flutter/samples.git
synced 2026-06-19 12:48:39 +00:00
[Gallery] Implement Cupertino tab bar demo (#195)
This commit is contained in:
@@ -413,6 +413,551 @@ class CodeSegments {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TextSpan cupertinoNavigationDemo(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/cupertino.dart\u0027'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a\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: '_TabInfo'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '{'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'const'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_TabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'this'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'this'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'final'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'String'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'final'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'IconData'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a'),
|
||||||
|
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: 'CupertinoNavigationDemo'),
|
||||||
|
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: 'final'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '='),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '<'),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_TabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '>['),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_TabInfo'),
|
||||||
|
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: 'cupertinoNavigationHomeTab'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoIcons'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'home'),
|
||||||
|
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.classStyle, text: '_TabInfo'),
|
||||||
|
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: 'cupertinoNavigationChatTab'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoIcons'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'conversation_bubble'),
|
||||||
|
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.classStyle, text: '_TabInfo'),
|
||||||
|
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: 'cupertinoNavigationProfileTab'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoIcons'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'profile_circled'),
|
||||||
|
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 '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'return'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'DefaultTextStyle'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a style'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoTheme'),
|
||||||
|
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: 'textTheme'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'textStyle'),
|
||||||
|
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: 'CupertinoTabScaffold'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a tabBar'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoTabBar'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a items'),
|
||||||
|
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: 'for'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'final'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' tabInfo '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'in'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ')'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'BottomNavigationBarItem'),
|
||||||
|
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.baseStyle, text: 'tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'Icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'icon'),
|
||||||
|
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 tabBuilder'),
|
||||||
|
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: ' index'),
|
||||||
|
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: 'switch'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'index'),
|
||||||
|
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: 'case'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '0'),
|
||||||
|
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: 'CupertinoTabView'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
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: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_CupertinoDemoTab'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '0'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '0'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a defaultTitle'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '0'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
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.keywordStyle, text: 'break'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'case'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '1'),
|
||||||
|
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: 'CupertinoTabView'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
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: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_CupertinoDemoTab'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '1'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '1'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a defaultTitle'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '1'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
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.keywordStyle, text: 'break'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'case'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '2'),
|
||||||
|
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: 'CupertinoTabView'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
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: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_CupertinoDemoTab'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '2'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '2'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a defaultTitle'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' _tabInfo'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '['),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '2'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '].'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
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.keywordStyle, text: 'break'),
|
||||||
|
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.keywordStyle, text: 'return'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'null'),
|
||||||
|
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'),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'class'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_CupertinoDemoTab'),
|
||||||
|
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: 'const'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_CupertinoDemoTab'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '({'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'Key'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' key'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: '@required'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'this'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: '@required'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'this'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '})'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'super'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'key'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' key'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'final'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'String'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'final'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'IconData'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a\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: 'CupertinoPageScaffold'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a navigationBar'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoNavigationBar'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '(),'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a backgroundColor'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoColors'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'systemBackground'),
|
||||||
|
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: '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: 'Icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a icon'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a semanticLabel'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a size'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '100'),
|
||||||
|
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 cupertinoAlertDemo(BuildContext context) {
|
static TextSpan cupertinoAlertDemo(BuildContext context) {
|
||||||
final CodeStyle codeStyle = CodeStyle.of(context);
|
final CodeStyle codeStyle = CodeStyle.of(context);
|
||||||
return TextSpan(children: [
|
return TextSpan(children: [
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:gallery/data/gallery_options.dart';
|
|||||||
import 'package:gallery/data/icons.dart';
|
import 'package:gallery/data/icons.dart';
|
||||||
import 'package:gallery/demos/cupertino/cupertino_alert_demo.dart';
|
import 'package:gallery/demos/cupertino/cupertino_alert_demo.dart';
|
||||||
import 'package:gallery/demos/cupertino/cupertino_button_demo.dart';
|
import 'package:gallery/demos/cupertino/cupertino_button_demo.dart';
|
||||||
|
import 'package:gallery/demos/cupertino/cupertino_tab_bar_demo.dart';
|
||||||
import 'package:gallery/demos/cupertino/cupertino_segmented_control_demo.dart';
|
import 'package:gallery/demos/cupertino/cupertino_segmented_control_demo.dart';
|
||||||
import 'package:gallery/demos/material/bottom_navigation_demo.dart';
|
import 'package:gallery/demos/material/bottom_navigation_demo.dart';
|
||||||
import 'package:gallery/demos/material/bottom_sheet_demo.dart';
|
import 'package:gallery/demos/material/bottom_sheet_demo.dart';
|
||||||
@@ -466,6 +467,22 @@ List<GalleryDemo> cupertinoDemos(BuildContext context) {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
GalleryDemo(
|
||||||
|
title: GalleryLocalizations.of(context).demoCupertinoTabBarTitle,
|
||||||
|
icon: GalleryIcons.bottomNavigation,
|
||||||
|
subtitle: GalleryLocalizations.of(context).demoCupertinoTabBarSubtitle,
|
||||||
|
configurations: [
|
||||||
|
GalleryDemoConfiguration(
|
||||||
|
title: GalleryLocalizations.of(context).demoCupertinoTabBarTitle,
|
||||||
|
description:
|
||||||
|
GalleryLocalizations.of(context).demoCupertinoTabBarDescription,
|
||||||
|
documentationUrl:
|
||||||
|
'https://api.flutter.dev/flutter/cupertino/CupertinoTabBar-class.html',
|
||||||
|
buildRoute: (_) => CupertinoTabBarDemo(),
|
||||||
|
code: CodeSegments.cupertinoNavigationDemo,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
// 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/cupertino.dart';
|
||||||
|
|
||||||
|
import 'package:gallery/l10n/gallery_localizations.dart';
|
||||||
|
|
||||||
|
// BEGIN cupertinoNavigationDemo
|
||||||
|
|
||||||
|
class _TabInfo {
|
||||||
|
const _TabInfo(this.title, this.icon);
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
final IconData icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
class CupertinoTabBarDemo extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final _tabInfo = [
|
||||||
|
_TabInfo(
|
||||||
|
GalleryLocalizations.of(context).cupertinoTabBarHomeTab,
|
||||||
|
CupertinoIcons.home,
|
||||||
|
),
|
||||||
|
_TabInfo(
|
||||||
|
GalleryLocalizations.of(context).cupertinoTabBarChatTab,
|
||||||
|
CupertinoIcons.conversation_bubble,
|
||||||
|
),
|
||||||
|
_TabInfo(
|
||||||
|
GalleryLocalizations.of(context).cupertinoTabBarProfileTab,
|
||||||
|
CupertinoIcons.profile_circled,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
return DefaultTextStyle(
|
||||||
|
style: CupertinoTheme.of(context).textTheme.textStyle,
|
||||||
|
child: CupertinoTabScaffold(
|
||||||
|
tabBar: CupertinoTabBar(
|
||||||
|
items: [
|
||||||
|
for (final tabInfo in _tabInfo)
|
||||||
|
BottomNavigationBarItem(
|
||||||
|
title: Text(tabInfo.title),
|
||||||
|
icon: Icon(tabInfo.icon),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
tabBuilder: (context, index) {
|
||||||
|
return CupertinoTabView(
|
||||||
|
builder: (context) => _CupertinoDemoTab(
|
||||||
|
title: _tabInfo[index].title,
|
||||||
|
icon: _tabInfo[index].icon,
|
||||||
|
),
|
||||||
|
defaultTitle: _tabInfo[index].title,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CupertinoDemoTab extends StatelessWidget {
|
||||||
|
const _CupertinoDemoTab({
|
||||||
|
Key key,
|
||||||
|
@required this.title,
|
||||||
|
@required this.icon,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
final IconData icon;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CupertinoPageScaffold(
|
||||||
|
navigationBar: CupertinoNavigationBar(),
|
||||||
|
backgroundColor: CupertinoColors.systemBackground,
|
||||||
|
child: Center(
|
||||||
|
child: Icon(
|
||||||
|
icon,
|
||||||
|
semanticLabel: title,
|
||||||
|
size: 100,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// END
|
||||||
@@ -1174,6 +1174,27 @@ class GalleryLocalizations {
|
|||||||
desc: r'Button text to show iOS-style alert.');
|
desc: r'Button text to show iOS-style alert.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get cupertinoTabBarChatTab {
|
||||||
|
return Intl.message(r'Chat',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'cupertinoTabBarChatTab',
|
||||||
|
desc: r'Title for the chat tab in the bottom tab bar demo.');
|
||||||
|
}
|
||||||
|
|
||||||
|
String get cupertinoTabBarHomeTab {
|
||||||
|
return Intl.message(r'Home',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'cupertinoTabBarHomeTab',
|
||||||
|
desc: r'Title for the home tab in the bottom tab bar demo.');
|
||||||
|
}
|
||||||
|
|
||||||
|
String get cupertinoTabBarProfileTab {
|
||||||
|
return Intl.message(r'Profile',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'cupertinoTabBarProfileTab',
|
||||||
|
desc: r'Title for the profile tab in the bottom tab bar demo.');
|
||||||
|
}
|
||||||
|
|
||||||
String get demoActionChipDescription {
|
String get demoActionChipDescription {
|
||||||
return Intl.message(
|
return Intl.message(
|
||||||
r'Action chips are a set of options which trigger an action related to primary content. Action chips should appear dynamically and contextually in a UI.',
|
r'Action chips are a set of options which trigger an action related to primary content. Action chips should appear dynamically and contextually in a UI.',
|
||||||
@@ -1539,6 +1560,28 @@ class GalleryLocalizations {
|
|||||||
desc: r'Title for the cupertino segmented control component demo.');
|
desc: r'Title for the cupertino segmented control component demo.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get demoCupertinoTabBarDescription {
|
||||||
|
return Intl.message(
|
||||||
|
r'An iOS-style bottom navigation tab bar. Displays multiple tabs with one tab being active, the first tab by default.',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'demoCupertinoTabBarDescription',
|
||||||
|
desc: r'Description for the cupertino bottom tab bar demo.');
|
||||||
|
}
|
||||||
|
|
||||||
|
String get demoCupertinoTabBarSubtitle {
|
||||||
|
return Intl.message(r'iOS-style bottom tab bar',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'demoCupertinoTabBarSubtitle',
|
||||||
|
desc: r'Subtitle for the cupertino bottom tab bar demo.');
|
||||||
|
}
|
||||||
|
|
||||||
|
String get demoCupertinoTabBarTitle {
|
||||||
|
return Intl.message(r'Tab Bar',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'demoCupertinoTabBarTitle',
|
||||||
|
desc: r'Title for the cupertino bottom tab bar demo.');
|
||||||
|
}
|
||||||
|
|
||||||
String get demoDialogSubtitle {
|
String get demoDialogSubtitle {
|
||||||
return Intl.message(r'Simple, alert, and fullscreen',
|
return Intl.message(r'Simple, alert, and fullscreen',
|
||||||
locale: _localeName,
|
locale: _localeName,
|
||||||
|
|||||||
@@ -645,6 +645,30 @@
|
|||||||
"@demoCupertinoSegmentedControlDescription": {
|
"@demoCupertinoSegmentedControlDescription": {
|
||||||
"description": "Description for the cupertino segmented control component demo."
|
"description": "Description for the cupertino segmented control component demo."
|
||||||
},
|
},
|
||||||
|
"demoCupertinoTabBarTitle": "Tab Bar",
|
||||||
|
"@demoCupertinoTabBarTitle": {
|
||||||
|
"description": "Title for the cupertino bottom tab bar demo."
|
||||||
|
},
|
||||||
|
"demoCupertinoTabBarSubtitle": "iOS-style bottom tab bar",
|
||||||
|
"@demoCupertinoTabBarSubtitle": {
|
||||||
|
"description": "Subtitle for the cupertino bottom tab bar demo."
|
||||||
|
},
|
||||||
|
"demoCupertinoTabBarDescription": "An iOS-style bottom navigation tab bar. Displays multiple tabs with one tab being active, the first tab by default.",
|
||||||
|
"@demoCupertinoTabBarDescription": {
|
||||||
|
"description": "Description for the cupertino bottom tab bar demo."
|
||||||
|
},
|
||||||
|
"cupertinoTabBarHomeTab": "Home",
|
||||||
|
"@cupertinoTabBarHomeTab": {
|
||||||
|
"description": "Title for the home tab in the bottom tab bar demo."
|
||||||
|
},
|
||||||
|
"cupertinoTabBarChatTab": "Chat",
|
||||||
|
"@cupertinoTabBarChatTab": {
|
||||||
|
"description": "Title for the chat tab in the bottom tab bar demo."
|
||||||
|
},
|
||||||
|
"cupertinoTabBarProfileTab": "Profile",
|
||||||
|
"@cupertinoTabBarProfileTab": {
|
||||||
|
"description": "Title for the profile tab in the bottom tab bar demo."
|
||||||
|
},
|
||||||
"demoColorsTitle": "Colors",
|
"demoColorsTitle": "Colors",
|
||||||
"@demoColorsTitle": {
|
"@demoColorsTitle": {
|
||||||
"description": "Title for the colors demo."
|
"description": "Title for the colors demo."
|
||||||
|
|||||||
@@ -609,6 +609,30 @@
|
|||||||
name="demoCupertinoSegmentedControlDescription"
|
name="demoCupertinoSegmentedControlDescription"
|
||||||
description="Description for the cupertino segmented control component demo."
|
description="Description for the cupertino segmented control component demo."
|
||||||
>Used to select between a number of mutually exclusive options. When one option in the segmented control is selected, the other options in the segmented control cease to be selected.</string>
|
>Used to select between a number of mutually exclusive options. When one option in the segmented control is selected, the other options in the segmented control cease to be selected.</string>
|
||||||
|
<string
|
||||||
|
name="demoCupertinoTabBarTitle"
|
||||||
|
description="Title for the cupertino bottom tab bar demo."
|
||||||
|
>Tab Bar</string>
|
||||||
|
<string
|
||||||
|
name="demoCupertinoTabBarSubtitle"
|
||||||
|
description="Subtitle for the cupertino bottom tab bar demo."
|
||||||
|
>iOS-style bottom tab bar</string>
|
||||||
|
<string
|
||||||
|
name="demoCupertinoTabBarDescription"
|
||||||
|
description="Description for the cupertino bottom tab bar demo."
|
||||||
|
>An iOS-style bottom navigation tab bar. Displays multiple tabs with one tab being active, the first tab by default.</string>
|
||||||
|
<string
|
||||||
|
name="cupertinoTabBarHomeTab"
|
||||||
|
description="Title for the home tab in the bottom tab bar demo."
|
||||||
|
>Home</string>
|
||||||
|
<string
|
||||||
|
name="cupertinoTabBarChatTab"
|
||||||
|
description="Title for the chat tab in the bottom tab bar demo."
|
||||||
|
>Chat</string>
|
||||||
|
<string
|
||||||
|
name="cupertinoTabBarProfileTab"
|
||||||
|
description="Title for the profile tab in the bottom tab bar demo."
|
||||||
|
>Profile</string>
|
||||||
<string
|
<string
|
||||||
name="demoColorsTitle"
|
name="demoColorsTitle"
|
||||||
description="Title for the colors demo."
|
description="Title for the colors demo."
|
||||||
|
|||||||
@@ -305,6 +305,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
MessageLookupByLibrary.simpleMessage("With Background"),
|
MessageLookupByLibrary.simpleMessage("With Background"),
|
||||||
"cupertinoShowAlert":
|
"cupertinoShowAlert":
|
||||||
MessageLookupByLibrary.simpleMessage("Show Alert"),
|
MessageLookupByLibrary.simpleMessage("Show Alert"),
|
||||||
|
"cupertinoTabBarChatTab": MessageLookupByLibrary.simpleMessage("Chat"),
|
||||||
|
"cupertinoTabBarHomeTab": MessageLookupByLibrary.simpleMessage("Home"),
|
||||||
|
"cupertinoTabBarProfileTab":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Profile"),
|
||||||
"demoActionChipDescription": MessageLookupByLibrary.simpleMessage(
|
"demoActionChipDescription": MessageLookupByLibrary.simpleMessage(
|
||||||
"Action chips are a set of options which trigger an action related to primary content. Action chips should appear dynamically and contextually in a UI."),
|
"Action chips are a set of options which trigger an action related to primary content. Action chips should appear dynamically and contextually in a UI."),
|
||||||
"demoActionChipTitle":
|
"demoActionChipTitle":
|
||||||
@@ -396,6 +400,12 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
MessageLookupByLibrary.simpleMessage("iOS-style segmented control"),
|
MessageLookupByLibrary.simpleMessage("iOS-style segmented control"),
|
||||||
"demoCupertinoSegmentedControlTitle":
|
"demoCupertinoSegmentedControlTitle":
|
||||||
MessageLookupByLibrary.simpleMessage("Segmented Control"),
|
MessageLookupByLibrary.simpleMessage("Segmented Control"),
|
||||||
|
"demoCupertinoTabBarDescription": MessageLookupByLibrary.simpleMessage(
|
||||||
|
"An iOS-style bottom navigation tab bar. Displays multiple tabs with one tab being active, the first tab by default."),
|
||||||
|
"demoCupertinoTabBarSubtitle":
|
||||||
|
MessageLookupByLibrary.simpleMessage("iOS-style bottom tab bar"),
|
||||||
|
"demoCupertinoTabBarTitle":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Tab Bar"),
|
||||||
"demoDialogSubtitle": MessageLookupByLibrary.simpleMessage(
|
"demoDialogSubtitle": MessageLookupByLibrary.simpleMessage(
|
||||||
"Simple, alert, and fullscreen"),
|
"Simple, alert, and fullscreen"),
|
||||||
"demoDialogTitle": MessageLookupByLibrary.simpleMessage("Dialogs"),
|
"demoDialogTitle": MessageLookupByLibrary.simpleMessage("Dialogs"),
|
||||||
|
|||||||
Reference in New Issue
Block a user