mypos_flutter 0.1.0 copy "mypos_flutter: ^0.1.0" to clipboard
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);
  }
}
2
likes
40
points
18
downloads

Publisher

verified publishergabrielsolomon.ro

Weekly Downloads

Bridge with native MyPos SDK to connect to payment terminals

Repository (GitHub)

License

MIT (license)

Dependencies

flutter

More

Packages that depend on mypos_flutter