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

outdated

Thanks, but no thanks. Just let me write good code.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';

void main() {
  final state = State();
  runApp(App(state));
}

final class State {
  final _count = ValueNotifier(0);

  ValueListenable<int> get count => _count;

  void increment() {
    ++_count.value;
  }
}

final class App extends StatelessWidget {
  const App(this.state, {super.key});

  final State state;

  @override
  Widget build(BuildContext context) => Column(
        children: [
          ValueListenableBuilder(
            valueListenable: state.count,
            builder: (_, count, __) => Text(count.toString()),
          ),
          GestureDetector(
            onTap: state.increment,
            child: const SizedBox.square(dimension: 48, child: Text('+')),
          ),
        ],
      );
}
1
likes
0
points
253
downloads

Publisher

unverified uploader

Weekly Downloads

Thanks, but no thanks. Just let me write good code.

License

unknown (license)

More

Packages that depend on riddance_env