flutter_rounded_dropdown 0.0.1 copy "flutter_rounded_dropdown: ^0.0.1" to clipboard
flutter_rounded_dropdown: ^0.0.1 copied to clipboard

A new Flutter package for a rounded dropdown.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Rounded DropDown Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final List<String> dropDownItems = ['India', 'America', 'China', 'Australia'];
  final String initialDropDownValue = 'India';
  String? selectedValue = '';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(18.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: <Widget>[
              RoundedDropDown(
                  dropDownItems: dropDownItems,
                  initialDropDownValue: initialDropDownValue,
                  onValueChanged: (String value) {
                    setState(() {
                      selectedValue = value;
                    });
                  }),
              Text(
                '$selectedValue',
                style: Theme.of(context).textTheme.headlineMedium,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
140
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter package for a rounded dropdown.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_rounded_dropdown