13
13
14
14
namespace UIWidgetsGallery . gallery {
15
15
class CupertinoNavigationDemoUtils {
16
- public const string _kGalleryAssetsPackage = "flutter_gallery_assets" ;
17
-
18
16
public const int _kChildCount = 50 ;
19
17
20
18
public static List < Color > coolColors = new List < Color > {
@@ -87,7 +85,6 @@ public static List<Widget> buildTab2Conversation() {
87
85
}
88
86
}
89
87
90
-
91
88
public class CupertinoNavigationDemo : StatelessWidget {
92
89
public CupertinoNavigationDemo ( ) {
93
90
this . colorItems = new List < Color > ( ) ;
@@ -187,8 +184,8 @@ public CupertinoDemoTab1(
187
184
List < Color > colorItems = null ,
188
185
List < string > colorNameItems = null
189
186
) {
190
- this . colorItems = colorItems ;
191
- this . colorNameItems = colorNameItems ;
187
+ this . colorItems = colorItems ?? new List < Color > ( ) ;
188
+ this . colorNameItems = colorNameItems ?? new List < string > ( ) ;
192
189
}
193
190
194
191
public readonly List < Color > colorItems ;
@@ -354,7 +351,8 @@ public override void initState() {
354
351
for ( int i = 0 ; i < 10 ; i ++ ) {
355
352
this . relatedColors . Add (
356
353
Color . fromARGB (
357
- 255 , this . widget . color . red + Random . Range ( 0 , 50 ) . clamp ( 0 , 255 ) ,
354
+ 255 ,
355
+ this . widget . color . red + Random . Range ( 0 , 50 ) . clamp ( 0 , 255 ) ,
358
356
this . widget . color . green + Random . Range ( 0 , 50 ) . clamp ( 0 , 255 ) ,
359
357
this . widget . color . blue + Random . Range ( 0 , 50 ) . clamp ( 0 , 255 )
360
358
)
@@ -370,7 +368,6 @@ public override Widget build(BuildContext context) {
370
368
trailing : new ExitButton ( )
371
369
) ,
372
370
child : new SafeArea (
373
- top : false ,
374
371
bottom : false ,
375
372
child : new ListView (
376
373
children : new List < Widget > {
@@ -480,7 +477,7 @@ public override Widget build(BuildContext context) {
480
477
) ;
481
478
}
482
479
)
483
- ) ,
480
+ )
484
481
}
485
482
)
486
483
)
@@ -752,52 +749,54 @@ public override Widget build(BuildContext context) {
752
749
navigationBar : new CupertinoNavigationBar (
753
750
trailing : CupertinoNavigationDemoUtils . trailingButtons
754
751
) ,
755
- child : new DecoratedBox (
756
- decoration : new BoxDecoration (
757
- color : CupertinoTheme . of ( context ) . brightness == Brightness . light
758
- ? CupertinoColors . extraLightBackgroundGray
759
- : CupertinoColors . darkBackgroundGray
760
- ) ,
761
- child : new ListView (
762
- children : new List < Widget > {
763
- new Padding ( padding : EdgeInsets . only ( top : 32.0f ) ) ,
764
- new GestureDetector (
765
- onTap : ( ) => {
766
- Navigator . of ( context , rootNavigator : true ) . push (
767
- new CupertinoPageRoute (
768
- fullscreenDialog : true ,
769
- builder : ( BuildContext _context ) => new Tab3Dialog ( )
770
- )
771
- ) ;
772
- } ,
773
- child : new Container (
774
- decoration : new BoxDecoration (
775
- color : CupertinoTheme . of ( context ) . scaffoldBackgroundColor ,
776
- border : new Border (
777
- top : new BorderSide ( color : new Color ( 0xfBCBBC1 ) , width : 0.0f ) ,
778
- bottom : new BorderSide ( color : new Color ( 0xfBCBBC1 ) , width : 0.0f )
779
- )
780
- ) ,
781
- height : 44.0f ,
782
- child : new Padding (
783
- padding : EdgeInsets . symmetric ( horizontal : 16.0f , vertical : 8.0f ) ,
784
- child : new SafeArea (
785
- top : false ,
786
- bottom : false ,
787
- child : new Row (
788
- children : new List < Widget > {
789
- new Text (
790
- "Sign in" ,
791
- style : new TextStyle ( color : CupertinoTheme . of ( context )
792
- . primaryColor )
793
- ) ,
794
- }
752
+ child : new SafeArea (
753
+ child : new DecoratedBox (
754
+ decoration : new BoxDecoration (
755
+ color : CupertinoTheme . of ( context ) . brightness == Brightness . light
756
+ ? CupertinoColors . extraLightBackgroundGray
757
+ : CupertinoColors . darkBackgroundGray
758
+ ) ,
759
+ child : new ListView (
760
+ children : new List < Widget > {
761
+ new Padding ( padding : EdgeInsets . only ( top : 32.0f ) ) ,
762
+ new GestureDetector (
763
+ onTap : ( ) => {
764
+ Navigator . of ( context , rootNavigator : true ) . push (
765
+ new CupertinoPageRoute (
766
+ fullscreenDialog : true ,
767
+ builder : ( BuildContext _context ) => new Tab3Dialog ( )
768
+ )
769
+ ) ;
770
+ } ,
771
+ child : new Container (
772
+ decoration : new BoxDecoration (
773
+ color : CupertinoTheme . of ( context ) . scaffoldBackgroundColor ,
774
+ border : new Border (
775
+ top : new BorderSide ( color : new Color ( 0xfBCBBC1 ) , width : 0.0f ) ,
776
+ bottom : new BorderSide ( color : new Color ( 0xfBCBBC1 ) , width : 0.0f )
777
+ )
778
+ ) ,
779
+ height : 44.0f ,
780
+ child : new Padding (
781
+ padding : EdgeInsets . symmetric ( horizontal : 16.0f , vertical : 8.0f ) ,
782
+ child : new SafeArea (
783
+ top : false ,
784
+ bottom : false ,
785
+ child : new Row (
786
+ children : new List < Widget > {
787
+ new Text (
788
+ "Sign in" ,
789
+ style : new TextStyle ( color : CupertinoTheme . of ( context )
790
+ . primaryColor )
791
+ ) ,
792
+ }
793
+ )
795
794
)
796
795
)
797
796
)
798
797
)
799
- )
800
- }
798
+ }
799
+ )
801
800
)
802
801
)
803
802
) ;
0 commit comments