mypos_flutter 0.1.0 icon indicating copy to clipboard operation
mypos_flutter: ^0.1.0 copied to clipboard

Bridge with native MyPos SDK to connect to payment terminals

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:mypos_flutter_example/init.dart';
import 'package:mypos_flutter_example/ready.dart';

import 'app_state.dart';
import 'in_transaction.dart';

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

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

class _MyAppState extends State<MyApp> {
  ApplicationState _state = ApplicationState.Inactive;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: getBodyWidget(),
      ),
    );
  }

  updateState(newState) {
    setState(() {
      _state = newState;
    });
  }

  Widget getBodyWidget() {
    switch (_state) {
      case ApplicationState.Inactive:
        return InitScreen(this.updateState);
      case ApplicationState.Ready:
        return ReadyScreen();
      case ApplicationState.InTransaction:
        return InTransactionScreen();
    }

    return InitScreen(this.updateState);
  }
}
1
likes
100
pub points
33%
popularity

Publisher

verified publisher icongabrielsolomon.ro

Bridge with native MyPos SDK to connect to payment terminals

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on mypos_flutter