flutter_simple_shopify 0.0.25-alpha
flutter_simple_shopify: ^0.0.25-alpha copied to clipboard

Flutter Android iOS Linux macOS

A new Flutter package which provides help in creating a mobile app of a shopify store.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_simple_shopify/flutter_simple_shopify.dart';
import 'collection_tab.dart';
import 'home_tab.dart';
import 'profile_tab.dart';
import 'search_tab.dart';

void main() {
  ShopifyConfig.setConfig(
    "STOREFRONT-API-ACCESS-TOKEN",
    "YOUR-SHOPIFY-WEBSITE",
    "2020-04",
  );
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Shopify Example',
      theme: ThemeData(primaryColor: Colors.redAccent),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _currentIndex = 0;

  final _tabs = [
    HomeTab(),
    CollectionTab(),
    SearchTab(),
    ProfileTab(),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: IndexedStack(
        index: _currentIndex,
        children: _tabs,
      ),
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: _currentIndex,
        onTap: _onNavigationBarItemClick,
        fixedColor: Theme.of(context).primaryColor,
        unselectedItemColor: Colors.black,
        items: [
          BottomNavigationBarItem(icon: Icon(Icons.home), title: Text("Home")),
          BottomNavigationBarItem(
              icon: Icon(Icons.category), title: Text("Collections")),
          BottomNavigationBarItem(
              icon: Icon(Icons.search), title: Text("Search")),
          BottomNavigationBarItem(
              icon: Icon(Icons.person), title: Text("Profile")),
        ],
      ),
    );
  }

  void _onNavigationBarItemClick(int index) {
    setState(() {
      _currentIndex = index;
    });
  }
}
40
likes
70
pub points
73%
popularity

A new Flutter package which provides help in creating a mobile app of a shopify store.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

thinksimpleapps@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, graphql, shared_preferences

More

Packages that depend on flutter_simple_shopify