woosignal_shopify 1.0.0 copy "woosignal_shopify: ^1.0.0" to clipboard
woosignal_shopify: ^1.0.0 copied to clipboard

discontinuedreplaced by: woosignal_shopify_api
outdated

WooSignal Flutter plugin for the Shopify StoreMob app template

example/main.dart

import 'package:flutter/material.dart';
import 'package:woosignal_shopify/models/shopify_product.dart';
import 'package:woosignal_shopify/woosignal_shopify.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 {
    ShopifyProduct shopifyProduct = await ShopifyAPI.instance
        .service((request) => request.fetchProducts(limit: 50));

    print(shopifyProduct.products[0].title);

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

  @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),
      ),
    );
  }
}
0
likes
0
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

WooSignal Flutter plugin for the Shopify StoreMob app template

Homepage

Documentation

Documentation

License

unknown (license)

Dependencies

device_info, dio, flutter, flutter_secure_storage, uuid

More

Packages that depend on woosignal_shopify