-
Notifications
You must be signed in to change notification settings - Fork 259
/
multi_sheet.dart
60 lines (57 loc) · 1.82 KB
/
multi_sheet.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import 'package:flutter/material.dart';
import 'package:smart_select/smart_select.dart';
import '../choices.dart' as choices;
class FeaturesMultiSheet extends StatefulWidget {
@override
_FeaturesMultiSheetState createState() => _FeaturesMultiSheetState();
}
class _FeaturesMultiSheetState extends State<FeaturesMultiSheet> {
List<String> _os = ['and', 'tux'];
List<String> _hero = ['bat', 'spi'];
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
const SizedBox(height: 7),
SmartSelect<String>.multiple(
title: 'OS',
selectedValue: _os,
onChange: (selected) => setState(() => _os = selected.value),
choiceItems: choices.os,
modalType: S2ModalType.bottomSheet,
tileBuilder: (context, state) {
return S2Tile.fromState(
state,
isTwoLine: true,
leading: const CircleAvatar(
backgroundImage: NetworkImage(
'https://source.unsplash.com/xsGxhtAsfSA/100x100',
),
),
);
},
),
const Divider(indent: 20),
SmartSelect<String>.multiple(
title: 'Super Hero',
selectedValue: _hero,
onChange: (selected) => setState(() => _hero = selected.value),
choiceItems: choices.heroes,
modalType: S2ModalType.bottomSheet,
tileBuilder: (context, state) {
return S2Tile.fromState(
state,
isTwoLine: true,
leading: const CircleAvatar(
backgroundImage: NetworkImage(
'https://source.unsplash.com/8I-ht65iRww/100x100',
),
),
);
},
),
Container(height: 7),
],
);
}
}