Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[path_provider_linux] Migrate to null safety #3330

Merged
merged 11 commits into from
Feb 3, 2021
4 changes: 4 additions & 0 deletions packages/path_provider/path_provider_linux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0-nullsafety

* Migrate to null safety.

## 0.1.1+3

* Update Flutter SDK constraint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ description: Demonstrates how to use the path_provider_linux plugin.
publish_to: "none"

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"

dependencies:
flutter:
sdk: flutter

path_provider: ^1.6.10
path_provider: ^1.6.24

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
cupertino_icons: ^1.0.1+1

dependency_overrides:
yash1200 marked this conversation as resolved.
Show resolved Hide resolved
path_provider_linux:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void main() {
find.byWidgetPredicate(
(Widget widget) =>
widget is Text &&
widget.data.startsWith('Temp Directory: /tmp'),
widget.data!.startsWith('Temp Directory: /tmp'),
),
findsOneWidget,
);
Expand All @@ -48,7 +48,7 @@ void main() {
find.byWidgetPredicate(
(Widget widget) =>
widget is Text &&
widget.data.startsWith('Documents Directory: /'),
widget.data!.startsWith('Documents Directory: /'),
),
findsOneWidget,
);
Expand All @@ -66,7 +66,7 @@ void main() {
find.byWidgetPredicate(
(Widget widget) =>
widget is Text &&
widget.data.startsWith('Downloads Directory: /'),
widget.data!.startsWith('Downloads Directory: /'),
),
findsOneWidget,
);
Expand All @@ -85,7 +85,7 @@ void main() {
find.byWidgetPredicate(
(Widget widget) =>
widget is Text &&
widget.data.startsWith('Application Support Directory: /'),
widget.data!.startsWith('Application Support Directory: /'),
),
findsOneWidget,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class PathProviderLinux extends PathProviderPlatform {
}

@override
Future<String> getTemporaryPath() {
Future<String?> getTemporaryPath() {
return Future.value("/tmp");
}

@override
Future<String> getApplicationSupportPath() async {
Future<String?> getApplicationSupportPath() async {
final processName = path.basenameWithoutExtension(
await File('/proc/self/exe').resolveSymbolicLinks());
final directory = Directory(path.join(xdg.dataHome.path, processName));
Expand All @@ -35,12 +35,12 @@ class PathProviderLinux extends PathProviderPlatform {
}

@override
Future<String> getApplicationDocumentsPath() {
Future<String?> getApplicationDocumentsPath() {
return Future.value(xdg.getUserDirectory('DOCUMENTS').path);
}

@override
Future<String> getDownloadsPath() {
Future<String?> getDownloadsPath() {
return Future.value(xdg.getUserDirectory('DOWNLOAD').path);
}
}
10 changes: 5 additions & 5 deletions packages/path_provider/path_provider_linux/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: path_provider_linux
description: linux implementation of the path_provider plugin
version: 0.1.1+3
version: 1.0.0-nullsafety
yash1200 marked this conversation as resolved.
Show resolved Hide resolved
homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_linux

flutter:
Expand All @@ -11,17 +11,17 @@ flutter:
pluginClass: none

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
flutter: ">=1.10.0"

dependencies:
path: ^1.6.4
path: ^1.8.0-nullsafety.3
xdg_directories: ^0.1.0
yash1200 marked this conversation as resolved.
Show resolved Hide resolved
path_provider_platform_interface: ^1.0.1
path_provider_platform_interface: ^2.0.0-nullsafety
flutter:
sdk: flutter

dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.8.0
pedantic: ^1.10.0-nullsafety.1