Skip to content

Commit da4bc7d

Browse files
committed
Create Web Demo
*Import Responsive Framework for web support.
1 parent b950255 commit da4bc7d

File tree

2 files changed

+73
-52
lines changed

2 files changed

+73
-52
lines changed

example/lib/main.dart

Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import 'dart:ui';
22

33
import 'package:flutter/cupertino.dart';
4+
import 'package:flutter/foundation.dart';
45
import 'package:flutter/material.dart';
56
import 'package:flutter/rendering.dart';
67
import 'package:loading_gifs/loading_gifs.dart';
8+
import 'package:responsive_framework/responsive_framework.dart';
79

810
void main() => runApp(MyApp());
911

@@ -12,59 +14,66 @@ class MyApp extends StatelessWidget {
1214
Widget build(BuildContext context) {
1315
return CupertinoApp(
1416
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))),
1525
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)),
2733
),
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+
],
4554
),
4655
),
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+
],
6271
),
6372
),
64-
]),
65-
),
66-
],
67-
),
73+
),
74+
]),
75+
),
76+
],
6877
)),
6978
debugShowCheckedModeBanner: false,
7079
);
@@ -134,10 +143,12 @@ class ShowcaseCard extends StatelessWidget {
134143
),
135144
Card(
136145
margin: EdgeInsets.fromLTRB(12, 4, 12, 24),
137-
elevation: 12,
146+
elevation: kIsWeb ? 8 : 10,
138147
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),
141152
child: Container(
142153
width: width,
143154
height: width,
@@ -151,9 +162,9 @@ class ShowcaseCard extends StatelessWidget {
151162
bottom: 0,
152163
child: ClipRRect(
153164
borderRadius:
154-
BorderRadius.vertical(bottom: Radius.circular(10)),
165+
BorderRadius.vertical(bottom: Radius.circular(12)),
155166
child: BackdropFilter(
156-
filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3),
167+
filter: ImageFilter.blur(sigmaX: 1, sigmaY: 1),
157168
child: Container(
158169
width: width,
159170
height: 30,

example/pubspec.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@ dependencies:
1010
sdk: flutter
1111
loading_gifs:
1212
path: ../
13+
responsive_framework: ^0.0.4
1314

1415
dev_dependencies:
1516
flutter_test:
1617
sdk: flutter
18+
flutter_launcher_icons: ^0.7.4
19+
20+
flutter_icons:
21+
android: true
22+
ios: true
23+
image_path_android: "assets/Loading-GIFs-Logo.png"
24+
image_path_ios: "assets/Loading-GIFs-Logo-iOS.png"
25+
adaptive_icon_background: "#FFFFFFFF"
26+
adaptive_icon_foreground: "assets/Loading-GIFs-Logo-Adaptive.png"
1727

1828
flutter:

0 commit comments

Comments
 (0)