square_connect 0.0.7 copy "square_connect: ^0.0.7" to clipboard
square_connect: ^0.0.7 copied to clipboard

outdated

A wrapper for the Square Connect APIs. It's intended use is in a flutter application to manage inventory, catalog, customers, labor, and more on the Square platform.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:square_connect/square_connect.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final client = SquareConnect.instance;
  CatalogItem item;

  @override
  void initState() {
    client.setAuthToken(
        token:
            'EAAAEF6M57K-wC3WrDFaDW80jMZ8KHNCzBbFVWtmg0bZifLJ3XVdcJGta7OgaLuS');
    super.initState();
    _refreshItems();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Square Connect Demo App'),
      ),
      body: Center(
        child: Text(item != null ? item.name : ''),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _refreshItems,
        tooltip: 'Increment',
        child: Icon(Icons.refresh),
      ),
    );
  }

  _refreshItems() async {
    var response = await client.catalogApi
        .retrieveCatalogObject(objectId: 'L3N4FU22JFINH4ZGZDMBKJBJ');
    setState(() {
      item = response.object.itemData;
    });
  }
}
5
likes
0
pub points
60%
popularity

Publisher

unverified uploader

A wrapper for the Square Connect APIs. It's intended use is in a flutter application to manage inventory, catalog, customers, labor, and more on the Square platform.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, http, uuid

More

Packages that depend on square_connect