magic_dropdown_search 0.0.3 copy "magic_dropdown_search: ^0.0.3" to clipboard
magic_dropdown_search: ^0.0.3 copied to clipboard

A flutter package for a dropdown search with dynamic data from Api

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Magic Dropdown Search Example'),
        ),
        body: Center(
          child: MagicDropdownSearch(
            label: 'Search',
            onChanged: (value) {
              print('Selected value: $value');
            },
            onChangedSearch: (searchTerm) async {
              // Replace this with your own search logic
              return ['Item1', 'Item2', 'Item3'];
            },
            dropdownItems:const  ['Item1', 'Item2', 'Item3'],
            hint: 'Select an item',
            hintSearch: 'Search items',
            initValue: 'Item1',
            buttonWidth: 200,
            itemHeight: 50,
            dropdownHeight: 300,
            buttonHeight: 50,
            suffixIcon: const Icon(Icons.search),
          ),
        ),
      ),
    );
  }
}
1
likes
0
pub points
41%
popularity

Publisher

unverified uploader

A flutter package for a dropdown search with dynamic data from Api

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, font_awesome_flutter, shimmer

More

Packages that depend on magic_dropdown_search