fundstrack 0.0.5
fundstrack: ^0.0.5 copied to clipboard
The `fundsTrack` library is a simple and efficient Flutter package designed to help developers integrate SMS-based financial transaction tracking into their applications.
fundsTrack #
The fundsTrack library is a simple and efficient Flutter package designed to help developers integrate SMS-based financial transaction tracking into their applications. This package reads, filters, and processes SMS messages securely to extract transaction details and send them to your server for further analysis or storage.
Features #
- Reads SMS messages from the user's device (with permission).
- Filters SMS messages based on transaction patterns.
- Supports sending parsed transaction data to a server endpoint.
- Easy integration with a few lines of code.
- Configurable for various backend APIs.
Installation #
Add the package to your pubspec.yaml file:
dependencies:
fundstrack: ^0.0.1
Run the following command:
flutter pub get
Usage #
1. Import the package: #
import 'package:fundstrack/fundstrack.dart';
2. Request SMS permissions: #
Ensure your app has the necessary permissions to read SMS. You can use packages like permission_handler for managing permissions.
import 'package:permission_handler/permission_handler.dart';
Future<void> requestPermissions() async {
if (await Permission.sms.isDenied) {
await Permission.sms.request();
}
}
3. Initialize and configure fundstrack: #
Fundstrack fundstrack = Fundstrack(
serverUrl: 'https://api.fundstrack.in/api/v1/sms',
);
4. Start processing SMS messages: #
void processSms() async {
await fundstrack.readAndSendTransactions();
}
Example App: #
import 'package:flutter/material.dart';
import 'package:fundstrack/fundstrack.dart';
import 'package:permission_handler/permission_handler.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: SmsTrackerScreen(),
);
}
}
class SmsTrackerScreen extends StatefulWidget {
@override
_SmsTrackerScreenState createState() => _SmsTrackerScreenState();
}
class _SmsTrackerScreenState extends State<SmsTrackerScreen> {
final Fundstrack fundstrack = Fundstrack(
serverUrl: 'https://api.fundstrack.in/api/v1/sms',
);
@override
void initState() {
super.initState();
requestPermissions();
}
Future<void> requestPermissions() async {
if (await Permission.sms.isDenied) {
await Permission.sms.request();
}
}
void processSms() async {
await fundstrack.readAndSendTransactions();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('SMS messages processed successfully!')),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Fundstrack Demo'),
),
body: Center(
child: ElevatedButton(
onPressed: processSms,
child: Text('Process SMS Messages'),
),
),
);
}
}
Configuration #
Server Endpoint: #
Set your server URL during the initialization of Fundstrack:
Fundstrack fundstrack = Fundstrack(
serverUrl: 'https://api.fundstrack.in/api/v1/sms',
);
The library will send a POST request with the following data:
[
{
"sender": "Sender Name",
"message": "Transaction details...",
"timestamp": "2025-01-26T12:34:56Z"
}
]
Custom Filters: #
You can configure custom filters to identify relevant SMS messages. This will be added in future updates.
Permissions #
Add the following permissions to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
Roadmap #
- ❌ Add support for iOS (currently Android only).
- ❌ Enable customizable SMS filters.
- ❌ Support for offline processing and caching.
Contributing #
We welcome contributions! Please open an issue or submit a pull request on our GitHub repository.
License #
This package is licensed under the MIT License. See the LICENSE file for details.