hypen 0.0.5+1 copy "hypen: ^0.0.5+1" to clipboard
hypen: ^0.0.5+1 copied to clipboard

unlistedoutdated

A set of libraries that help you design robust, testable, and maintainable apps.

example/lib/main.dart

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

import 'main.state.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: Scaffold(
        body: Center(
          child: CounterWidget(),
        ),
      ),
    );
  }
}

class CounterWidget extends HypenWidget {
  const CounterWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return myWidget();
  }
}

Widget myWidget() {
  final (count, setCount) = useCounter();
  final (myState, setMyState) = useMyState();
  return GestureDetector(
    onTap: () {
      setCount(count + 1);
      setMyState(MyState(myState.a + 2));
    },
    child: Text(
      'Count: $count, MyState: ${myState.a}',
      style: const TextStyle(fontSize: 30),
    ),
  );
}

@HypenState()
int counter = 0;

@HypenState()
MyState myState() {
  return MyState(0);
}

class MyState {
  MyState(this.a);
  int a;
}
5
likes
0
points
103
downloads

Publisher

verified publisherhypen.io

Weekly Downloads

A set of libraries that help you design robust, testable, and maintainable apps.

Homepage
Repository
View/report issues

License

unknown (license)

Dependencies

collection, cupertino_icons, flutter, meta

More

Packages that depend on hypen