algo360pfm 0.0.8 copy "algo360pfm: ^0.0.8" to clipboard
algo360pfm: ^0.0.8 copied to clipboard

outdated

Algo360 SDK extracts transactional SMS from the user’s device and provides an expense tracking dashboard which helps get an accurate picture of overall expenses in a single view.

example/lib/main.dart

import 'dart:async';
import 'dart:developer';

import 'package:algo360pfm/algo360pfm.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _algo360pfmPlugin = Algo360pfm();

  @override
  void initState() {
    super.initState();
    setConfiguration();
    setTheme();
  }

  Future<void> setConfiguration() async {
    String? platformVersion;

    try {
      _algo360pfmPlugin.setConfiguration("", "", "", "");
    } on PlatformException {
      platformVersion = 'Failed to set permissions';
    }

    if (!mounted) return;
  }

  Future<void> startPFM() async {
    try {
      _algo360pfmPlugin.invokePFM();
    } on PlatformException {
      log("exception");
    }

    if (!mounted) return;
  }

  Future<void> invokeSDK() async {
    try {
      _algo360pfmPlugin.invokeSDK(1);
    } on PlatformException {
      log("exception");
    }

    if (!mounted) return;
  }

  Future<void> setTheme() async {
    try {
      _algo360pfmPlugin.setTheme("LIGHT");
    } on PlatformException {
      log("exception");
    }

    if (!mounted) return;
  }

  Future<void> invokePermissionsScreen() async {
    try {
      _algo360pfmPlugin.invokePermissionsScreen();
    } on PlatformException {
      log("exception");
    }

    if (!mounted) return;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text("Set Configuration"),
            MaterialButton(
              onPressed: () {
                setConfiguration();
              },
              color: Colors.blueAccent,
              child: const Text("Launch"),
            ),
            const Text("PFM"),
            MaterialButton(
              onPressed: () {
                startPFM();
              },
              color: Colors.blueAccent,
              child: const Text("Launch"),
            ),
            const Text("SDK"),
            MaterialButton(
              onPressed: () {
                invokeSDK();
              },
              color: Colors.blueAccent,
              child: const Text("Launch"),
            ),
            const Text("Permission Screen"),
            MaterialButton(
              onPressed: () {
                invokePermissionsScreen();
              },
              color: Colors.blueAccent,
              child: const Text("Launch"),
            )
          ],
        ),
      )),
    );
  }
}
1
likes
0
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

Algo360 SDK extracts transactional SMS from the user’s device and provides an expense tracking dashboard which helps get an accurate picture of overall expenses in a single view.

Homepage

License

unknown (license)

Dependencies

flutter, permission_handler, plugin_platform_interface

More

Packages that depend on algo360pfm

Packages that implement algo360pfm