Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F85153535
country_dropdown.dart
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Sep 27, 03:42
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Sep 29, 03:42 (2 d)
Engine
blob
Format
Raw Data
Handle
21135704
Attached To
R10646 Orchestration
country_dropdown.dart
View Options
import 'package:flutter/material.dart';
class CountryDropdown extends StatelessWidget {
final List<String> countries;
final String country;
final Function(String) onChanged;
const CountryDropdown({
@required this.countries,
@required this.country,
@required this.onChanged,
});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
height: 40.0,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(30.0),
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
value: country,
items: countries
.map((e) => DropdownMenuItem(
child: Row(
children: <Widget>[
CircleAvatar(
radius: 12.0,
child: Image.asset(
'assets/images/${e.toLowerCase()}_flag.png',
),
),
const SizedBox(width: 8.0),
Text(
e,
style: const TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
),
)
],
),
value: e,
))
.toList(),
onChanged: onChanged,
),
),
);
}
}
Event Timeline
Log In to Comment