woosignal 1.1.1 copy "woosignal: ^1.1.1" to clipboard
woosignal: ^1.1.1 copied to clipboard

outdated

WooCommerce REST API for dart, connect a WooCommerce store and start developing with our interface for their API endpoints.

example/main.dart

import 'package:flutter/material.dart';
import 'package:woosignal/models/response/products.dart';
import 'package:woosignal/woosignal.dart';

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

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

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  String _productName = "";

  _incrementCounter() async {
    // CONFIG FOR WOOSIGNAL
    var wsConfig = {"appKey": "your app key", "debugMode": true};

    // CREATING AN INSTANCE
    WooSignal wooSignal = await WooSignal.getInstance(config: wsConfig);

    List<Product> products = await wooSignal.getProducts();
    print(products[0].name);

    setState(() {
      _productName = products[0].name;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'WooCommerce product :',
            ),
            Text(
              '$_productName',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.lightbulb_outline),
      ),
    );
  }
}
60
likes
0
points
954
downloads

Publisher

verified publisherwoosignal.com

Weekly Downloads

WooCommerce REST API for dart, connect a WooCommerce store and start developing with our interface for their API endpoints.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

device_info, dio, flutter, shared_preferences, uuid

More

Packages that depend on woosignal