A Flutter application that fetches CAD to NGN exchange rates from the Flutterwave API and automatically updates every hour using a cron job.
- Real-time Exchange Rates: Fetches current CAD to NGN exchange rates from Flutterwave API
- Automatic Updates: Cron job runs every hour to check for the latest rates
- Currency Converter: Interactive converter between CAD and NGN
- Caching: Stores exchange rates locally for offline access
- Modern UI: Beautiful Material Design interface
- Cross-platform: iOS and Android support
- Real-time API Integration: Uses actual exchange rates from Flutterwave
The app features a modern, intuitive interface with:
- Current exchange rate display
- Real-time currency conversion
- Automatic hourly updates
- Offline functionality with cached rates
- Flutter SDK (version 3.0.0 or higher)
- Dart SDK
- Android Studio / VS Code with Flutter extensions
- iOS development setup (for iOS deployment)
-
Clone the repository
git clone https://github.com/lagrandecode/flutterwave_exchange_rate.git cd flutterwave_exchange_rate -
Install dependencies
flutter pub get
-
Run the application
# For development flutter run # Or use the provided script ./run_app.sh
The app integrates with the Flutterwave API endpoint:
https://api.flutterwave.com/v3/transfers/rates?amount=1&destination_currency=NGN&source_currency=CAD
API Token: FLWSECK_TEST-77773752bc30f0a99af74caab64187d5-X
The app uses real-time exchange rates from the Flutterwave API:
- Dynamic Rates: Fetches current market rates
- Hourly Updates: Automatically refreshes every hour
- Offline Support: Uses cached rates when offline
- Minimum iOS version: 12.0
- Supports iPhone and iPad
- Automatic code signing
- Minimum Android version: API 21 (Android 5.0)
- Supports all Android devices
- Internet permissions included
lib/
โโโ main.dart # App entry point
โโโ models/
โ โโโ exchange_rate.dart # Exchange rate data model
โโโ services/
โ โโโ exchange_rate_service.dart # API service and cron job
โโโ screens/
โ โโโ home_screen.dart # Main UI screen
โโโ config/
โโโ api_config.dart # API configuration
dart test_api.dartflutter test- Launch the app
- Check initial rate fetch
- Test currency conversion
- Verify hourly updates
The app uses the following key dependencies:
http: For API requests to Flutterwavecron: For scheduling hourly rate updatesprovider: For state managementshared_preferences: For local cachingintl: For currency formatting
- Schedule: Every hour at minute 0 (
0 * * * *) - Function: Automatically fetches latest exchange rate
- Caching: Stores rates locally using SharedPreferences
- Manual Refresh: Available via refresh button
-
Build for iOS
flutter build ios --release
-
Deploy using Xcode
open ios/Runner.xcworkspace
Then select your device and click Run.
-
Or use the deployment script
./deploy_to_device.sh
-
Build APK
flutter build apk --release
-
Install on device
flutter install
-
API Connection Issues
- Check internet connection
- Verify API token is valid
- Check Flutterwave API status
-
Build Issues
flutter clean flutter pub get
-
Cron Job Not Working
- Check app permissions
- Verify the app is not being killed by the system
The app logs important events:
- API calls and responses
- Cron job triggers
- Error messages
- Rate updates
- The API token is currently hardcoded for testing
- For production, consider using environment variables or secure storage
- The app uses HTTPS for all API communications
- Support for more currency pairs
- Historical rate charts
- Push notifications for rate changes
- Offline mode improvements
- Multiple API provider support
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Oluwaseun Ogunmolu
- GitHub: @lagrandecode
- Flutterwave for providing the exchange rate API
- Flutter team for the amazing framework
- The Flutter community for excellent packages
โญ Star this repository if you find it helpful!