diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index dfb2fa0..8816359 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -17,7 +17,7 @@ android:label="storage_path_example" android:icon="@mipmap/ic_launcher"> + + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" + /> + + + diff --git a/example/android/app/src/main/java/com/follow2vivek/storagepathexample/MainActivity.java b/example/android/app/src/main/java/com/follow2vivek/storagepathexample/MainActivity.java index 3137ab5..a31a601 100644 --- a/example/android/app/src/main/java/com/follow2vivek/storagepathexample/MainActivity.java +++ b/example/android/app/src/main/java/com/follow2vivek/storagepathexample/MainActivity.java @@ -1,13 +1,6 @@ package com.follow2vivek.storagepathexample; -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; +import io.flutter.embedding.android.FlutterActivity; public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } } diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml index 00fa441..b8dd23c 100644 --- a/example/android/app/src/main/res/values/styles.xml +++ b/example/android/app/src/main/res/values/styles.xml @@ -5,4 +5,9 @@ Flutter draws its first frame --> @drawable/launch_background + + + diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 53ae0ae..768bee6 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,4 @@ android.enableJetifier=true android.useAndroidX=true org.gradle.jvmargs=-Xmx1536M +android.enableR8=true \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart index 02513bf..1372de2 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,7 +1,8 @@ +import 'dart:async'; import 'dart:convert'; import 'dart:io'; + import 'package:flutter/material.dart'; -import 'dart:async'; import 'package:flutter/services.dart'; import 'package:storage_path/storage_path.dart'; import 'package:storage_path_example/file_model.dart'; @@ -15,6 +16,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { String imagePath = ""; + @override void initState() { super.initState(); @@ -30,7 +32,7 @@ class _MyAppState extends State { print(response); var imageList = response as List; List list = - imageList.map((json) => FileModel.fromJson(json)).toList(); + imageList.map((json) => FileModel.fromJson(json)).toList(); setState(() { imagePath = list[11].files[0]; @@ -52,7 +54,8 @@ class _MyAppState extends State { } return videoPath; } - Future getAudioPath() async { + + Future getAudioPath() async { String audioPath = ""; try { audioPath = await StoragePath.audioPath; @@ -63,7 +66,8 @@ class _MyAppState extends State { } return audioPath; } - Future getFilePath() async { + + Future getFilePath() async { String filePath = ""; try { filePath = await StoragePath.filePath; @@ -74,6 +78,7 @@ class _MyAppState extends State { } return filePath; } + @override Widget build(BuildContext context) { return MaterialApp( @@ -87,9 +92,9 @@ class _MyAppState extends State { height: 200, child: imagePath != "" ? Image.file( - File(imagePath), - fit: BoxFit.contain, - ) + File(imagePath), + fit: BoxFit.contain, + ) : Container(), ), ),