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

A pastel libraries for flutter.

example/example.dart

import 'package:flutter/material.dart';
import 'package:pastel/pastel.dart';
import 'package:pastel_flutter/pastel_flutter.dart';

final loginState = Reactive<(String, String)>(('', ''));

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

  @override
  Widget build(BuildContext context) {
    return ReactiveWidget<(String, String)>(
      reactive: loginState,
      builder: (context, state) => Column(
        children: [
          TextField(
            onChanged: (value) {
              loginState.write = (value, state.$2);
            },
          ),
          TextField(
            onChanged: (value) {
              loginState.write = (state.$1, value);
            },
          ),
          TextButton(
            onPressed: () {
              print('ID: ${state.$1}, PW: ${state.$2}');
            },
            child: Text('Login'),
          ),
        ],
      ),
    );
  }
}
2
likes
140
pub points
0%
popularity

Publisher

unverified uploader

A pastel libraries for flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MPL-2.0 (license)

Dependencies

flutter, pastel

More

Packages that depend on pastel_flutter