Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Migrate Linux example
  • Loading branch information
stuartmorgan-g committed Feb 17, 2021
commit edab05fa0e943bdcef999b4b977036c0b2bde42d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart=2.9

import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import 'package:path_provider_linux/path_provider_linux.dart';
Expand Down
16 changes: 8 additions & 8 deletions packages/path_provider/path_provider_linux/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
String _tempDirectory = 'Unknown';
String _downloadsDirectory = 'Unknown';
String _appSupportDirectory = 'Unknown';
String _documentsDirectory = 'Unknown';
String? _tempDirectory = 'Unknown';
String? _downloadsDirectory = 'Unknown';
String? _appSupportDirectory = 'Unknown';
String? _documentsDirectory = 'Unknown';
final PathProviderLinux _provider = PathProviderLinux();

@override
Expand All @@ -29,10 +29,10 @@ class _MyAppState extends State<MyApp> {

// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initDirectories() async {
String tempDirectory;
String downloadsDirectory;
String appSupportDirectory;
String documentsDirectory;
String? tempDirectory;
String? downloadsDirectory;
String? appSupportDirectory;
String? documentsDirectory;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
tempDirectory = await _provider.getTemporaryPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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:
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