woosignal_shopify_api 1.0.3 copy "woosignal_shopify_api: ^1.0.3" to clipboard
woosignal_shopify_api: ^1.0.3 copied to clipboard

Shopify API for Dart, connect a Shopify store on WooSignal and start using the API to get products, login, create orders and more.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:woosignal_shopify_api/models/response/shopify_product_response.dart';
import 'package:woosignal_shopify_api/woosignal_shopify_api.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, required this.title}) : super(key: key);

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  String? _productName;

  _incrementCounter() async {
    // Add your WooSignal API key here
    await WooSignalShopify.instance.init(appKey: "your app key");

    ShopifyProductResponse? shopifyProductResponse =
        await WooSignalShopify.instance.getProducts();
    if ((shopifyProductResponse?.products ?? []).isNotEmpty) {
      _productName = shopifyProductResponse?.products?[0].title ?? "";
    }
    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 != null)
              Text(
                'Shopify product :\n $_productName',
              ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.lightbulb_outline),
      ),
    );
  }
}
4
likes
0
points
347
downloads

Publisher

verified publisherwoosignal.com

Weekly Downloads

Shopify API for Dart, connect a Shopify store on WooSignal and start using the API to get products, login, create orders and more.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

collection, device_meta, dio, encrypt, flutter, nylo_framework

More

Packages that depend on woosignal_shopify_api