Skip to content

Commit 75b13f7

Browse files
Revert "Remove MaterialControls from examples/flutter_view (flutter#57621)"
This reverts commit 12d83a8. That commit was accidentally pushed to the wrong branch.
1 parent 12d83a8 commit 75b13f7

File tree

9 files changed

+124
-17
lines changed

9 files changed

+124
-17
lines changed

dev/devicelab/bin/tasks/flutter_view_ios__start_up.dart

+19-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,30 @@
33
// found in the LICENSE file.
44

55
import 'dart:async';
6+
import 'dart:io';
67

8+
import 'package:flutter_devicelab/framework/utils.dart';
79
import 'package:flutter_devicelab/tasks/perf_tests.dart';
810
import 'package:flutter_devicelab/framework/adb.dart';
911
import 'package:flutter_devicelab/framework/framework.dart';
1012

1113
Future<void> main() async {
1214
deviceOperatingSystem = DeviceOperatingSystem.ios;
13-
await task(createFlutterViewStartupTest());
15+
await task(() async {
16+
final Directory iosDirectory = dir(
17+
'${flutterDirectory.path}/examples/flutter_view/ios',
18+
);
19+
await inDirectory(iosDirectory, () async {
20+
await exec(
21+
'pod',
22+
<String>['install'],
23+
environment: <String, String>{
24+
'LANG': 'en_US.UTF-8',
25+
},
26+
);
27+
});
28+
29+
final TaskFunction taskFunction = createFlutterViewStartupTest();
30+
return await taskFunction();
31+
});
1432
}

examples/flutter_view/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ You can read more about
1111
## iOS
1212

1313
You can open `ios/Runner.xcworkspace` in Xcode and build the project as
14-
usual.
14+
usual. For this sample you need to run `pod install` from the `ios` folder
15+
before building the first time.
1516

1617
## Android
1718

Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
#include "Generated.xcconfig"
2+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
#include "Generated.xcconfig"
2+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"

examples/flutter_view/ios/Podfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
5+
install! 'cocoapods', :disable_input_output_paths => true
6+
7+
target 'Runner' do
8+
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
9+
use_frameworks!
10+
use_modular_headers!
11+
12+
# Pods for Runner
13+
pod 'MaterialControls', '~> 1.2.2'
14+
15+
end

examples/flutter_view/ios/Runner.xcodeproj/project.pbxproj

+61
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1717
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1818
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
19+
A10521F6BE294095B24A8A75 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 069A5C81CEBC82AF6693F60F /* Pods_Runner.framework */; };
1920
/* End PBXBuildFile section */
2021

2122
/* Begin PBXCopyFilesBuildPhase section */
@@ -32,12 +33,14 @@
3233
/* End PBXCopyFilesBuildPhase section */
3334

3435
/* Begin PBXFileReference section */
36+
069A5C81CEBC82AF6693F60F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3537
2D4B11261E55A15A00FF14DB /* NativeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeViewController.m; sourceTree = "<group>"; };
3638
2D4B11281E55A31800FF14DB /* NativeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeViewController.h; sourceTree = "<group>"; };
3739
2DD8945E1E5B87AF0010574F /* ic_add.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_add.png; sourceTree = "<group>"; };
3840
2DE332E61E55C6D800393FD5 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
3941
2DE332E81E55C6F100393FD5 /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
4042
3B3967041E83383D004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
43+
63EC5EC13E843CD861057871 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
4144
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4245
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
4346
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -49,19 +52,32 @@
4952
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5053
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
5154
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
55+
C50B4FE91C29B0DE9DD62DD3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
56+
EADA814501F2EF49C9E6C636 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
5257
/* End PBXFileReference section */
5358

5459
/* Begin PBXFrameworksBuildPhase section */
5560
97C146EB1CF9000F007C117D /* Frameworks */ = {
5661
isa = PBXFrameworksBuildPhase;
5762
buildActionMask = 2147483647;
5863
files = (
64+
A10521F6BE294095B24A8A75 /* Pods_Runner.framework in Frameworks */,
5965
);
6066
runOnlyForDeploymentPostprocessing = 0;
6167
};
6268
/* End PBXFrameworksBuildPhase section */
6369

