1
1
import 'dart:ui' ;
2
2
3
3
import 'package:flutter/cupertino.dart' ;
4
+ import 'package:flutter/foundation.dart' ;
4
5
import 'package:flutter/material.dart' ;
5
6
import 'package:flutter/rendering.dart' ;
6
7
import 'package:loading_gifs/loading_gifs.dart' ;
8
+ import 'package:responsive_framework/responsive_framework.dart' ;
7
9
8
10
void main () => runApp (MyApp ());
9
11
@@ -12,59 +14,66 @@ class MyApp extends StatelessWidget {
12
14
Widget build (BuildContext context) {
13
15
return CupertinoApp (
14
16
title: 'Loading GIFS' ,
17
+ builder: (context, widget) => ResponsiveWrapper .builder (widget,
18
+ maxWidth: 1200 ,
19
+ minWidth: 450 ,
20
+ defaultScale: true ,
21
+ breakpoints: [
22
+ ResponsiveBreakpoint (breakpoint: 450 , name: MOBILE ),
23
+ ],
24
+ background: Container (color: Color (0xFFF5F5F5 ))),
15
25
home: CupertinoPageScaffold (
16
- child: Material (
17
- child: CustomScrollView (
18
- slivers: < Widget > [
19
- CupertinoSliverNavigationBar (
20
- largeTitle: Text (
21
- "Loading GIFs" ,
22
- style: TextStyle (color: Color (0xFF1C1C1E )),
23
- ),
24
- backgroundColor: Colors .transparent,
25
- border: Border .all (style: BorderStyle .none),
26
- automaticallyImplyLeading: false ,
26
+ child: CustomScrollView (
27
+ shrinkWrap: true ,
28
+ slivers: < Widget > [
29
+ CupertinoSliverNavigationBar (
30
+ largeTitle: Text (
31
+ "Loading GIFs" ,
32
+ style: TextStyle (color: Color (0xFF1C1C1E )),
27
33
),
28
- SliverList (
29
- delegate: SliverChildListDelegate .fixed (< Widget > [
30
- subHeaderText ("Cupertino" , subtitle: "iOS" ),
31
- SingleChildScrollView (
32
- scrollDirection: Axis .horizontal,
33
- child: Padding (
34
- padding: EdgeInsets .fromLTRB (6 , 0 , 6 , 0 ),
35
- child: Row (
36
- children: < Widget > [
37
- for (double i = 1 ; i <= 10 ; i++ )
38
- ShowcaseCard (
39
- child: Image .asset (cupertinoActivityIndicator,
40
- scale: i),
41
- label: "Size ${i .round ()}" ,
42
- ),
43
- ],
44
- ),
34
+ backgroundColor: Colors .transparent,
35
+ border: Border .all (style: BorderStyle .none),
36
+ automaticallyImplyLeading: false ,
37
+ ),
38
+ SliverList (
39
+ delegate: SliverChildListDelegate .fixed (< Widget > [
40
+ subHeaderText ("Cupertino" , subtitle: "iOS" ),
41
+ SingleChildScrollView (
42
+ scrollDirection: Axis .horizontal,
43
+ child: Padding (
44
+ padding: EdgeInsets .fromLTRB (6 , 0 , 6 , 0 ),
45
+ child: Row (
46
+ children: < Widget > [
47
+ for (double i = 1 ; i <= 10 ; i++ )
48
+ ShowcaseCard (
49
+ child:
50
+ Image .asset (cupertinoActivityIndicator, scale: i),
51
+ label: "Size ${i .round ()}" ,
52
+ ),
53
+ ],
45
54
),
46
55
),
47
- subHeaderText ( "Material" , subtitle : "Android" ),
48
- SingleChildScrollView (
49
- scrollDirection : Axis .horizontal,
50
- child : Padding (
51
- padding : EdgeInsets . fromLTRB ( 6 , 0 , 6 , 8 ),
52
- child : Row (
53
- children : < Widget > [
54
- for ( double i = 1 ; i <= 10 ; i ++ )
55
- ShowcaseCard (
56
- child : Image . asset (circularProgressIndicator,
57
- scale : i),
58
- label : "Size ${ i . round ()}" ,
59
- ) ,
60
- ] ,
61
- ) ,
56
+ ),
57
+ subHeaderText ( "Material" , subtitle : "Android" ),
58
+ SingleChildScrollView (
59
+ scrollDirection : Axis .horizontal,
60
+ child : Padding (
61
+ padding : EdgeInsets . fromLTRB ( 6 , 0 , 6 , 8 ),
62
+ child : Row (
63
+ children : < Widget > [
64
+ for ( double i = 1 ; i <= 10 ; i ++ )
65
+ ShowcaseCard (
66
+ child :
67
+ Image . asset (circularProgressIndicator, scale : i) ,
68
+ label : "Size ${ i . round ()}" ,
69
+ ) ,
70
+ ] ,
62
71
),
63
72
),
64
- ] ),
65
- ),
66
- ] ,
67
- ) ,
73
+ ),
74
+ ] ),
75
+ ) ,
76
+ ] ,
68
77
)),
69
78
debugShowCheckedModeBanner: false ,
70
79
);
@@ -134,10 +143,12 @@ class ShowcaseCard extends StatelessWidget {
134
143
),
135
144
Card (
136
145
margin: EdgeInsets .fromLTRB (12 , 4 , 12 , 24 ),
137
- elevation: 12 ,
146
+ elevation: kIsWeb ? 8 : 10 ,
138
147
shape:
139
- RoundedRectangleBorder (borderRadius: BorderRadius .circular (10 )),
140
- shadowColor: Colors .black45,
148
+ RoundedRectangleBorder (borderRadius: BorderRadius .circular (12 )),
149
+ shadowColor: kIsWeb
150
+ ? Color .fromARGB (72 , 178 , 178 , 178 )
151
+ : Color .fromARGB (156 , 178 , 178 , 178 ),
141
152
child: Container (
142
153
width: width,
143
154
height: width,
@@ -151,9 +162,9 @@ class ShowcaseCard extends StatelessWidget {
151
162
bottom: 0 ,
152
163
child: ClipRRect (
153
164
borderRadius:
154
- BorderRadius .vertical (bottom: Radius .circular (10 )),
165
+ BorderRadius .vertical (bottom: Radius .circular (12 )),
155
166
child: BackdropFilter (
156
- filter: ImageFilter .blur (sigmaX: 3 , sigmaY: 3 ),
167
+ filter: ImageFilter .blur (sigmaX: 1 , sigmaY: 1 ),
157
168
child: Container (
158
169
width: width,
159
170
height: 30 ,
0 commit comments