smart_time_field_picker 0.0.4 copy "smart_time_field_picker: ^0.0.4" to clipboard
smart_time_field_picker: ^0.0.4 copied to clipboard

A customizable Flutter time picker with TextFormField, supporting 12/24-hour formats, smart input, keyboard navigation, and full theming.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Smart Time FieldPicker Example',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.deepPurple,
          primary: Colors.deepPurple,
        ),
        appBarTheme: const AppBarTheme(color: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const DropDownClass(),
    );
  }
}

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

  @override
  State<DropDownClass> createState() => _DropDownClassState();
}

class _DropDownClassState extends State<DropDownClass> {
  final dropdownKey = GlobalKey<SmartTimeFieldState>();
  final countryController = OverlayPortalController();
  String? intiValue = "12:10 PM";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          "Smart Time FieldPicker Example",
          style: TextStyle(color: Colors.white),
        ),
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Column(
          children: [
            Expanded(
              child: SmartTimeFieldPicker(
                user12Hr: true,
                key: dropdownKey,
                initialItem: intiValue,
                controller: countryController,
                textStyle: const TextStyle(
                  fontSize: 12,
                  fontWeight: FontWeight.w400,
                ),
                onChanged: (String? value) {
                  setState(() {
                    intiValue = value;
                  });
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
}
6
likes
150
points
9
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A customizable Flutter time picker with TextFormField, supporting 12/24-hour formats, smart input, keyboard navigation, and full theming.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, mask_text_input_formatter

More

Packages that depend on smart_time_field_picker