mirror of
https://github.com/flutter/samples.git
synced 2025-11-09 06:18:49 +00:00
[Gallery] Remove MaterialApp for demo screen for simplification (#197)
* Remove MaterialApp for demo screen for simplification
This commit is contained in:
@@ -198,6 +198,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: ' '),
|
||||||
@@ -2682,7 +2689,14 @@ 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: 'middle'),
|
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.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
TextSpan(style: codeStyle.classStyle, text: 'Text'),
|
TextSpan(style: codeStyle.classStyle, text: 'Text'),
|
||||||
@@ -2690,7 +2704,9 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: '_title'),
|
TextSpan(style: codeStyle.baseStyle, text: '_title'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '))),'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ')),'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a child'),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a child'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
@@ -3379,6 +3395,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: '\u000a '),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
@@ -4159,6 +4182,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: ' '),
|
||||||
@@ -5813,6 +5843,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: ' '),
|
||||||
@@ -6326,6 +6363,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: ' '),
|
||||||
@@ -9051,6 +9095,47 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.keywordStyle, text: 'return'),
|
TextSpan(style: codeStyle.keywordStyle, text: 'return'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'Navigator'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.commentStyle,
|
||||||
|
text:
|
||||||
|
'// Adding [ValueKey] to make sure that the widget gets rebuilt when'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.commentStyle, text: '// changing type.'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a key'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'ValueKey'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: 'type'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a 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: '_NoAnimationMaterialPageRoute'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: '<'),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'void'),
|
||||||
|
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: 'Scaffold'),
|
TextSpan(style: codeStyle.classStyle, text: 'Scaffold'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a key'),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a key'),
|
||||||
@@ -9062,6 +9147,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: ' '),
|
||||||
@@ -9096,7 +9188,8 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.punctuationStyle, text: ').'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ').'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: 'dialogShow'),
|
TextSpan(style: codeStyle.baseStyle, text: 'dialogShow'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a onPressed'),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a onPressed'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '()'),
|
TextSpan(style: codeStyle.punctuationStyle, text: '()'),
|
||||||
@@ -9123,7 +9216,8 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.keywordStyle, text: 'break'),
|
TextSpan(style: codeStyle.keywordStyle, text: 'break'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
@@ -9139,7 +9233,8 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.keywordStyle, text: 'break'),
|
TextSpan(style: codeStyle.keywordStyle, text: 'break'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
@@ -9155,7 +9250,8 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
TextSpan(style: codeStyle.baseStyle, text: 'context'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.keywordStyle, text: 'break'),
|
TextSpan(style: codeStyle.keywordStyle, text: 'break'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
@@ -9165,7 +9261,8 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: 'fullscreen'),
|
TextSpan(style: codeStyle.baseStyle, text: 'fullscreen'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.classStyle, text: 'Navigator'),
|
TextSpan(style: codeStyle.classStyle, text: 'Navigator'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: 'push'),
|
TextSpan(style: codeStyle.baseStyle, text: 'push'),
|
||||||
@@ -9173,9 +9270,11 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.keywordStyle, text: 'void'),
|
TextSpan(style: codeStyle.keywordStyle, text: 'void'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '>('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '>('),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
style: codeStyle.baseStyle, text: '\u000a context'),
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a context'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.classStyle, text: 'MaterialPageRoute'),
|
TextSpan(style: codeStyle.classStyle, text: 'MaterialPageRoute'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
TextSpan(style: codeStyle.punctuationStyle, text: '('),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
@@ -9198,11 +9297,14 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
TextSpan(style: codeStyle.keywordStyle, text: 'true'),
|
TextSpan(style: codeStyle.keywordStyle, text: 'true'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ');'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.keywordStyle, text: 'break'),
|
TextSpan(style: codeStyle.keywordStyle, text: 'break'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
TextSpan(style: codeStyle.punctuationStyle, text: ';'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
@@ -9214,8 +9316,126 @@ class CodeSegments {
|
|||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
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.punctuationStyle, text: ');'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
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.commentStyle,
|
||||||
|
text: '/// A MaterialPageRoute 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: '_NoAnimationMaterialPageRoute'),
|
||||||
|
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: 'MaterialPageRoute'),
|
||||||
|
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: '_NoAnimationMaterialPageRoute'),
|
||||||
|
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: 'RouteSettings'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' settings'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
|
||||||
|
TextSpan(style: codeStyle.keywordStyle, text: 'bool'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' maintainState '),
|
||||||
|
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.keywordStyle, text: 'bool'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' fullscreenDialog '),
|
||||||
|
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: ' '),
|
||||||
|
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: '\u000a builder'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' builder'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle, text: '\u000a maintainState'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' maintainState'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a settings'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' settings'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(
|
||||||
|
style: codeStyle.baseStyle,
|
||||||
|
text: '\u000a fullscreenDialog'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' fullscreenDialog'),
|
||||||
|
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.classStyle, text: 'BuildContext'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' context'),
|
||||||
|
TextSpan(style: codeStyle.punctuationStyle, text: ','),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' '),
|
||||||
|
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: ' '),
|
||||||
|
TextSpan(style: codeStyle.classStyle, text: 'Widget'),
|
||||||
|
TextSpan(style: codeStyle.baseStyle, text: ' child'),
|
||||||
|
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.punctuationStyle, text: '}'),
|
||||||
TextSpan(style: codeStyle.baseStyle, text: '\u000a'),
|
TextSpan(style: codeStyle.baseStyle, text: '\u000a'),
|
||||||
TextSpan(style: codeStyle.punctuationStyle, text: '}'),
|
TextSpan(style: codeStyle.punctuationStyle, text: '}'),
|
||||||
@@ -13728,6 +13948,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: ' '),
|
||||||
@@ -13883,6 +14110,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: ' '),
|
||||||
@@ -16317,6 +16551,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: ' '),
|
||||||
@@ -17714,6 +17955,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: ' '),
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import 'package:gallery/demos/material/text_field_demo.dart';
|
|||||||
import 'package:gallery/demos/reference/colors_demo.dart';
|
import 'package:gallery/demos/reference/colors_demo.dart';
|
||||||
import 'package:gallery/demos/reference/typography_demo.dart';
|
import 'package:gallery/demos/reference/typography_demo.dart';
|
||||||
import 'package:gallery/l10n/gallery_localizations.dart';
|
import 'package:gallery/l10n/gallery_localizations.dart';
|
||||||
import 'package:gallery/pages/demo.dart';
|
|
||||||
import 'package:gallery/themes/material_demo_theme_data.dart';
|
import 'package:gallery/themes/material_demo_theme_data.dart';
|
||||||
|
|
||||||
class GalleryDemo {
|
class GalleryDemo {
|
||||||
@@ -669,37 +668,16 @@ class DemoWrapper extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
bool hasCycled = true;
|
return Theme(
|
||||||
return MaterialApp(
|
data: MaterialDemoThemeData.themeData.copyWith(
|
||||||
theme: MaterialDemoThemeData.themeData.copyWith(
|
|
||||||
platform: GalleryOptions.of(context).platform,
|
platform: GalleryOptions.of(context).platform,
|
||||||
),
|
),
|
||||||
debugShowCheckedModeBanner: false,
|
|
||||||
localizationsDelegates: GalleryLocalizations.localizationsDelegates,
|
|
||||||
supportedLocales: GalleryLocalizations.supportedLocales,
|
|
||||||
locale: GalleryOptions.of(context).locale,
|
|
||||||
// Remove the MediaQuery padding because the demo is rendered inside of a
|
|
||||||
// different page that already accounts for this padding.
|
|
||||||
home: MediaQuery.removePadding(
|
|
||||||
context: context,
|
|
||||||
removeTop: true,
|
|
||||||
removeBottom: true,
|
|
||||||
child: Focus(
|
|
||||||
onFocusChange: (hasFocus) {
|
|
||||||
if (hasFocus && hasCycled) {
|
|
||||||
hasCycled = !hasCycled;
|
|
||||||
FocusScope.of(context).requestFocus(
|
|
||||||
InheritedDemoFocusNodes.of(context).backButtonFocusNode);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: ApplyTextOptions(
|
child: ApplyTextOptions(
|
||||||
child: CupertinoTheme(
|
child: CupertinoTheme(
|
||||||
data: CupertinoThemeData().copyWith(brightness: Brightness.light),
|
data: CupertinoThemeData().copyWith(brightness: Brightness.light),
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,7 +216,10 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CupertinoPageScaffold(
|
return CupertinoPageScaffold(
|
||||||
navigationBar: CupertinoNavigationBar(middle: Text(_title(context))),
|
navigationBar: CupertinoNavigationBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
middle: Text(_title(context)),
|
||||||
|
),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Column(
|
return Column(
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class CupertinoButtonDemo extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CupertinoPageScaffold(
|
return CupertinoPageScaffold(
|
||||||
navigationBar: CupertinoNavigationBar(
|
navigationBar: CupertinoNavigationBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
middle:
|
middle:
|
||||||
Text(GalleryLocalizations.of(context).demoCupertinoButtonsTitle),
|
Text(GalleryLocalizations.of(context).demoCupertinoButtonsTitle),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class _CupertinoSegmentedControlDemoState
|
|||||||
|
|
||||||
return CupertinoPageScaffold(
|
return CupertinoPageScaffold(
|
||||||
navigationBar: CupertinoNavigationBar(
|
navigationBar: CupertinoNavigationBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
middle: Text(
|
middle: Text(
|
||||||
localizations.demoCupertinoSegmentedControlTitle,
|
localizations.demoCupertinoSegmentedControlTitle,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(_title(context)),
|
title: Text(_title(context)),
|
||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ class BottomSheetDemo extends StatelessWidget {
|
|||||||
return MaterialPageRoute<Widget>(
|
return MaterialPageRoute<Widget>(
|
||||||
builder: (context) => Scaffold(
|
builder: (context) => Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(_title(context)),
|
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
|
title: Text(_title(context)),
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class ButtonDemo extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(_title(context)),
|
title: Text(_title(context)),
|
||||||
),
|
),
|
||||||
body: buttons,
|
body: buttons,
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class ChipDemo extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(_title(context)),
|
title: Text(_title(context)),
|
||||||
),
|
),
|
||||||
body: buttons,
|
body: buttons,
|
||||||
|
|||||||
@@ -124,9 +124,16 @@ class DialogDemo extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Navigator(
|
||||||
|
// Adding [ValueKey] to make sure that the widget gets rebuilt when
|
||||||
|
// changing type.
|
||||||
|
key: ValueKey(type),
|
||||||
|
onGenerateRoute: (settings) {
|
||||||
|
return _NoAnimationMaterialPageRoute<void>(
|
||||||
|
builder: (context) => Scaffold(
|
||||||
key: _scaffoldKey,
|
key: _scaffoldKey,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(_title(context)),
|
title: Text(_title(context)),
|
||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
@@ -156,7 +163,30 @@ class DialogDemo extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A MaterialPageRoute without any transition animations.
|
||||||
|
class _NoAnimationMaterialPageRoute<T> extends MaterialPageRoute<T> {
|
||||||
|
_NoAnimationMaterialPageRoute({
|
||||||
|
@required WidgetBuilder builder,
|
||||||
|
RouteSettings settings,
|
||||||
|
bool maintainState = true,
|
||||||
|
bool fullscreenDialog = false,
|
||||||
|
}) : super(
|
||||||
|
builder: builder,
|
||||||
|
maintainState: maintainState,
|
||||||
|
settings: settings,
|
||||||
|
fullscreenDialog: fullscreenDialog);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget buildTransitions(BuildContext context, Animation<double> animation,
|
||||||
|
Animation<double> secondaryAnimation, Widget child) {
|
||||||
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class ListDemo extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(GalleryLocalizations.of(context).demoListsTitle),
|
title: Text(GalleryLocalizations.of(context).demoListsTitle),
|
||||||
),
|
),
|
||||||
body: Scrollbar(
|
body: Scrollbar(
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class SelectionControlsDemo extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(_title(context)),
|
title: Text(_title(context)),
|
||||||
),
|
),
|
||||||
body: controls,
|
body: controls,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class SnackbarsDemo extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(GalleryLocalizations.of(context).demoSnackbarsTitle),
|
title: Text(GalleryLocalizations.of(context).demoSnackbarsTitle),
|
||||||
),
|
),
|
||||||
body: Builder(
|
body: Builder(
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class TabsDemo extends StatelessWidget {
|
|||||||
length: tabs.length,
|
length: tabs.length,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(GalleryLocalizations.of(context).demoTabsTitle),
|
title: Text(GalleryLocalizations.of(context).demoTabsTitle),
|
||||||
bottom: TabBar(
|
bottom: TabBar(
|
||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class TextFieldDemo extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(GalleryLocalizations.of(context).demoTextFieldTitle),
|
title: Text(GalleryLocalizations.of(context).demoTextFieldTitle),
|
||||||
),
|
),
|
||||||
body: TextFormFieldDemo(),
|
body: TextFormFieldDemo(),
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ class ColorsDemo extends StatelessWidget {
|
|||||||
length: palettes.length,
|
length: palettes.length,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(GalleryLocalizations.of(context).demoColorsTitle),
|
title: Text(GalleryLocalizations.of(context).demoColorsTitle),
|
||||||
bottom: TabBar(
|
bottom: TabBar(
|
||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ class TypographyDemo extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
title: Text(GalleryLocalizations.of(context).demoTypographyTitle),
|
title: Text(GalleryLocalizations.of(context).demoTypographyTitle),
|
||||||
),
|
),
|
||||||
body: Scrollbar(child: ListView(children: styleItems)),
|
body: Scrollbar(child: ListView(children: styleItems)),
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ class _DemoPageState extends State<DemoPage> with TickerProviderStateMixin {
|
|||||||
int _demoViewedCount;
|
int _demoViewedCount;
|
||||||
|
|
||||||
AnimationController _codeBackgroundColorController;
|
AnimationController _codeBackgroundColorController;
|
||||||
FocusNode backButonFocusNode;
|
|
||||||
|
|
||||||
GalleryDemoConfiguration get _currentConfig {
|
GalleryDemoConfiguration get _currentConfig {
|
||||||
return widget.demo.configurations[_configIndex];
|
return widget.demo.configurations[_configIndex];
|
||||||
@@ -85,13 +84,11 @@ class _DemoPageState extends State<DemoPage> with TickerProviderStateMixin {
|
|||||||
preferences.setInt(_demoViewedCountKey, _demoViewedCount + 1);
|
preferences.setInt(_demoViewedCountKey, _demoViewedCount + 1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
backButonFocusNode = FocusNode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_codeBackgroundColorController.dispose();
|
_codeBackgroundColorController.dispose();
|
||||||
backButonFocusNode.dispose();
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +188,6 @@ class _DemoPageState extends State<DemoPage> with TickerProviderStateMixin {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.maybePop(context);
|
Navigator.maybePop(context);
|
||||||
},
|
},
|
||||||
focusNode: backButonFocusNode,
|
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
if (_hasOptions)
|
if (_hasOptions)
|
||||||
@@ -487,10 +483,7 @@ class _DemoPageState extends State<DemoPage> with TickerProviderStateMixin {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return InheritedDemoFocusNodes(
|
return FeatureDiscoveryController(page);
|
||||||
backButtonFocusNode: backButonFocusNode,
|
|
||||||
child: FeatureDiscoveryController(page),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,19 +774,3 @@ class CodeDisplayPage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class InheritedDemoFocusNodes extends InheritedWidget {
|
|
||||||
InheritedDemoFocusNodes({
|
|
||||||
@required Widget child,
|
|
||||||
@required this.backButtonFocusNode,
|
|
||||||
}) : assert(child != null),
|
|
||||||
super(child: child);
|
|
||||||
|
|
||||||
final FocusNode backButtonFocusNode;
|
|
||||||
|
|
||||||
static InheritedDemoFocusNodes of(BuildContext context) =>
|
|
||||||
context.dependOnInheritedWidgetOfExactType();
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool updateShouldNotify(InheritedWidget oldWidget) => true;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user