dropdownbottomsheet 0.0.2
dropdownbottomsheet: ^0.0.2 copied to clipboard
A dropdownbottomsheet that we can customise and use
example/dropdownbottomsheet_example.dart
import 'package:dropdownbottomsheet/dropdownbottomsheet.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Floating Action Button Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Floating Action Button Example'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have clicked the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
DropDownBottomSheet().showDropDownBottomSheet(
context: context,
title: "title",
items: ["1", "2", "3"],
onChanged: (value) {},
onTap: (p0) {});
},
tooltip: 'Increment',
child: Icon(Icons.add),
),
);
}
}