6470
/* Begin PBXGroup section */
71+
840012C8B5EDBCF56B0E4AC1 /* Pods */ = {
72+
isa = PBXGroup;
73+
children = (
74+
63EC5EC13E843CD861057871 /* Pods-Runner.debug.xcconfig */,
75+
C50B4FE91C29B0DE9DD62DD3 /* Pods-Runner.release.xcconfig */,
76+
EADA814501F2EF49C9E6C636 /* Pods-Runner.profile.xcconfig */,
77+
);
78+
name = Pods;
79+
sourceTree = "<group>";
80+
};
6581
9740EEB11CF90186004384FC /* Flutter */ = {
6682
isa = PBXGroup;
6783
children = (
@@ -79,6 +95,8 @@
7995
9740EEB11CF90186004384FC /* Flutter */,
8096
97C146F01CF9000F007C117D /* Runner */,
8197
97C146EF1CF9000F007C117D /* Products */,
98+
840012C8B5EDBCF56B0E4AC1 /* Pods */,
99+
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
82100
);
83101
sourceTree = "<group>";
84102
};
@@ -117,19 +135,29 @@
117135
name = "Supporting Files";
118136
sourceTree = "<group>";
119137
};
138+
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = {
139+
isa = PBXGroup;
140+
children = (
141+
069A5C81CEBC82AF6693F60F /* Pods_Runner.framework */,
142+
);
143+
name = Frameworks;
144+
sourceTree = "<group>";
145+
};
120146
/* End PBXGroup section */
121147

122148
/* Begin PBXNativeTarget section */
123149
97C146ED1CF9000F007C117D /* Runner */ = {
124150
isa = PBXNativeTarget;
125151
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
126152
buildPhases = (
153+
C15931CF7E2D081FE06790F0 /* [CP] Check Pods Manifest.lock */,
127154
9740EEB61CF901F6004384FC /* Run Script */,
128155
97C146EA1CF9000F007C117D /* Sources */,
129156
97C146EB1CF9000F007C117D /* Frameworks */,
130157
97C146EC1CF9000F007C117D /* Resources */,
131158
9705A1C41CF9048500538489 /* Embed Frameworks */,
132159
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
160+
D7EBAA0AD2D4385BA6FA83BA /* [CP] Embed Pods Frameworks */,
133161
);
134162
buildRules = (
135163
);
@@ -217,6 +245,39 @@
217245
shellPath = /bin/sh;
218246
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
219247
};
248+
C15931CF7E2D081FE06790F0 /* [CP] Check Pods Manifest.lock */ = {
249+
isa = PBXShellScriptBuildPhase;
250+
buildActionMask = 2147483647;
251+
files = (
252+
);
253+
inputPaths = (
254+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
255+
"${PODS_ROOT}/Manifest.lock",
256+
);
257+
name = "[CP] Check Pods Manifest.lock";
258+
outputPaths = (
259+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
260+
);
261+
runOnlyForDeploymentPostprocessing = 0;
262+
shellPath = /bin/sh;
263+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
264+
showEnvVarsInLog = 0;
265+
};
266+
D7EBAA0AD2D4385BA6FA83BA /* [CP] Embed Pods Frameworks */ = {
267+
isa = PBXShellScriptBuildPhase;
268+
buildActionMask = 2147483647;
269+
files = (
270+
);
271+
inputPaths = (
272+
);
273+
name = "[CP] Embed Pods Frameworks";
274+
outputPaths = (
275+
);
276+
runOnlyForDeploymentPostprocessing = 0;
277+
shellPath = /bin/sh;
278+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
279+
showEnvVarsInLog = 0;
280+
};
220281
/* End PBXShellScriptBuildPhase section */
221282

222283
/* Begin PBXSourcesBuildPhase section */

examples/flutter_view/ios/Runner.xcworkspace/contents.xcworkspacedata

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/flutter_view/ios/Runner/Base.lproj/Main.storyboard

