supercontext 1.0.2 copy "supercontext: ^1.0.2" to clipboard
supercontext: ^1.0.2 copied to clipboard

A library of extensions for Build Context, which will give you superpowers when programming a new project.

example/lib/main.dart

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

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

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  String? title;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Example")),
      body: Center(
        child: Column(
          children: [
            Visibility(
              visible: title.isNull,
              child: const Text("Title is null"),
            ),
            Visibility(
              visible: title.isNotNull,
              child: Text(title!),
            ),
            FilledButton(
              onPressed: () {
                setState(() {
                  title = title.isNull ? "Title is no null" : null;
                });
              },
              child: const Text("Change title status"),
            ),
          ],
        ),
      ),
    );
  }
}
4
likes
160
points
20
downloads

Publisher

verified publishermanueldeveloper.com

Weekly Downloads

A library of extensions for Build Context, which will give you superpowers when programming a new project.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, mockito

More

Packages that depend on supercontext