fix: request storage permission only on Android
This commit is contained in:
parent
c9f8efc867
commit
db27f64e42
1 changed files with 4 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:io';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
@ -9,7 +10,9 @@ import 'note_list.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await Permission.storage.request();
|
if (Platform.isAndroid) {
|
||||||
|
await Permission.storage.request();
|
||||||
|
}
|
||||||
LicenseRegistry.addLicense(() async* {
|
LicenseRegistry.addLicense(() async* {
|
||||||
final license = await rootBundle.loadString('google_fonts/OFL.txt');
|
final license = await rootBundle.loadString('google_fonts/OFL.txt');
|
||||||
yield LicenseEntryWithLineBreaks(['google_fonts'], license);
|
yield LicenseEntryWithLineBreaks(['google_fonts'], license);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue