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

Pure-Flutter lazy text fields for table and grid cells with exact constrained-width height measurement.

example/lib/main.dart

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

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

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

  @override
  State<SmallLazyTextFieldExample> createState() =>
      _SmallLazyTextFieldExampleState();
}

class _SmallLazyTextFieldExampleState extends State<SmallLazyTextFieldExample> {
  String _value = 'Click to edit this lazy field.';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(useMaterial3: true),
      home: Scaffold(
        appBar: AppBar(title: const Text('lazy_text_field')),
        body: Padding(
          padding: const EdgeInsets.all(24),
          child: SizedBox(
            width: 320,
            child: StatefulLazyTextField(
              cellId: 'example-cell',
              text: _value,
              style: const TextStyle(fontSize: 16, height: 1.3),
              padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
              decoration: const LazyInputDecoration(
                border: OutlineInputBorder(),
                hintText: 'Add a note',
              ),
              decorationVisibility: LazyInputDecorationVisibility.always,
              onSave: (value) {
                setState(() {
                  _value = value;
                });
                return true;
              },
            ),
          ),
        ),
      ),
    );
  }
}
1
likes
145
points
135
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Pure-Flutter lazy text fields for table and grid cells with exact constrained-width height measurement.

Repository (GitHub)
View/report issues

Topics

#flutter #text-field #datatable #grid #performance

License

MIT (license)

Dependencies

flutter

More

Packages that depend on lazy_text_field