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

Commit 397cc63

Browse files
committed
Update the path-provider example
Make changes to the external storage directory component of the path provider platform.
1 parent 9502c3a commit 397cc63

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/path-provider/example/lib/main.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ class _MyHomePageState extends State<MyHomePage> {
6868

6969
void _requestExternalStorageDirectory() {
7070
setState(() {
71-
if (Platform.operatingSystem != "ios")
72-
_externalDocumentsDirectory = getExternalStorageDirectory();
71+
_externalDocumentsDirectory = getExternalStorageDirectory();
7372
});
7473
}
7574

@@ -113,16 +112,17 @@ class _MyHomePageState extends State<MyHomePage> {
113112
child: new FutureBuilder<Directory>(
114113
future: _appDocumentsDirectory, builder: _buildDirectory),
115114
),
116-
new Cloumn(
115+
new Column(
117116
children : <Widget>[
118117
new Padding(
119-
padding: const EdgeInserts.add(16.0),
118+
padding: const EdgeInsets.all(16.0),
120119
child: new RaisedButton(
121-
child: const Test('${Platform.operatingSystem != "ios" ?
122-
"Get External Storage Directory" :
123-
"External Directories are unavailable " +
124-
"on iOS"}'),
125-
onPressed: _requestExternalStorageDirectory,
120+
child: new Text('${Platform.isIOS ?
121+
"External directories are unavailable " +
122+
"on iOS":
123+
"Get External Storage Directory" }'),
124+
onPressed: Platform.isIOS ? null :
125+
_requestExternalStorageDirectory,
126126
),
127127
),
128128
]

0 commit comments

Comments
 (0)