mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
[Gallery] Implement cupertino navbar demo (#214)
This commit is contained in:
@@ -9,6 +9,426 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:gallery/codeviewer/code_style.dart';
|
import 'package:gallery/codeviewer/code_style.dart';
|
||||||
|
|
||||||
class CodeSegments {
|
class CodeSegments {
|
||||||
|
static TextSpan cupertinoNavigationBarDemo(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'),
|
||||||
|
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: 'CupertinoNavigationBarDemo'),
|
||||||
|
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: 'Navigator'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'onGenerateRoute'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'settings'),
|
||||||
|
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: '_NoAnimationCupertinoPageRoute'),
|
||||||
|
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: '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: 'demoCupertinoNavigationBarTitle'),
|
||||||
|
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: 'CupertinoPageScaffold'),
|
||||||
|
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: 'CustomScrollView'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a slivers'),
|
||||||
|
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: 'CupertinoSliverNavigationBar'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a automaticallyImplyLeading'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'false'),
|
||||||
|
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: 'SliverPadding'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a padding'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'MediaQuery'),
|
||||||
|
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: 'removePadding'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'removeTop'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'true'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ')'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'padding'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a sliver'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'SliverList'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a delegate'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'SliverChildBuilderDelegate'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
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: 'final'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' title '),
|
||||||
|
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: 'starterAppDrawerItem'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'index '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '+'),
|
||||||
|
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: 'ListTile'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a onTap'),
|
||||||
|
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: 'Navigator'),
|
||||||
|
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: 'push'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoPageRoute'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '<'),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'void'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '>('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' title'),
|
||||||
|
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: '_SecondPage'),
|
||||||
|
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 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: '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.punctuationStyle, text: '},'),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a childCount'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.numberStyle, text: '20'),
|
||||||
|
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'),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'class'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: '_SecondPage'),
|
||||||
|
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: '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.keywordStyle, text: 'const'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoNavigationBar'),
|
||||||
|
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: 'Container'),
|
||||||
|
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.commentStyle,
|
||||||
|
text: '/// A CupertinoPageRoute without any transition animations.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a'),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'class'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.classStyle, text: '_NoAnimationCupertinoPageRoute'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '<'),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'T'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '>'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'extends'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoPageRoute'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '<'),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'T'),
|
||||||
|
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: '_NoAnimationCupertinoPageRoute'),
|
||||||
|
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.classStyle, text: 'WidgetBuilder'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' builder'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
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.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: 'builder'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' builder'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' title'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' title'),
|
||||||
|
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: ' buildTransitions'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'BuildContext'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' context'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'Animation'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '<'),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'double'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '>'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' animation'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'Animation'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '<'),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'double'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '>'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' secondaryAnimation'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'Widget'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' child'),
|
||||||
|
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: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'return'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' child'),
|
||||||
|
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 cupertinoSegmentedControlDemo(BuildContext context) {
|
static TextSpan cupertinoSegmentedControlDemo(BuildContext context) {
|
||||||
final CodeStyle codeStyle = CodeStyle.of(context);
|
final CodeStyle codeStyle = CodeStyle.of(context);
|
||||||
return TextSpan(children: [
|
return TextSpan(children: [
|
||||||
@@ -881,6 +1301,13 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
TextSpan(style: codeStyle.classStyle, text: 'CupertinoNavigationBar'),
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoNavigationBar'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a automaticallyImplyLeading'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'false'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a middle'),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a middle'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
@@ -1024,6 +1451,13 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
TextSpan(style: codeStyle.classStyle, text: 'CupertinoNavigationBar'),
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoNavigationBar'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a automaticallyImplyLeading'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'false'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a middle'),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a middle'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
@@ -1448,6 +1882,13 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
TextSpan(style: codeStyle.classStyle, text: 'CupertinoNavigationBar'),
|
TextSpan(style: codeStyle.classStyle, text: 'CupertinoNavigationBar'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a automaticallyImplyLeading'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'false'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a middle'),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a middle'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
@@ -10395,6 +10836,13 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
TextSpan(style: codeStyle.classStyle, text: 'AppBar'),
|
TextSpan(style: codeStyle.classStyle, text: 'AppBar'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a automaticallyImplyLeading'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'false'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a title'),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a title'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
@@ -14477,6 +14925,13 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
TextSpan(style: codeStyle.classStyle, text: 'AppBar'),
|
TextSpan(style: codeStyle.classStyle, text: 'AppBar'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a automaticallyImplyLeading'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'false'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a title'),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a title'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:gallery/data/icons.dart';
|
|||||||
import 'package:gallery/demos/cupertino/cupertino_activity_indicator_demo.dart';
|
import 'package:gallery/demos/cupertino/cupertino_activity_indicator_demo.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_navigation_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/cupertino/cupertino_slider_demo.dart';
|
import 'package:gallery/demos/cupertino/cupertino_slider_demo.dart';
|
||||||
import 'package:gallery/demos/cupertino/cupertino_switch_demo.dart';
|
import 'package:gallery/demos/cupertino/cupertino_switch_demo.dart';
|
||||||
@@ -480,22 +481,6 @@ List<GalleryDemo> cupertinoDemos(BuildContext context) {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
GalleryDemo(
|
|
||||||
title: GalleryLocalizations.of(context).demoCupertinoButtonsTitle,
|
|
||||||
icon: GalleryIcons.genericButtons,
|
|
||||||
subtitle: GalleryLocalizations.of(context).demoCupertinoButtonsSubtitle,
|
|
||||||
configurations: [
|
|
||||||
GalleryDemoConfiguration(
|
|
||||||
title: GalleryLocalizations.of(context).demoCupertinoButtonsTitle,
|
|
||||||
description:
|
|
||||||
GalleryLocalizations.of(context).demoCupertinoButtonsDescription,
|
|
||||||
documentationUrl:
|
|
||||||
'https://api.flutter.dev/flutter/cupertino/CupertinoButton-class.html',
|
|
||||||
buildRoute: (_) => CupertinoButtonDemo(),
|
|
||||||
code: CodeSegments.cupertinoButtonDemo,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
GalleryDemo(
|
GalleryDemo(
|
||||||
title: GalleryLocalizations.of(context).demoCupertinoAlertsTitle,
|
title: GalleryLocalizations.of(context).demoCupertinoAlertsTitle,
|
||||||
icon: GalleryIcons.dialogs,
|
icon: GalleryIcons.dialogs,
|
||||||
@@ -554,6 +539,40 @@ List<GalleryDemo> cupertinoDemos(BuildContext context) {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
GalleryDemo(
|
||||||
|
title: GalleryLocalizations.of(context).demoCupertinoButtonsTitle,
|
||||||
|
icon: GalleryIcons.genericButtons,
|
||||||
|
subtitle: GalleryLocalizations.of(context).demoCupertinoButtonsSubtitle,
|
||||||
|
configurations: [
|
||||||
|
GalleryDemoConfiguration(
|
||||||
|
title: GalleryLocalizations.of(context).demoCupertinoButtonsTitle,
|
||||||
|
description:
|
||||||
|
GalleryLocalizations.of(context).demoCupertinoButtonsDescription,
|
||||||
|
documentationUrl:
|
||||||
|
'https://api.flutter.dev/flutter/cupertino/CupertinoButton-class.html',
|
||||||
|
buildRoute: (_) => CupertinoButtonDemo(),
|
||||||
|
code: CodeSegments.cupertinoButtonDemo,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
GalleryDemo(
|
||||||
|
title: GalleryLocalizations.of(context).demoCupertinoNavigationBarTitle,
|
||||||
|
icon: GalleryIcons.bottomSheetPersistent,
|
||||||
|
subtitle:
|
||||||
|
GalleryLocalizations.of(context).demoCupertinoNavigationBarSubtitle,
|
||||||
|
configurations: [
|
||||||
|
GalleryDemoConfiguration(
|
||||||
|
title:
|
||||||
|
GalleryLocalizations.of(context).demoCupertinoNavigationBarTitle,
|
||||||
|
description: GalleryLocalizations.of(context)
|
||||||
|
.demoCupertinoNavigationBarDescription,
|
||||||
|
documentationUrl:
|
||||||
|
'https://api.flutter.dev/flutter/cupertino/CupertinoNavigationBar-class.html',
|
||||||
|
buildRoute: (_) => CupertinoNavigationBarDemo(),
|
||||||
|
code: CodeSegments.cupertinoNavigationBarDemo,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
GalleryDemo(
|
GalleryDemo(
|
||||||
title:
|
title:
|
||||||
GalleryLocalizations.of(context).demoCupertinoSegmentedControlTitle,
|
GalleryLocalizations.of(context).demoCupertinoSegmentedControlTitle,
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
// 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:flutter/material.dart';
|
||||||
|
import 'package:gallery/l10n/gallery_localizations.dart';
|
||||||
|
|
||||||
|
// BEGIN cupertinoNavigationBarDemo
|
||||||
|
|
||||||
|
class CupertinoNavigationBarDemo extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Navigator(onGenerateRoute: (settings) {
|
||||||
|
return _NoAnimationCupertinoPageRoute<void>(
|
||||||
|
title: GalleryLocalizations.of(context).demoCupertinoNavigationBarTitle,
|
||||||
|
builder: (context) => CupertinoPageScaffold(
|
||||||
|
child: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
CupertinoSliverNavigationBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
),
|
||||||
|
SliverPadding(
|
||||||
|
padding: MediaQuery.of(context)
|
||||||
|
.removePadding(removeTop: true)
|
||||||
|
.padding,
|
||||||
|
sliver: SliverList(
|
||||||
|
delegate: SliverChildBuilderDelegate(
|
||||||
|
(context, index) {
|
||||||
|
final title = GalleryLocalizations.of(context)
|
||||||
|
.starterAppDrawerItem(index + 1);
|
||||||
|
return ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).push(CupertinoPageRoute<void>(
|
||||||
|
title: title,
|
||||||
|
builder: (context) => _SecondPage(),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
title: Text(title),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
childCount: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SecondPage extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CupertinoPageScaffold(
|
||||||
|
navigationBar: const CupertinoNavigationBar(),
|
||||||
|
child: Container(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A CupertinoPageRoute without any transition animations.
|
||||||
|
class _NoAnimationCupertinoPageRoute<T> extends CupertinoPageRoute<T> {
|
||||||
|
_NoAnimationCupertinoPageRoute({
|
||||||
|
@required WidgetBuilder builder,
|
||||||
|
String title,
|
||||||
|
}) : super(builder: builder, title: title);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget buildTransitions(
|
||||||
|
BuildContext context,
|
||||||
|
Animation<double> animation,
|
||||||
|
Animation<double> secondaryAnimation,
|
||||||
|
Widget child,
|
||||||
|
) {
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// END
|
||||||
@@ -1645,6 +1645,28 @@ class GalleryLocalizations {
|
|||||||
desc: r'Title for the cupertino buttons component demo.');
|
desc: r'Title for the cupertino buttons component demo.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get demoCupertinoNavigationBarDescription {
|
||||||
|
return Intl.message(
|
||||||
|
r'An iOS-styled navigation bar. The navigation bar is a toolbar that minimally consists of a page title, in the middle of the toolbar.',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'demoCupertinoNavigationBarDescription',
|
||||||
|
desc: r'Description for the cupertino navigation bar component demo.');
|
||||||
|
}
|
||||||
|
|
||||||
|
String get demoCupertinoNavigationBarSubtitle {
|
||||||
|
return Intl.message(r'iOS-style navigation bar',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'demoCupertinoNavigationBarSubtitle',
|
||||||
|
desc: r'Subtitle for the cupertino navigation bar component demo.');
|
||||||
|
}
|
||||||
|
|
||||||
|
String get demoCupertinoNavigationBarTitle {
|
||||||
|
return Intl.message(r'Navigation Bar',
|
||||||
|
locale: _localeName,
|
||||||
|
name: 'demoCupertinoNavigationBarTitle',
|
||||||
|
desc: r'Title for the cupertino navigation bar component demo.');
|
||||||
|
}
|
||||||
|
|
||||||
String get demoCupertinoSegmentedControlDescription {
|
String get demoCupertinoSegmentedControlDescription {
|
||||||
return Intl.message(
|
return Intl.message(
|
||||||
r'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.',
|
r'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.',
|
||||||
|
|||||||
@@ -733,6 +733,18 @@
|
|||||||
"@demoCupertinoActionSheetDescription": {
|
"@demoCupertinoActionSheetDescription": {
|
||||||
"description": "Description for the cupertino action sheet component demo."
|
"description": "Description for the cupertino action sheet component demo."
|
||||||
},
|
},
|
||||||
|
"demoCupertinoNavigationBarTitle": "Navigation Bar",
|
||||||
|
"@demoCupertinoNavigationBarTitle": {
|
||||||
|
"description": "Title for the cupertino navigation bar component demo."
|
||||||
|
},
|
||||||
|
"demoCupertinoNavigationBarSubtitle": "iOS-style navigation bar",
|
||||||
|
"@demoCupertinoNavigationBarSubtitle": {
|
||||||
|
"description": "Subtitle for the cupertino navigation bar component demo."
|
||||||
|
},
|
||||||
|
"demoCupertinoNavigationBarDescription": "An iOS-styled navigation bar. The navigation bar is a toolbar that minimally consists of a page title, in the middle of the toolbar.",
|
||||||
|
"@demoCupertinoNavigationBarDescription": {
|
||||||
|
"description": "Description for the cupertino navigation bar component demo."
|
||||||
|
},
|
||||||
"demoCupertinoSegmentedControlTitle": "Segmented Control",
|
"demoCupertinoSegmentedControlTitle": "Segmented Control",
|
||||||
"@demoCupertinoSegmentedControlTitle": {
|
"@demoCupertinoSegmentedControlTitle": {
|
||||||
"description": "Title for the cupertino segmented control component demo."
|
"description": "Title for the cupertino segmented control component demo."
|
||||||
|
|||||||
@@ -697,6 +697,18 @@
|
|||||||
name="demoCupertinoActionSheetDescription"
|
name="demoCupertinoActionSheetDescription"
|
||||||
description="Description for the cupertino action sheet component demo."
|
description="Description for the cupertino action sheet component demo."
|
||||||
>An action sheet is a specific style of alert that presents the user with a set of two or more choices related to the current context. An action sheet can have a title, an additional message, and a list of actions.</string>
|
>An action sheet is a specific style of alert that presents the user with a set of two or more choices related to the current context. An action sheet can have a title, an additional message, and a list of actions.</string>
|
||||||
|
<string
|
||||||
|
name="demoCupertinoNavigationBarTitle"
|
||||||
|
description="Title for the cupertino navigation bar component demo."
|
||||||
|
>Navigation Bar</string>
|
||||||
|
<string
|
||||||
|
name="demoCupertinoNavigationBarSubtitle"
|
||||||
|
description="Subtitle for the cupertino navigation bar component demo."
|
||||||
|
>iOS-style navigation bar</string>
|
||||||
|
<string
|
||||||
|
name="demoCupertinoNavigationBarDescription"
|
||||||
|
description="Description for the cupertino navigation bar component demo."
|
||||||
|
>An iOS-styled navigation bar. The navigation bar is a toolbar that minimally consists of a page title, in the middle of the toolbar.</string>
|
||||||
<string
|
<string
|
||||||
name="demoCupertinoSegmentedControlTitle"
|
name="demoCupertinoSegmentedControlTitle"
|
||||||
description="Title for the cupertino segmented control component demo."
|
description="Title for the cupertino segmented control component demo."
|
||||||
|
|||||||
@@ -427,6 +427,13 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
MessageLookupByLibrary.simpleMessage("iOS-style buttons"),
|
MessageLookupByLibrary.simpleMessage("iOS-style buttons"),
|
||||||
"demoCupertinoButtonsTitle":
|
"demoCupertinoButtonsTitle":
|
||||||
MessageLookupByLibrary.simpleMessage("Buttons"),
|
MessageLookupByLibrary.simpleMessage("Buttons"),
|
||||||
|
"demoCupertinoNavigationBarDescription":
|
||||||
|
MessageLookupByLibrary.simpleMessage(
|
||||||
|
"An iOS-styled navigation bar. The navigation bar is a toolbar that minimally consists of a page title, in the middle of the toolbar."),
|
||||||
|
"demoCupertinoNavigationBarSubtitle":
|
||||||
|
MessageLookupByLibrary.simpleMessage("iOS-style navigation bar"),
|
||||||
|
"demoCupertinoNavigationBarTitle":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Navigation Bar"),
|
||||||
"demoCupertinoSegmentedControlDescription":
|
"demoCupertinoSegmentedControlDescription":
|
||||||
MessageLookupByLibrary.simpleMessage(
|
MessageLookupByLibrary.simpleMessage(
|
||||||
"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."),
|
"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."),
|
||||||
|
|||||||
Reference in New Issue
Block a user