field_suggestion 0.1.3 copy "field_suggestion: ^0.1.3" to clipboard
field_suggestion: ^0.1.3 copied to clipboard

outdated

Create highly customizable, simple, and controllable autocomplete fields.

example/lib/main.dart

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

void main() => runApp(App());

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'FieldSuggestion Example',
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final firstTextController = TextEditingController();
  final secondTextController = TextEditingController();

  final suggestionBoxController = BoxController();

  List<String> suggestionList = [
    '[email protected]',
    '[email protected]',
    '[email protected]',
  ];

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () => suggestionBoxController.close!(),
      child: Scaffold(
        appBar: AppBar(title: const Text("FieldSuggestion Example")),
        body: SingleChildScrollView(
          padding: const EdgeInsets.all(15),
          child: Center(
            child: Column(
              children: [
                // Basic usage.
                FieldSuggestion(
                  textController: firstTextController,
                  suggestionList: suggestionList,
                  hint: 'Email',
                ),

                const SizedBox(height: 100),

                // Custom usage.
                FieldSuggestion(
                  boxController: suggestionBoxController,
                  textController: secondTextController,
                  suggestionList: suggestionList,
                  fieldDecoration: InputDecoration(
                    hintText: "Email",
                    enabledBorder: const OutlineInputBorder(),
                    focusedBorder: const OutlineInputBorder(),
                  ),
                  wDivider: true,
                  divider: const SizedBox(height: 5),
                  wSlideAnimation: true,
                  slideAnimationStyle: SlideAnimationStyle.LTR,
                  slideCurve: Curves.linearToEaseOut,
                  animationDuration: const Duration(milliseconds: 300),
                  suggestionItemStyle:
                      SuggestionItemStyle.WhiteNeumorphismedStyle,
                  suggestionBoxStyle: SuggestionBoxStyle(
                    backgroundColor: Colors.white,
                    borderRadius: BorderRadius.circular(15),
                    boxShadow: [
                      BoxShadow(
                        color: Colors.blue.withOpacity(.2),
                        spreadRadius: 5,
                        blurRadius: 10,
                        offset: const Offset(0, 5),
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
45
likes
0
points
1.23k
downloads

Publisher

verified publishertheiskaa.com

Weekly Downloads

Create highly customizable, simple, and controllable autocomplete fields.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on field_suggestion