skip to Main Content

Flutter – Download a local file

Imagine I have created a File (import 'dart:io). I need the user to download the file (to their Download or Documents directory). This is how I create the file. getApplicationDocumentsDirectory() is from permission_handler. final dir = await getApplicationDocumentsDirectory(); final file…

VIEW QUESTION

flutter custom textheme variables

I am coding a dark and light theme. And I want to use custom textTheme inside themeDatas. I created the textthemes but not with my own variable names. How to create TextStyle with my own variable names. ThemeData darkTheme =…

VIEW QUESTION

Flutter – await Firebase.initializeApp(); causes error first time working but after my computer down and on not working

void main() async { WidgetsFlutterBinding.ensureInitialized(); if (kIsWeb) { await Firebase.initializeApp( options: const FirebaseOptions( apiKey: "", appId: "", messagingSenderId: "", projectId: "", storageBucket: "", ), ); } else { await Firebase.initializeApp(); } runApp(const MyApp()); } Exception has occurred. PlatformException (PlatformException(channel-error, Unable…

VIEW QUESTION

Flutter: OpenFile.open("file_path") not working, giving Permission denied: android.permission.READ_EXTERNAL_STORAGE on android 13

Tried to open .pdf file like ElevatedButton( onPressed: () async { await OpenFile.open('/storage/emulated/0/Download/myqr.pdf') .then((value) { log(value.message.toString()); }); }, child: const Text("Open File"), ) But not working. It gives error: Permission denied: android.permission.READ_EXTERNAL_STORAGE Already added permisions in AndroidMenifest.xml <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />…

VIEW QUESTION
Back To Top
Search