+20-14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="FnB-1o-m6P">
3-
<device id="retina4_7" orientation="portrait" appearance="light"/>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="FnB-1o-m6P">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
46
<dependencies>
5-
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
7+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
78
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
89
</dependencies>
910
<scenes>
@@ -84,13 +85,13 @@
8485
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
8586
<subviews>
8687
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="zVI-Xh-iNx">
87-
<rect key="frame" x="0.0" y="0.0" width="375" height="333.5"/>
88+
<rect key="frame" x="0.0" y="0.0" width="375" height="334"/>
8889
<subviews>
8990
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NLS-lx-anZ" userLabel="Top">
90-
<rect key="frame" x="0.0" y="0.0" width="375" height="263.5"/>
91+
<rect key="frame" x="0.0" y="0.0" width="375" height="264"/>
9192
<subviews>
9293
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Flutter button tapped 0 times." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PJ2-AA-Riy" userLabel="IncrementLabel">
93-
<rect key="frame" x="73.5" y="121.5" width="228.5" height="20.5"/>
94+
<rect key="frame" x="73" y="122" width="229" height="21"/>
9495
<fontDescription key="fontDescription" type="system" pointSize="17"/>
9596
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
9697
<nil key="highlightedColor"/>
@@ -102,26 +103,31 @@
102103
</constraints>
103104
</view>
104105
<view contentMode="scaleToFill" restorationIdentifier="Bottom" translatesAutoresizingMaskIntoConstraints="NO" id="Qxj-hW-CeP" userLabel="Bottom">
105-
<rect key="frame" x="0.0" y="263.5" width="375" height="70"/>
106+
<rect key="frame" x="0.0" y="264" width="375" height="70"/>
106107
<subviews>
107108
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="iOS" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="K0h-kv-J7E">
108-
<rect key="frame" x="20" y="14" width="47" height="36"/>
109+
<rect key="frame" x="20" y="14" width="48" height="36"/>
109110
<fontDescription key="fontDescription" type="system" pointSize="30"/>
110111
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
111112
<nil key="highlightedColor"/>
112113
</label>
113-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Jfa-Lk-nDI">
114+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Jfa-Lk-nDI" customClass="MDButton">
114115
<rect key="frame" x="300" y="-5" width="55" height="55"/>
115116
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
116117
<constraints>
117118
<constraint firstAttribute="height" constant="55" id="QYW-fS-Hcx"/>
118119
<constraint firstAttribute="width" constant="55" id="zeJ-gS-6zj"/>
119120
</constraints>
120121
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
121-
<state key="normal" image="ic_add.png"/>
122-
<state key="disabled" image="ic_add.png"/>
123-
<state key="selected" image="ic_add.png"/>
124-
<state key="highlighted" image="ic_add.png"/>
122+
<userDefinedRuntimeAttributes>
123+
<userDefinedRuntimeAttribute type="number" keyPath="type">
124+
<integer key="value" value="2"/>
125+
</userDefinedRuntimeAttribute>
126+
<userDefinedRuntimeAttribute type="image" keyPath="imageNormal" value="ic_add.png"/>
127+
<userDefinedRuntimeAttribute type="color" keyPath="rippleColor">
128+
<color key="value" red="0.82337594754841859" green="0.83186435937881464" blue="0.83186435937881464" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
129+
</userDefinedRuntimeAttribute>
130+
</userDefinedRuntimeAttributes>
125131
<connections>
126132
<action selector="handleIncrement:" destination="g6V-0q-Qmt" eventType="touchUpInside" id="3ie-8K-E0v"/>
127133
</connections>

examples/flutter_view/ios/Runner/NativeViewController.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#import <Foundation/Foundation.h>
66

77
#import "NativeViewController.h"
8+
#import "MDButton.h"
89

910
@interface NativeViewController ()
1011
@property int counter;
@@ -18,7 +19,7 @@ - (void)viewDidLoad {
1819
self.counter = 0;
1920
}
2021

21-
- (IBAction)handleIncrement:(id)sender {
22+
- (IBAction)handleIncrement:(MDButton*)sender {
2223
[self.delegate didTapIncrementButton];
2324
}
2425

0 commit comments

Comments
 (0)