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
d6b1ad54
Commit
d6b1ad54
authored
May 09, 2017
by
Sarah Zakarias
Committed by
GitHub
May 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove url_lancher and path_provider from services (#9916)
parent
ee6cd679
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2 additions
and
129 deletions
+2
-129
services.dart
packages/flutter/lib/services.dart
+0
-2
path_provider.dart
packages/flutter/lib/src/services/path_provider.dart
+0
-44
url_launcher.dart
packages/flutter/lib/src/services/url_launcher.dart
+0
-22
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+2
-1
path_provider_test.dart
packages/flutter/test/services/path_provider_test.dart
+0
-40
url_launcher_test.dart
packages/flutter/test/services/url_launcher_test.dart
+0
-20
No files found.
packages/flutter/lib/services.dart
View file @
d6b1ad54
...
...
@@ -22,7 +22,6 @@ export 'src/services/image_resolution.dart';
export
'src/services/image_stream.dart'
;
export
'src/services/message_codec.dart'
;
export
'src/services/message_codecs.dart'
;
export
'src/services/path_provider.dart'
;
export
'src/services/platform_channel.dart'
;
export
'src/services/platform_messages.dart'
;
export
'src/services/raw_keyboard.dart'
;
...
...
@@ -33,4 +32,3 @@ export 'src/services/system_sound.dart';
export
'src/services/text_editing.dart'
;
export
'src/services/text_formatter.dart'
;
export
'src/services/text_input.dart'
;
export
'src/services/url_launcher.dart'
;
packages/flutter/lib/src/services/path_provider.dart
deleted
100644 → 0
View file @
ee6cd679
// 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:io'
;
import
'system_channels.dart'
;
/// Returns commonly used locations on the filesystem.
class
PathProvider
{
PathProvider
.
_
();
/// Path to the temporary directory on the device.
///
/// Files in this directory may be cleared at any time. This does *not* return
/// a new temporary directory. Instead, the caller is responsible for creating
/// (and cleaning up) files or directories within this directory. This
/// directory is scoped to the calling application.
///
/// On iOS, this uses the `NSTemporaryDirectory` API.
///
/// On Android, this uses the `getCacheDir` API on the context.
static
Future
<
Directory
>
getTemporaryDirectory
()
async
{
final
String
path
=
await
SystemChannels
.
platform
.
invokeMethod
(
'PathProvider.getTemporaryDirectory'
);
if
(
path
==
null
)
return
null
;
return
new
Directory
(
path
);
}
/// Path to a directory where the application may place files that are private
/// to the application and will only be cleared when the application itself
/// is deleted.
///
/// On iOS, this uses the `NSDocumentsDirectory` API.
///
/// On Android, this returns the AppData directory.
static
Future
<
Directory
>
getApplicationDocumentsDirectory
()
async
{
final
String
path
=
await
SystemChannels
.
platform
.
invokeMethod
(
'PathProvider.getApplicationDocumentsDirectory'
);
if
(
path
==
null
)
return
null
;
return
new
Directory
(
path
);
}
}
packages/flutter/lib/src/services/url_launcher.dart
deleted
100644 → 0
View file @
ee6cd679
// 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
'system_channels.dart'
;
/// Allows applications to delegate responsbility of handling certain URLs to
/// the underlying platform.
class
UrlLauncher
{
UrlLauncher
.
_
();
/// Parse the specified URL string and delegate handling of the same to the
/// underlying platform.
static
Future
<
Null
>
launch
(
String
urlString
)
async
{
await
SystemChannels
.
platform
.
invokeMethod
(
'UrlLauncher.launch'
,
urlString
,
);
}
}
packages/flutter/lib/src/widgets/framework.dart
View file @
d6b1ad54
...
...
@@ -886,7 +886,8 @@ abstract class State<T extends StatefulWidget> {
/// setState(() {
/// _counter++;
/// });
/// final String dir = await PathProvider.getApplicationDocumentsDirectory();
/// Directory directory = await getApplicationDocumentsDirectory();
/// final String dirName = directory.path;
/// await new File('$dir/counter.txt').writeAsString('$_counter');
/// return null;
/// }
...
...
packages/flutter/test/services/path_provider_test.dart
deleted
100644 → 0
View file @
ee6cd679
// 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:io'
;
import
'package:flutter/services.dart'
;
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
'Path provider control test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
String
response
;
SystemChannels
.
platform
.
setMockMethodCallHandler
((
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
response
;
});
Directory
directory
=
await
PathProvider
.
getTemporaryDirectory
();
expect
(
log
,
equals
(<
MethodCall
>[
new
MethodCall
(
'PathProvider.getTemporaryDirectory'
)]));
expect
(
directory
,
isNull
);
log
.
clear
();
directory
=
await
PathProvider
.
getApplicationDocumentsDirectory
();
expect
(
log
,
equals
(<
MethodCall
>[
new
MethodCall
(
'PathProvider.getApplicationDocumentsDirectory'
)]));
expect
(
directory
,
isNull
);
final
String
fakePath
=
"/foo/bar/baz"
;
response
=
fakePath
;
directory
=
await
PathProvider
.
getTemporaryDirectory
();
expect
(
directory
.
path
,
equals
(
fakePath
));
directory
=
await
PathProvider
.
getApplicationDocumentsDirectory
();
expect
(
directory
.
path
,
equals
(
fakePath
));
});
}
packages/flutter/test/services/url_launcher_test.dart
deleted
100644 → 0
View file @
ee6cd679
// 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
'package:flutter/services.dart'
;
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
'URL launcher control test'
,
()
async
{
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
SystemChannels
.
platform
.
setMockMethodCallHandler
((
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
});
await
UrlLauncher
.
launch
(
'http://example.com/'
);
expect
(
log
,
equals
(<
MethodCall
>[
new
MethodCall
(
'UrlLauncher.launch'
,
'http://example.com/'
)]));
});
}
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