appsmanager 1.2.8 copy "appsmanager: ^1.2.8" to clipboard
appsmanager: ^1.2.8 copied to clipboard

appsmanager package help to connect your app with https://appsmanager.tech/.

example/README.md

import 'package:downloader/onesiginal.dart';
import 'package:flutter/material.dart';
import 'package:hive_flutter/adapters.dart';
import 'package:get/get.dart';
import 'package:appsmanager/appsmanager.dart';

String appID = "80";
late Future<List<UploadedContents>> futureContents;

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await initOneSignal();
  await Hive.initFlutter();
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return const GetMaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  void adsmanagerInit() async {
    processFacrbookAds(appID);
    processGoogleAdmobAds(appID);
    await appsManagerinit(appID);
    print(admobAppOpen);
    print(facebookBanner);
    Get.to(
      const Homepage(),
      transition: Transition.downToUp,
    );
  }

  @override
  void initState() {
    super.initState();
    adsmanagerInit();
  }

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      backgroundColor: Colors.amber,
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            CircularProgressIndicator(),
          ],
        ),
      ),
    );
  }
}

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

  @override
  State<Homepage> createState() => _HomepageState();
}

class _HomepageState extends State<Homepage> {
  @override
  void initState() {
    super.initState();
    futureContents = fetchAppsManagerContents(appID, "All");
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: FutureBuilder<List<UploadedContents>>(
        future: fetchAppsManagerContents(appID, ""),
        builder: (context, snapshot) {
          if (snapshot.hasData) {
            List<UploadedContents> contentData =
                snapshot.data!; // Access the fetched data
            return Column(
              children: [
                Expanded(
                  child: ListView.builder(
                    itemCount: contentData.length,
                    itemBuilder: (context, index) {
                      return Column(
                        children: [
                          Center(
                            child: Padding(
                              padding: const EdgeInsets.only(bottom: 20),
                              child: Column(
                                mainAxisAlignment: MainAxisAlignment.start,
                                children: <Widget>[
                                  GestureDetector(
                                    onTap: () {},
                                    child: Image.network(
                                      contentData[index].imagelink,
                                      width: MediaQuery.of(context).size.width,
                                    ),
                                  ),
                                  Row(
                                    mainAxisAlignment: MainAxisAlignment.start,
                                    children: [
                                      Column(
                                        mainAxisAlignment:
                                            MainAxisAlignment.start,
                                        crossAxisAlignment:
                                            CrossAxisAlignment.start,
                                        children: [
                                          Padding(
                                            padding: const EdgeInsets.only(
                                              left: 2,
                                              right: 2,
                                              top: 5,
                                            ),
                                            child: SizedBox(
                                              width: MediaQuery.of(context)
                                                      .size
                                                      .width *
                                                  0.6,
                                              child: GestureDetector(
                                                onTap: () {},
                                                child: Text(
                                                  contentData[index].title,
                                                  textAlign: TextAlign.left,
                                                  style: const TextStyle(
                                                    fontWeight: FontWeight.bold,
                                                    fontSize: 13,
                                                  ),
                                                ),
                                              ),
                                            ),
                                          ),
                                          Text(contentData[index].date),
                                        ],
                                      ),
                                      const Spacer(),
                                      Padding(
                                        padding:
                                            const EdgeInsets.only(right: 15),
                                        child: IconButton(
                                          onPressed: () {},
                                          icon: const Icon(
                                            size: 20,
                                            Icons.more_vert,
                                          ),
                                        ),
                                      ),
                                    ],
                                  )
                                ],
                              ),
                            ),
                          ),
                        ],
                      );
                    },
                  ),
                ),
              ],
            );
          } else if (snapshot.hasError) {
            // Print the error to the console
            print('Error: ${snapshot.error}');
            // Display the error message
            return Expanded(
              child: Center(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: [
                    Text(
                      'Error: ${snapshot.error}',
                      textAlign: TextAlign.center,
                      style: const TextStyle(
                        color: Colors.red,
                        fontSize: 16,
                      ),
                    ),
                  ],
                ),
              ),
            );
          } else {
            return const Center(
              child: CircularProgressIndicator(),
            );
          }
        },
      ),
    );
  }
}



2
likes
160
pub points
18%
popularity

Publisher

verified publisherappsmanager.tech

appsmanager package help to connect your app with https://appsmanager.tech/.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

hive, hive_flutter, http

More

Packages that depend on appsmanager