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

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

example/lib/main.dart

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

void woosignalWoocommerceExample() => 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({super.key, required this.title});

  final String title;

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

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

  _incrementCounter() async {
    // CREATING AN INSTANCE FOR WOOSIGNAL
    await WooSignal.instance.init(appKey: "your app key");

    List<Product> products = await WooSignal.instance.getProducts();
    if (products.isNotEmpty) {
      _productName = products[0].name ?? "";
    }
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text('Tap the light bulb to get a product'),
            if (_productName != "")
              Text(
                'WooCommerce product :\n $_productName',
              ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.lightbulb_outline),
      ),
    );
  }
}
60
likes
140
pub points
85%
popularity
screenshot

Publisher

verified publisherwoosignal.com

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
API reference

License

BSD-3-Clause (license)

Dependencies

device_meta, dio, encrypt, flutter

More

Packages that depend on woosignal