Skip to main content

smart_field_kit 0.0.2 copy "smart_field_kit: ^0.0.2" to clipboard
smart_field_kit: ^0.0.2 copied to clipboard

Flutter form fields on native Material behavior: validation, formatting, masking, phone, OTP, amount, card, and date inputs in one API.

example/lib/main.dart

import 'package:material_ui/material_ui.dart';

import 'src/app_shell.dart';
import 'src/settings.dart';

void main() => runApp(const ExampleApp());

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

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  final ShowcaseSettings _settings = ShowcaseSettings();

  @override
  void dispose() {
    _settings.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return ListenableBuilder(
      listenable: _settings,
      builder: (context, _) {
        return MaterialApp(
          title: 'smart_field_kit showcase',
          debugShowCheckedModeBanner: false,
          themeMode: _settings.themeMode,
          theme: ThemeData(
            colorSchemeSeed: Colors.teal,
            useMaterial3: true,
            brightness: Brightness.light,
          ),
          darkTheme: ThemeData(
            colorSchemeSeed: Colors.teal,
            useMaterial3: true,
            brightness: Brightness.dark,
          ),
          builder: (context, child) {
            return Directionality(
              textDirection: _settings.rtl
                  ? TextDirection.rtl
                  : TextDirection.ltr,
              child: MediaQuery(
                data: MediaQuery.of(
                  context,
                ).copyWith(textScaler: TextScaler.linear(_settings.textScale)),
                child: child!,
              ),
            );
          },
          restorationScopeId: 'showcase',
          home: AppShell(settings: _settings),
        );
      },
    );
  }
}
1
likes
160
points
93
downloads
screenshot

Documentation

API reference

Publisher

verified publishercodewingz.com

Weekly Downloads

Flutter form fields on native Material behavior: validation, formatting, masking, phone, OTP, amount, card, and date inputs in one API.

Repository (GitHub)
View/report issues

Topics

#form #input #validation #text-field #flutter

License

MIT (license)

Dependencies

characters, country_picker, cupertino_ui, flutter, flutter_native_contact_picker, material_ui, phone_numbers_parser

More

Packages that depend on smart_field_kit