add some documentation

This commit is contained in:
Salvatore Giordano
2018-05-05 11:22:54 +02:00
parent 5dc8b256c9
commit 1614174f13
6 changed files with 26 additions and 16 deletions

View File

@@ -1,8 +1,11 @@
import 'package:flutter/material.dart';
import 'package:country_code_picker/celement.dart';
import 'package:flutter/material.dart';
/// selection dialog used for selection of the country code
class SelectionDialog extends StatefulWidget {
final List<CElement> elements;
/// elements passed as favorite
final List<CElement> favoriteElements;
SelectionDialog(this.elements, this.favoriteElements);
@@ -12,6 +15,7 @@ class SelectionDialog extends StatefulWidget {
}
class _SelectionDialogState extends State<SelectionDialog> {
/// this is useful for filtering purpose
List<CElement> showedElements = [];
@override
@@ -56,10 +60,7 @@ class _SelectionDialogState extends State<SelectionDialog> {
s = s.toUpperCase();
setState(() {
showedElements = widget.elements
.where((e) =>
e.code.contains(s) ||
e.dialCode.contains(s) ||
e.name.toUpperCase().contains(s))
.where((e) => e.code.contains(s) || e.dialCode.contains(s) || e.name.toUpperCase().contains(s))
.toList();
});
}