A lightweight Flutter app to provide a simple, reliable mobile UI for authenticated users to pick, upload, and preview media files while handling async operations safely and showing clear feedback.
Short-Soulful-Drive-1102.mp4
First, see it in action:
- Ensure Firebase / Cloudinary backends are properly configured.
> Check the .env file for CLOUDINARY backend
> Ensure you have a proper online Firebase backend
- Run the Flutter app.
cd soulful
flutter pub get
flutter run
- In the app
- Sign up or log in with email/password
- Tap the file picker, choose an image or video
- Upload to Cloudinary from the Upload screen
- Preview uploads via the image/video preview screens
- Provide a simple, reliable mobile UI for authenticated users to pick, upload, and preview media files while handling async operations safely and showing clear feedback.
- Firebase Authentication (email/password)
- File selection using FilePicker
- Cloudinary upload service (service_cloudinary)
- Image and video preview screens (network loading, error handling, pinch/zoom, playback controls)
- Robust lifecycle handling (mounted checks, controller disposal)
- Minimal route table for quick integration
- Clone
git clone https://github.com/ex-rnd/Soulful-Drive-Upload-Using-Flutter-Cloudinary.git
cd soulful- Frontend setup
- Install dependencies.
flutter pub get- Create a
.envin the project root and add keys (example).
FIREBASE_API_KEY=your_firebase_api_key
FIREBASE_APP_ID=your_firebase_app_id
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
CLOUDINARY_CLOUD_NAME=your_cloud_name- Configure Firebase.
- Replace
lib/firebase_options.dartwith the file generated by the Firebase CLI (or update the existing file to match your Firebase project). - Ensure
main.dartloads dotenv before callingFirebase.initializeApp()if you depend on env values.
- Run the app
- Navigate to the flutter folder.
flutter run- Sign up → Log in → Pick file → Upload → Preview
Upload-Soulful-Drive-1102.mp4
final result = await FilePicker.platform.pickFiles();
if (result != null) {
Navigator.pushNamed(context, '/upload', arguments: result);
}
Upload-Soulful-Drive-1102.mp4
final success = await uploadToCloudinary(selectedFile);
if (success) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Uploaded')));
Navigator.pop(context);
}
Navigator.push(context, MaterialPageRoute(builder: (_) => PreviewImage(url: uploadedUrl)));
Navigator.push(context, MaterialPageRoute(builder: (_) => PreviewVideo(videoUrl: uploadedVideoUrl)));
- Ensure your emulator or device is connected
- From project root:
cd frontend
flutter run
— / Splash check (CheckUserLoggedIn) redirects to /home or /login
— /home Home / main content (uploads list placeholder)
— /login LoginPage (email/password)
— /signup SignUpPage (name, contact, email, password)
— /upload UploadArea (expects a FilePickerResult via route args)
- Preview screens:
PreviewImage,Preview Video
- App entry: dotenv + Firebase init, route table, CheckUserLoggedIn splash
- Sign-up form: name, contact, email, password; validators, loading state, controller disposal
- Login form: email, password; validators, loading state, safe navigation
- UploadArea: shows file info; uploads via
uploadToCloudinary()with loading state and error handling
- Image preview: loadingBuilder, errorBuilder, InteractiveViewer (pinch/zoom)
- Video preview:
video_playercontroller init/dispose, playback controls, progress, error states
- AuthService:
createAccountWithEmail,loginWithEmail,isLoggedIn(wrap Firebase auth)
uploadToCloudinary(FilePickerResult)— recommended to return typedUploadResult
- Never commit secrets. Use
.envlocally and environment injection for CI/CD. - Required env keys (example):
FIREBASE_*,CLOUDINARY_API_KEY,CLOUDINARY_API_SECRET,CLOUDINARY_CLOUD_NAME.
- ✅ Add typed AuthResult / UploadResult and refactor service returns
- ➕ Upload progress UI and resumable uploads (high priority)
- 🗂️ Persist uploads metadata and show thumbnails list on HomePage (high priority)
- 🧪 Add unit & widget tests and CI checks (medium priority)
- 🔐 Move upload signing server-side or use signed uploads for improved security (medium priority)
- 🌐 Support multiple file selection and batch uploads (future
- Fork the repo
- Branch naming: feature/xyz or fix/xyz
- Run linters:
Frontend: flutter format- Add tests:
Frontend widget tests with: flutter test- Submit PRs with clear descriptions and link related issues