Skip to content

Commit 27283ec

Browse files
committed
Minor updates to Stack demo
1 parent d7a8a56 commit 27283ec

File tree

10 files changed

+12050
-58
lines changed

10 files changed

+12050
-58
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"fonts":[{"asset":"fonts/MaterialIcons-Regular.ttf"}],"family":"MaterialIcons"},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]}]

07_stacks/ios/Flutter/flutter_assets/LICENSE

Lines changed: 11996 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

07_stacks/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12+
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
1213
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
1314
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1415
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
1516
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1617
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
1718
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
18-
9740EEBB1CF902C7004384FC /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB71CF902C7004384FC /* app.flx */; };
1919
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
2020
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
2121
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -42,13 +42,13 @@
4242
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
4343
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
4444
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
45+
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
4546
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
4647
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4748
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
4849
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
4950
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
5051
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
51-
9740EEB71CF902C7004384FC /* app.flx */ = {isa = PBXFileReference; lastKnownFileType = file; name = app.flx; path = Flutter/app.flx; sourceTree = "<group>"; };
5252
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
5353
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
5454
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@@ -74,9 +74,9 @@
7474
9740EEB11CF90186004384FC /* Flutter */ = {
7575
isa = PBXGroup;
7676
children = (
77-
9740EEB71CF902C7004384FC /* app.flx */,
7877
3B80C3931E831B6300D905FE /* App.framework */,
7978
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
79+
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
8080
9740EEBA1CF902C7004384FC /* Flutter.framework */,
8181
9740EEB21CF90195004384FC /* Debug.xcconfig */,
8282
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -187,10 +187,10 @@
187187
isa = PBXResourcesBuildPhase;
188188
buildActionMask = 2147483647;
189189
files = (
190-
9740EEBB1CF902C7004384FC /* app.flx in Resources */,
191190
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
192191
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
193192
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
193+
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
194194
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
195195
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
196196
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>BuildSystemType</key>
6+
<string>Original</string>
7+
</dict>
8+
</plist>

07_stacks/lib/main.dart

Lines changed: 40 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,76 +5,62 @@
55
import 'package:flutter/material.dart';
66

77
void main() {
8-
runApp(new MyApp());
8+
runApp(MyApp());
99
}
1010

1111
class MyApp extends StatelessWidget {
1212
@override
1313
Widget build(BuildContext context) {
14-
return new MaterialApp(
15-
title: 'Flutter Demo',
16-
theme: new ThemeData(
17-
primarySwatch: Colors.blue,
18-
),
19-
home: new StackExamplePage(),
14+
return MaterialApp(
15+
title: 'Flutter Stack Demo',
16+
home: StackExamplePage(),
2017
);
2118
}
2219
}
2320

2421
class StackExamplePage extends StatelessWidget {
2522
@override
2623
Widget build(BuildContext context) {
27-
return new Scaffold(
24+
return Scaffold(
2825
backgroundColor: Colors.grey,
29-
appBar: new AppBar(
30-
title: new Text('Stack Example')
31-
),
32-
body: _createStack()
33-
);
26+
appBar: AppBar(title: Text('Stack Example')),
27+
body: _createStack());
3428
}
3529

3630
_createStack() {
37-
return new Stack(
38-
children: <Widget>[
39-
new Image.network(
40-
'https://i.imgur.com/FsXL8vI.jpg',
41-
),
42-
// Black square centered in stack
43-
new Align(
44-
alignment: new Alignment(0.0, 0.0),
45-
child: new Container(
46-
height: 50.0,
47-
width: 50.0,
48-
child: new DecoratedBox(
49-
decoration: new BoxDecoration(
50-
color: Colors.black
51-
),
52-
),
53-
),
54-
),
55-
new Align(
56-
// alignment: Alignment.topLeft,
57-
alignment: const Alignment(-1.0, -1.0),
58-
child: new Text('Top Left',
59-
style: new TextStyle(color: Colors.yellow)),
60-
),
61-
new Align(
62-
// alignment: Alignment.bottomRight,
63-
alignment: const Alignment(1.0, 1.0),
64-
child: new Text('Bottom Right',
65-
style: new TextStyle(color: Colors.yellow)),
66-
),
67-
new Align(
68-
alignment: new Alignment(-0.8, -0.8),
69-
child: new Text(
70-
'10% in', style: new TextStyle(color: Colors.yellow)),
71-
),
72-
new Align(
73-
alignment: new Alignment(0.8, 0.8),
74-
child: new Text(
75-
'90% in', style: new TextStyle(color: Colors.yellow)),
31+
return Stack(children: <Widget>[
32+
Image.network(
33+
'https://i.imgur.com/FsXL8vI.jpg',
34+
),
35+
// Black square centered in stack
36+
Align(
37+
alignment: Alignment(0.0, 0.0),
38+
child: Container(
39+
height: 50.0,
40+
width: 50.0,
41+
child: DecoratedBox(
42+
decoration: BoxDecoration(color: Colors.black),
7643
),
77-
]
78-
);
44+
),
45+
),
46+
Align(
47+
// alignment: Alignment.topLeft,
48+
alignment: const Alignment(-1.0, -1.0),
49+
child: Text('Top Left', style: TextStyle(color: Colors.yellow)),
50+
),
51+
Align(
52+
// alignment: Alignment.bottomRight,
53+
alignment: const Alignment(1.0, 1.0),
54+
child: Text('Bottom Right', style: TextStyle(color: Colors.yellow)),
55+
),
56+
Align(
57+
alignment: Alignment(-0.8, -0.8),
58+
child: Text('10% in', style: TextStyle(color: Colors.yellow)),
59+
),
60+
Align(
61+
alignment: Alignment(0.8, 0.8),
62+
child: Text('90% in', style: TextStyle(color: Colors.yellow)),
63+
),
64+
]);
7965
}
8066
}

0 commit comments

Comments
 (0)