snipe_superk_social 0.0.2 copy "snipe_superk_social: ^0.0.2" to clipboard
snipe_superk_social: ^0.0.2 copied to clipboard

snipe_superk_social

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:snipe_superk_social/snipe_superk_social.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final TextEditingController _useridController = TextEditingController(
      // text: '659d5059a4eee9a3a7c63a46',
      );
  final TextEditingController _apikeyController = TextEditingController(
      // text: 'dev_NTEyYjE2MjMtYmNkYS00ODM5LWJiMWMtZDk1NGJkZTViMDMx',
      );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("SOCIAL TEST"),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(20.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
             
              const SizedBox(
                height: 20,
              ),
              CupertinoTextField(
                placeholder: "Enter API Key",
                controller: _apikeyController,
              ),
              const SizedBox(
                height: 20,
              ),
              CupertinoTextField(
                placeholder: "Enter Referrer Id",
                controller: _useridController,
              ),
              const SizedBox(
                height: 20,
              ),
              ElevatedButton(
                  onPressed: () {
                    if (_apikeyController.text.isNotEmpty &&
                        _useridController.text.isNotEmpty) {
                      Navigator.push(
                        context,
                        MaterialPageRoute(
                          builder: (context) => SnipeTransactionHistory(
                            userId: _useridController.text,
                            apiKey: _apikeyController.text,
                          ),
                        ),
                      );
                    } else if (_apikeyController.text.isEmpty) {
                      ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
                          content: Text("Please Enter API Key")));
                    } else if (_useridController.text.isEmpty) {
                      ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
                          content: Text("Please Enter Referrer Id")));
                    }
                  },
                  child: const Text("Transaction History of Referrer")),
              const SizedBox(
                height: 20,
              ),
              ElevatedButton(
                onPressed: () {
                  if (_apikeyController.text.isNotEmpty &&
                      _useridController.text.isNotEmpty) {
                    Navigator.push(
                      context,
                      MaterialPageRoute(
                        builder: (context) => SnipeReferral(
                          userId: _useridController.text,
                          apiKey: _apikeyController.text,
                        ),
                      ),
                    );
                  } else if (_apikeyController.text.isEmpty) {
                    ScaffoldMessenger.of(context).showSnackBar(
                        const SnackBar(content: Text("Please Enter API Key")));
                  } else if (_useridController.text.isEmpty) {
                    ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
                        content: Text("Please Enter Referrer Id")));
                  }
                },
                child: const Text(
                  "Referral Program",
                ),
              ),
              const SizedBox(
                height: 20,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
140
points
32
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

snipe_superk_social

Homepage

License

Apache-2.0 (license)

Dependencies

colorful_safe_area, flutter, webview_flutter

More

Packages that depend on snipe_superk_social