shopify_flutter 1.0.8 copy "shopify_flutter: ^1.0.8" to clipboard
shopify_flutter: ^1.0.8 copied to clipboard

A flutter package that works as a bridge between your Shopify Store and Flutter Application.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:shopify_flutter/shopify_flutter.dart';

import 'screens/collection_tab.dart';
import 'screens/home_tab.dart';
import 'screens/profile_tab.dart';
import 'screens/search_tab.dart';

void main() {
  ShopifyConfig.setConfig(
    storefrontAccessToken: '*******************',
    adminAccessToken: "shpat_*******************",
    storeUrl: '*****.myshopify.com',
    storefrontApiVersion: '2023-07',
  );
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

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

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

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

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

  List<Widget> tabs = [
    const HomeTab(),
    const CollectionTab(),
    const SearchTab(),
    const 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: const [
          BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
          BottomNavigationBarItem(
              icon: Icon(Icons.category), label: 'Collections'),
          BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'),
          BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Profile'),
        ],
      ),
    );
  }

  void _onNavigationBarItemClick(int index) {
    setState(() {
      _currentIndex = index;
    });
  }
}
53
likes
0
pub points
85%
popularity

Publisher

verified publishersujangainju.com.np

A flutter package that works as a bridge between your Shopify Store and Flutter Application.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, freezed_annotation, graphql_flutter, intl, json_serializable, shared_preferences, url_launcher

More

Packages that depend on shopify_flutter