flutter_rustore_pay 9.1.0 copy "flutter_rustore_pay: ^9.1.0" to clipboard
flutter_rustore_pay: ^9.1.0 copied to clipboard

PlatformAndroid

Flutter RuStore Pay SDK

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_rustore_pay_example/product_widget.dart';
import 'package:flutter_rustore_pay_example/purchase_widget.dart';
import 'package:flutter_rustore_pay_example/utils_widget.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
  // define your tab controller here
  late TabController _tabController;

  @override
  void initState() {
    // initialise your tab controller here
    _tabController = TabController(length: 3, vsync: this);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
      appBar: AppBar(
        leading: const Icon(
          Icons.menu,
          color: Colors.black,
        ),
        backgroundColor: Colors.transparent,
        elevation: 0,
        title: const Text(
          'RuStore Pay Example',
          style: TextStyle(color: Colors.black),
        ),
      ),
      body: Column(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 5),
            child: TabBar(
              controller: _tabController,
              labelColor: Colors.green,
              isScrollable: true,
              indicatorColor: Colors.transparent,
              unselectedLabelColor: Colors.grey,
              unselectedLabelStyle: const TextStyle(
                fontSize: 16,
                color: Colors.grey,
                fontWeight: FontWeight.w700,
              ),
              labelStyle: const TextStyle(
                fontSize: 16,
                fontWeight: FontWeight.w700,
              ),
              tabs: const <Widget>[
                Text('PRODUCTS'),
                Text('PURCHASES'),
                Text('UTILS'),
              ],
            ),
          ),
          Expanded(
            child: TabBarView(
              controller: _tabController,
              children: const <Widget>[
                ProductWidget(),
                PurchaseWidget(),
                UtilsWidget()
              ],
            ),
          ),
        ],
      ),
    ));
  }
}