Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
df3a3657
Commit
df3a3657
authored
Mar 24, 2017
by
Sarah Zakarias
Committed by
GitHub
Mar 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove hello_services sample (#8995)
parent
47fc81f1
Changes
30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
0 additions
and
1360 deletions
+0
-1360
.gitignore
examples/hello_services/.gitignore
+0
-8
modules.xml
examples/hello_services/.idea/modules.xml
+0
-8
hello_services.xml
...hello_services/.idea/runConfigurations/hello_services.xml
+0
-6
README.md
examples/hello_services/README.md
+0
-69
.gitignore
examples/hello_services/android/.gitignore
+0
-12
.gitignore
examples/hello_services/android/app/.gitignore
+0
-1
build.gradle
examples/hello_services/android/app/build.gradle
+0
-46
ExampleInstrumentedTest.java
...est/java/com/example/flutter/ExampleInstrumentedTest.java
+0
-137
AndroidManifest.xml
...s/hello_services/android/app/src/main/AndroidManifest.xml
+0
-26
ExampleActivity.java
...pp/src/main/java/com/example/flutter/ExampleActivity.java
+0
-121
hello_services_layout.xml
...android/app/src/main/res/layout/hello_services_layout.xml
+0
-39
strings.xml
...ello_services/android/app/src/main/res/values/strings.xml
+0
-6
build.gradle
examples/hello_services/android/build.gradle
+0
-23
gradle.properties
examples/hello_services/android/gradle.properties
+0
-1
settings.gradle
examples/hello_services/android/settings.gradle
+0
-1
hello_services.iml
examples/hello_services/hello_services.iml
+0
-15
.gitignore
examples/hello_services/ios/.gitignore
+0
-38
AppFrameworkInfo.plist
examples/hello_services/ios/Flutter/AppFrameworkInfo.plist
+0
-30
Flutter.xcconfig
examples/hello_services/ios/Flutter/Flutter.xcconfig
+0
-1
project.pbxproj
examples/hello_services/ios/Runner.xcodeproj/project.pbxproj
+0
-415
contents.xcworkspacedata
...er.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+0
-7
AppDelegate.h
examples/hello_services/ios/Runner/AppDelegate.h
+0
-10
AppDelegate.m
examples/hello_services/ios/Runner/AppDelegate.m
+0
-38
Contents.json
...s/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
+0
-93
LaunchScreen.storyboard
...lo_services/ios/Runner/Base.lproj/LaunchScreen.storyboard
+0
-31
Main.storyboard
...ples/hello_services/ios/Runner/Base.lproj/Main.storyboard
+0
-30
Info.plist
examples/hello_services/ios/Runner/Info.plist
+0
-47
main.m
examples/hello_services/ios/Runner/main.m
+0
-14
main.dart
examples/hello_services/lib/main.dart
+0
-75
pubspec.yaml
examples/hello_services/pubspec.yaml
+0
-12
No files found.
examples/hello_services/.gitignore
deleted
100644 → 0
View file @
47fc81f1
.DS_Store
.atom/
.idea
.packages
.pub/
build/
packages/
pubspec.lock
examples/hello_services/.idea/modules.xml
deleted
100644 → 0
View file @
47fc81f1
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/hello_services.iml"
filepath=
"$PROJECT_DIR$/.idea/hello_services.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
examples/hello_services/.idea/runConfigurations/hello_services.xml
deleted
100644 → 0
View file @
47fc81f1
<component
name=
"ProjectRunConfigurationManager"
>
<configuration
default=
"false"
name=
"hello_services"
type=
"FlutterRunConfigurationType"
factoryName=
"Flutter"
>
<option
name=
"filePath"
value=
"$PROJECT_DIR$/lib/main.dart"
/>
<method
/>
</configuration>
</component>
examples/hello_services/README.md
deleted
100644 → 0
View file @
47fc81f1
# Example of embedding Flutter using FlutterView
This project demonstrates how to embed Flutter within an iOS or Android
application. On iOS, the iOS and Flutter components are built with Xcode. On
Android, the Android and Flutter components are built with Android Studio or
gradle.
You can read more about
[
accessing platform and third-party services in Flutter
](
https://flutter.io/platform-services/
)
.
## iOS
### Configure
Create an
`ios/Flutter/Generated.xcconfig`
file with this entry:
*
`FLUTTER_ROOT=[absolute path to the Flutter SDK]`
There are a number of other parameters you can control with this file:
*
`FLUTTER_APPLICATION_PATH`
: The path to the directory that contains your
`pubspec.yaml`
file relative to your
`xcodeproj`
file.
*
`FLUTTER_BUILD_MODE`
: Whether to build for
`debug`
,
`profile`
, or
`release`
.
Defaults to
`release`
.
*
`FLUTTER_TARGET`
: The path to your
`main.dart`
relative to your
`pubspec.yaml`
. Defaults to
`lib/main.dart`
.
*
`FLUTTER_FRAMEWORK_DIR`
: The absolute path to the directory that contains
`Flutter.framework`
. Defaults to the
`ios-release`
version of
`Flutter.framework`
in the
`bin/cache`
directory of the Flutter SDK.
### Build
Once you've configured your project, you can open
`ios/HelloServices.xcodeproj`
in Xcode and build the project as usual.
## Android
### Configure
Create an
`android/local.properties`
file with these entries:
*
`sdk.dir=[path to the Android SDK]`
*
`flutter.sdk=[path to the Flutter SDK]`
There are a number of other parameters you can control with this file:
*
`flutter.buildMode`
: Whether to build for
`debug`
,
`profile`
, or
`release`
.
Defaults to
`release`
.
*
`flutter.jar`
: The path to
`flutter.jar`
. Defaults to the
`android-arm-release`
version of
`flutter.jar`
in the
`bin/cache`
directory
of the Flutter SDK.
See
`android/app/build.gradle`
for project specific settings, including:
*
`source`
: The path to the directory that contains your
`pubspec.yaml`
file
relative to your
`build.gradle`
file.
*
`target`
: The path to your
`main.dart`
relative to your
`pubspec.yaml`
.
Defaults to
`lib/main.dart`
.
### Build
To build directly with
`gradle`
, use the following commands:
*
`cd android`
*
`gradle wrapper`
*
`./gradlew build`
To build with Android Studio, open the
`android`
folder in Android Studio and
build the project as usual.
examples/hello_services/android/.gitignore
deleted
100644 → 0
View file @
47fc81f1
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
/gradle
/gradlew
/gradlew.bat
examples/hello_services/android/app/.gitignore
deleted
100644 → 0
View file @
47fc81f1
/build
examples/hello_services/android/app/build.gradle
deleted
100644 → 0
View file @
47fc81f1
def
localProperties
=
new
Properties
()
def
localPropertiesFile
=
rootProject
.
file
(
'local.properties'
)
if
(
localPropertiesFile
.
exists
())
{
localPropertiesFile
.
withInputStream
{
stream
->
localProperties
.
load
(
stream
)
}
}
def
flutterRoot
=
localProperties
.
getProperty
(
'flutter.sdk'
)
if
(
flutterRoot
==
null
)
{
throw
new
GradleException
(
"Flutter SDK not found. Define location with flutter.sdk in the local.properties file."
)
}
apply
plugin:
'com.android.application'
apply
from:
"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android
{
compileSdkVersion
25
buildToolsVersion
'25.0.2'
lintOptions
{
disable
'InvalidPackage'
}
defaultConfig
{
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes
{
release
{
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig
signingConfigs
.
debug
}
}
}
flutter
{
source
'../..'
}
dependencies
{
androidTestCompile
'com.android.support:support-annotations:25.0.0'
androidTestCompile
'com.android.support.test:runner:0.5'
androidTestCompile
'com.android.support.test:rules:0.5'
}
examples/hello_services/android/app/src/androidTest/java/com/example/flutter/ExampleInstrumentedTest.java
deleted
100644 → 0
View file @
47fc81f1
package
com
.
example
.
flutter
;
import
android.app.Instrumentation
;
import
android.graphics.Bitmap
;
import
android.support.test.InstrumentationRegistry
;
import
android.support.test.rule.ActivityTestRule
;
import
android.support.test.runner.AndroidJUnit4
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
java.util.Arrays
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
io.flutter.plugin.common.FlutterMethodChannel
;
import
io.flutter.view.FlutterView
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
junit
.
Assert
.
fail
;
@RunWith
(
AndroidJUnit4
.
class
)
public
class
ExampleInstrumentedTest
{
@Rule
public
ActivityTestRule
<
ExampleActivity
>
activityRule
=
new
ActivityTestRule
<>(
ExampleActivity
.
class
);
@Test
public
void
testFlutterMessage
()
{
final
Instrumentation
instr
=
InstrumentationRegistry
.
getInstrumentation
();
final
int
RANDOM_MIN
=
1
;
final
int
RANDOM_MAX
=
1000
;
final
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
final
AtomicInteger
random
=
new
AtomicInteger
();
instr
.
runOnMainSync
(
new
Runnable
()
{
public
void
run
()
{
final
FlutterView
flutterView
=
(
FlutterView
)
activityRule
.
getActivity
().
findViewById
(
R
.
id
.
flutter_view
);
final
FlutterMethodChannel
randomChannel
=
new
FlutterMethodChannel
(
flutterView
,
"random"
);
randomChannel
.
invokeMethod
(
"getRandom"
,
Arrays
.
asList
(
RANDOM_MIN
,
RANDOM_MAX
),
new
FlutterMethodChannel
.
Response
()
{
@Override
public
void
success
(
Object
o
)
{
random
.
set
(((
Number
)
o
).
intValue
());
latch
.
countDown
();
}
@Override
public
void
error
(
String
code
,
String
message
,
Object
details
)
{
}
});
}
});
try
{
assertTrue
(
latch
.
await
(
2
,
TimeUnit
.
SECONDS
));
}
catch
(
InterruptedException
e
)
{
fail
(
e
.
getMessage
());
}
assertTrue
(
random
.
get
()
>=
RANDOM_MIN
);
assertTrue
(
random
.
get
()
<
RANDOM_MAX
);
}
@Test
public
void
testBitmap
()
{
final
Instrumentation
instr
=
InstrumentationRegistry
.
getInstrumentation
();
final
BitmapPoller
poller
=
new
BitmapPoller
(
5
);
instr
.
runOnMainSync
(
new
Runnable
()
{
public
void
run
()
{
final
FlutterView
flutterView
=
(
FlutterView
)
activityRule
.
getActivity
().
findViewById
(
R
.
id
.
flutter_view
);
// Call onPostResume to start the engine's renderer even if the activity
// is paused in the test environment.
flutterView
.
onPostResume
();
poller
.
start
(
flutterView
);
}
});
Bitmap
bitmap
=
null
;
try
{
bitmap
=
poller
.
waitForBitmap
();
}
catch
(
InterruptedException
e
)
{
fail
(
e
.
getMessage
());
}
assertNotNull
(
bitmap
);
assertTrue
(
bitmap
.
getWidth
()
>
0
);
assertTrue
(
bitmap
.
getHeight
()
>
0
);
// Check that a pixel matches the default Material background color.
assertTrue
(
bitmap
.
getPixel
(
bitmap
.
getWidth
()
-
1
,
bitmap
.
getHeight
()
-
1
)
==
0xFFFAFAFA
);
}
// Waits on a FlutterView until it is able to produce a bitmap.
private
class
BitmapPoller
{
private
final
int
delayMsec
=
1000
;
private
int
triesPending
;
private
int
waitMsec
;
private
FlutterView
flutterView
;
private
Bitmap
bitmap
;
private
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
private
Runnable
checkBitmap
=
new
Runnable
()
{
public
void
run
()
{
bitmap
=
flutterView
.
getBitmap
();
triesPending
--;
if
(
bitmap
!=
null
||
triesPending
==
0
)
{
latch
.
countDown
();
}
else
{
flutterView
.
postDelayed
(
checkBitmap
,
delayMsec
);
}
}
};
BitmapPoller
(
int
tries
)
{
triesPending
=
tries
;
waitMsec
=
delayMsec
*
tries
+
100
;
}
void
start
(
FlutterView
flutterView
)
{
this
.
flutterView
=
flutterView
;
flutterView
.
postDelayed
(
checkBitmap
,
delayMsec
);
}
Bitmap
waitForBitmap
()
throws
InterruptedException
{
latch
.
await
(
waitMsec
,
TimeUnit
.
MILLISECONDS
);
return
bitmap
;
}
}
}
examples/hello_services/android/app/src/main/AndroidManifest.xml
deleted
100644 → 0
View file @
47fc81f1
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.example.flutter"
android:versionCode=
"1"
android:versionName=
"1.0.0"
>
<uses-sdk
android:minSdkVersion=
"16"
android:targetSdkVersion=
"22"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<application
android:name=
"io.flutter.app.FlutterApplication"
android:label=
"@string/app_name"
>
<activity
android:name=
".ExampleActivity"
android:launchMode=
"singleTop"
android:theme=
"@android:style/Theme.Black.NoTitleBar"
android:configChanges=
"orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated=
"true"
android:windowSoftInputMode=
"adjustResize"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</application>
</manifest>
examples/hello_services/android/app/src/main/java/com/example/flutter/ExampleActivity.java
deleted
100644 → 0
View file @
47fc81f1
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
com
.
example
.
flutter
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.pm.PackageManager
;
import
android.location.Location
;
import
android.location.LocationManager
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
io.flutter.plugin.common.FlutterMethodChannel
;
import
io.flutter.plugin.common.MethodCall
;
import
io.flutter.view.FlutterMain
;
import
io.flutter.view.FlutterView
;
import
java.util.Arrays
;
public
class
ExampleActivity
extends
Activity
{
private
static
final
String
TAG
=
"ExampleActivity"
;
private
FlutterView
flutterView
;
private
FlutterMethodChannel
randomChannel
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
FlutterMain
.
ensureInitializationComplete
(
getApplicationContext
(),
null
);
setContentView
(
R
.
layout
.
hello_services_layout
);
flutterView
=
(
FlutterView
)
findViewById
(
R
.
id
.
flutter_view
);
flutterView
.
runFromBundle
(
FlutterMain
.
findAppBundlePath
(
getApplicationContext
()),
null
);
FlutterMethodChannel
locationChannel
=
new
FlutterMethodChannel
(
flutterView
,
"location"
);
randomChannel
=
new
FlutterMethodChannel
(
flutterView
,
"random"
);
locationChannel
.
setMethodCallHandler
(
new
FlutterMethodChannel
.
MethodCallHandler
()
{
@Override
public
void
onMethodCall
(
MethodCall
methodCall
,
FlutterMethodChannel
.
Response
response
)
{
if
(
methodCall
.
method
.
equals
(
"getLocation"
))
{
getLocation
((
String
)
methodCall
.
arguments
,
response
);
}
else
{
response
.
error
(
"unknown method"
,
"Unknown method: "
+
methodCall
.
method
,
null
);
}
}
});
Button
getRandom
=
(
Button
)
findViewById
(
R
.
id
.
get_random
);
getRandom
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
getRandom
();
}
});
}
@Override
protected
void
onDestroy
()
{
if
(
flutterView
!=
null
)
{
flutterView
.
destroy
();
}
super
.
onDestroy
();
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
flutterView
.
onPause
();
}
@Override
protected
void
onPostResume
()
{
super
.
onPostResume
();
flutterView
.
onPostResume
();
}
private
void
getRandom
()
{
randomChannel
.
invokeMethod
(
"getRandom"
,
Arrays
.
asList
(
1
,
1000
),
new
FlutterMethodChannel
.
Response
()
{
TextView
textView
=
(
TextView
)
findViewById
(
R
.
id
.
random_value
);
@Override
public
void
success
(
Object
result
)
{
textView
.
setText
(
result
.
toString
());
}
@Override
public
void
error
(
String
code
,
String
message
,
Object
details
)
{
textView
.
setText
(
"Error: "
+
message
);
}
});
}
private
void
getLocation
(
String
provider
,
FlutterMethodChannel
.
Response
response
)
{
String
locationProvider
;
if
(
provider
.
equals
(
"network"
))
{
locationProvider
=
LocationManager
.
NETWORK_PROVIDER
;
}
else
if
(
provider
.
equals
(
"gps"
))
{
locationProvider
=
LocationManager
.
GPS_PROVIDER
;
}
else
{
response
.
error
(
"unknown provider"
,
"Unknown location provider: "
+
provider
,
null
);
return
;
}
String
permission
=
"android.permission.ACCESS_FINE_LOCATION"
;
if
(
checkCallingOrSelfPermission
(
permission
)
==
PackageManager
.
PERMISSION_GRANTED
)
{
LocationManager
locationManager
=
(
LocationManager
)
getSystemService
(
Context
.
LOCATION_SERVICE
);
Location
location
=
locationManager
.
getLastKnownLocation
(
locationProvider
);
if
(
location
!=
null
)
{
response
.
success
(
Arrays
.
asList
(
location
.
getLatitude
(),
location
.
getLongitude
()));
}
else
{
response
.
error
(
"location unavailable"
,
"Location is not available"
,
null
);
}
}
else
{
response
.
error
(
"access error"
,
"Location permissions not granted"
,
null
);
}
}
}
examples/hello_services/android/app/src/main/res/layout/hello_services_layout.xml
deleted
100644 → 0
View file @
47fc81f1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
>
<TextView
android:id=
"@+id/text_view"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/title"
/>
<LinearLayout
android:orientation=
"horizontal"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
>
<Button
android:id=
"@+id/get_random"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/get_random"
/>
<TextView
android:id=
"@+id/random_value"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
<io.flutter.view.FlutterView
android:id=
"@+id/flutter_view"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
/>
</LinearLayout>
examples/hello_services/android/app/src/main/res/values/strings.xml
deleted
100644 → 0
View file @
47fc81f1
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name=
"app_name"
>
Hello Services
</string>
<string
name=
"title"
>
Flutter Application
</string>
<string
name=
"get_random"
>
Get Random Number
</string>
</resources>
examples/hello_services/android/build.gradle
deleted
100644 → 0
View file @
47fc81f1
buildscript
{
repositories
{
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.2.3'
}
}
allprojects
{
repositories
{
jcenter
()
}
}
task
clean
(
type:
Delete
)
{
delete
rootProject
.
buildDir
}
task
wrapper
(
type:
Wrapper
)
{
gradleVersion
=
'2.14.1'
}
examples/hello_services/android/gradle.properties
deleted
100644 → 0
View file @
47fc81f1
org.gradle.jvmargs
=
-Xmx1536M
examples/hello_services/android/settings.gradle
deleted
100644 → 0
View file @
47fc81f1
include
':app'
examples/hello_services/hello_services.iml
deleted
100644 → 0
View file @
47fc81f1
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"FLUTTER_MODULE_TYPE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<exclude-output
/>
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/.idea"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/.pub"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/packages"
/>
</content>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"Dart SDK"
level=
"application"
/>
<orderEntry
type=
"library"
name=
"Dart Packages"
level=
"project"
/>
</component>
</module>
\ No newline at end of file
examples/hello_services/ios/.gitignore
deleted
100644 → 0
View file @
47fc81f1
.idea/
.vagrant/
.sconsign.dblite
.svn/
.DS_Store
*.swp
*.lock
profile
DerivedData/
build/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
*.pyc
*sync/
Icon?
.tags*
/Flutter/app.flx
/Flutter/app.zip
/Flutter/App.framework
/Flutter/Flutter.framework
/Flutter/Generated.xcconfig
/ServiceDefinitions.json
examples/hello_services/ios/Flutter/AppFrameworkInfo.plist
deleted
100644 → 0
View file @
47fc81f1
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
App
<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
io.flutter.flutter.app
<
/string
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
App
<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
FMWK
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
UIRequiredDeviceCapabilities
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
arm64
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
MinimumOSVersion
<
/k
e
y
>
<
string
>
8.0
<
/string
>
<
/
d
i
c
t
>
<
/plist
>
examples/hello_services/ios/Flutter/Flutter.xcconfig
deleted
100644 → 0
View file @
47fc81f1
#include "Generated.xcconfig"
examples/hello_services/ios/Runner.xcodeproj/project.pbxproj
deleted
100644 → 0
View file @
47fc81f1
This diff is collapsed.
Click to expand it.
examples/hello_services/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted
100644 → 0
View file @
47fc81f1
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version =
"1.0"
>
<FileRef
location =
"self:HelloServices.xcodeproj"
>
</FileRef>
</Workspace>
examples/hello_services/ios/Runner/AppDelegate.h
deleted
100644 → 0
View file @
47fc81f1
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <UIKit/UIKit.h>
#import <Flutter/Flutter.h>
@interface
AppDelegate
:
FlutterAppDelegate
@end
examples/hello_services/ios/Runner/AppDelegate.m
deleted
100644 → 0
View file @
47fc81f1
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "AppDelegate.h"
#import <Flutter/Flutter.h>
#import <CoreLocation/CoreLocation.h>
@implementation
AppDelegate
{
CLLocationManager
*
_locationManager
;
}
-
(
BOOL
)
application
:
(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:
(
NSDictionary
*
)
launchOptions
{
FlutterViewController
*
controller
=
(
FlutterViewController
*
)
self
.
window
.
rootViewController
;
FlutterMethodChannel
*
locationChannel
=
[
FlutterMethodChannel
methodChannelNamed
:
@"location"
binaryMessenger
:
controller
codec
:
[
FlutterStandardMethodCodec
sharedInstance
]];
[
locationChannel
setMethodCallHandler
:
^
(
FlutterMethodCall
*
call
,
FlutterResultReceiver
result
)
{
if
([
@"getLocation"
isEqualToString
:
call
.
method
])
{
if
(
_locationManager
==
nil
)
{
_locationManager
=
[[
CLLocationManager
alloc
]
init
];
[
_locationManager
startMonitoringSignificantLocationChanges
];
}
CLLocation
*
location
=
_locationManager
.
location
;
result
(@[
@
(
location
.
coordinate
.
latitude
),
@
(
location
.
coordinate
.
longitude
)],
nil
);
}
else
{
result
(
nil
,
[
FlutterError
errorWithCode
:
@"unknown method"
message
:
@"Unknown location method called"
details:
nil
]);
}
}];
return
YES
;
}
@end
examples/hello_services/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted
100644 → 0
View file @
47fc81f1
{
"images"
:
[
{
"idiom"
:
"iphone"
,
"size"
:
"20x20"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"20x20"
,
"scale"
:
"3x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"29x29"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"29x29"
,
"scale"
:
"3x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"40x40"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"40x40"
,
"scale"
:
"3x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"60x60"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"60x60"
,
"scale"
:
"3x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"20x20"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"20x20"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"29x29"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"29x29"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"40x40"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"40x40"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"76x76"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"76x76"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"83.5x83.5"
,
"scale"
:
"2x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
examples/hello_services/ios/Runner/Base.lproj/LaunchScreen.storyboard
deleted
100644 → 0
View file @
47fc81f1
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"11762"
systemVersion=
"16D32"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
launchScreen=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"01J-lp-oVM"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"11757"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<scenes>
<!--View Controller-->
<scene
sceneID=
"EHf-IW-A2E"
>
<objects>
<viewController
id=
"01J-lp-oVM"
sceneMemberID=
"viewController"
>
<layoutGuides>
<viewControllerLayoutGuide
type=
"top"
id=
"Llm-lL-Icb"
/>
<viewControllerLayoutGuide
type=
"bottom"
id=
"xb3-aO-Qok"
/>
</layoutGuides>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"Ze5-6b-2t3"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"667"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</view>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"iYj-Kq-Ea1"
userLabel=
"First Responder"
sceneMemberID=
"firstResponder"
/>
</objects>
<point
key=
"canvasLocation"
x=
"53"
y=
"375"
/>
</scene>
</scenes>
</document>
examples/hello_services/ios/Runner/Base.lproj/Main.storyboard
deleted
100644 → 0
View file @
47fc81f1
<?xml version="1.0" encoding="UTF-8"?>
<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=
"BYZ-38-t0r"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"11757"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<scenes>
<!--View Controller-->
<scene
sceneID=
"tne-QT-ifu"
>
<objects>
<viewController
id=
"BYZ-38-t0r"
customClass=
"FlutterViewController"
sceneMemberID=
"viewController"
>
<layoutGuides>
<viewControllerLayoutGuide
type=
"top"
id=
"y3c-jy-aDJ"
/>
<viewControllerLayoutGuide
type=
"bottom"
id=
"wfy-db-euE"
/>
</layoutGuides>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"8bC-Xf-vdC"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"667"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
</view>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"dkx-z0-nzr"
sceneMemberID=
"firstResponder"
/>
</objects>
</scene>
</scenes>
</document>
examples/hello_services/ios/Runner/Info.plist
deleted
100644 → 0
View file @
47fc81f1
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
(
EXECUTABLE_NAME
)<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
$
(
PRODUCT_BUNDLE_IDENTIFIER
)<
/string
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
HelloServices
<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1
<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
UILaunchStoryboardName
<
/k
e
y
>
<
string
>
LaunchScreen
<
/string
>
<
k
e
y
>
UIMainStoryboardFile
<
/k
e
y
>
<
string
>
Main
<
/string
>
<
k
e
y
>
UIRequiredDeviceCapabilities
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
armv7
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
~
ipad
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationPortraitUpsideDown
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/plist
>
examples/hello_services/ios/Runner/main.m
deleted
100644 → 0
View file @
47fc81f1
//
Copyright
2016
The
Chromium
Authors
.
All
rights
reserved
.
//
Use
of
this
source
code
is
governed
by
a
BSD
-
style
license
that
can
be
//
found
in
the
LICENSE
file
.
#import
<
UIKit
/
UIKit
.
h
>
#import
<
Flutter
/
Flutter
.
h
>
#import
"AppDelegate.h"
int
main
(
int
argc
,
char
*
argv
[])
{
@
autoreleasepool
{
return
UIApplicationMain
(
argc
,
argv
,
nil
,
NSStringFromClass
([
AppDelegate
class
]))
;
}
}
examples/hello_services/lib/main.dart
deleted
100644 → 0
View file @
47fc81f1
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:math'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
final
Random
random
=
new
Random
();
final
PlatformMethodChannel
randomChannel
=
new
PlatformMethodChannel
(
'random'
);
Future
<
dynamic
>
handleGetRandom
(
MethodCall
call
)
async
{
if
(
call
.
method
==
'getRandom'
)
{
final
int
min
=
call
.
arguments
[
0
];
final
int
max
=
call
.
arguments
[
1
];
return
random
.
nextInt
(
max
-
min
)
+
min
;
}
}
class
HelloServices
extends
StatefulWidget
{
@override
_HelloServicesState
createState
()
=>
new
_HelloServicesState
();
}
class
_HelloServicesState
extends
State
<
HelloServices
>
{
static
PlatformMethodChannel
locationChannel
=
new
PlatformMethodChannel
(
'location'
);
String
_location
=
'Press button to get location'
;
@override
Widget
build
(
BuildContext
context
)
{
return
new
Material
(
child:
new
Center
(
child:
new
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
<
Widget
>[
new
Text
(
'Hello from Flutter!'
),
new
RaisedButton
(
child:
new
Text
(
'Get Location'
),
onPressed:
_getLocation
,
),
new
Text
(
_location
),
],
),
),
);
}
Future
<
Null
>
_getLocation
()
async
{
String
location
;
try
{
final
List
<
double
>
reply
=
await
locationChannel
.
invokeMethod
(
'getLocation'
,
'network'
,
);
location
=
'Latitude:
${reply[0]}
, Longitude:
${reply[1]}
'
;
}
on
PlatformException
catch
(
e
)
{
location
=
'Error: '
+
e
.
message
;
}
// If the widget was removed from the tree while the message was in flight,
// we want to discard the reply rather than calling setState to update our
// non-existent appearance.
if
(!
mounted
)
return
;
setState
(()
{
_location
=
location
;
});
}
}
void
main
(
)
{
runApp
(
new
HelloServices
());
randomChannel
.
setMethodCallHandler
(
handleGetRandom
);
}
examples/hello_services/pubspec.yaml
deleted
100644 → 0
View file @
47fc81f1
name
:
hello_services
dependencies
:
flutter
:
sdk
:
flutter
dev_dependencies
:
flutter_test
:
sdk
:
flutter
flutter
:
uses-material-design
:
true
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment