patch_pal 0.0.1 copy "patch_pal: ^0.0.1" to clipboard
patch_pal: ^0.0.1 copied to clipboard

outdated

Flutter package thats helps you to patch your widget/code with json data.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return FutureBuilder<void>(
      future: PatchPal.setUp('https://raw.githubusercontent.com/yeasin50/AssetsFor_/master/apps/patch_pal/test.json'),
      builder: (context, snapshot) {
        if (snapshot.connectionState == ConnectionState.done) {
          if (snapshot.hasError) {
            return const Center(
              child: Text('Error'),
            );
          } else {
            return const MaterialApp(
              home: Scaffold(
                body: Center(
                  child: Column(
                    children: [
                      PatcherViewOnFalse(
                        patchItemName: 'rain',
                        message: 'This feature is not available right now.',
                      ),
                      PatcherViewOnFalse(
                        patchItemName: 'unknown',
                        onPositive: Text('it is available now!'),
                      ),
                    ],
                  ),
                ),
              ),
            );
          }
        } else {
          return const Center(
            child: CircularProgressIndicator(),
          );
        }
      },
    );
  }
}
4
likes
0
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter package thats helps you to patch your widget/code with json data.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, mockito

More

Packages that depend on patch_pal