v2.0.0
flutter_chips_input
InputChips を入力オプションとして使用して、入力フィールドを構築するためのFlutterライブラリ。
106いいね 177030日間ダウンロード70Pub ポイント
プラットフォーム情報なし
Flutter 入力フィールドで Material Chips をエントリとして受け入れる
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
Flutter library for building input fields with InputChips as input options.
Follow installation instructions here
import 'package:flutter_chips_input/flutter_chips_input.dart';
ChipsInput(
initialValue: [
AppProfile('John Doe', 'jdoe@flutter.io', 'https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX4057996.jpg')
],
decoration: InputDecoration(
labelText: "Select People",
),
maxChips: 3,
findSuggestions: (String query) {
if (query.length != 0) {
var lowercaseQuery = query.toLowerCase();
return mockResults.where((profile) {
return profile.name.toLowerCase().contains(query.toLowerCase()) || profile.email.toLowerCase().contains(query.toLowerCase());
}).toList(growable: false)
..sort((a, b) => a.name
.toLowerCase()
.indexOf(lowercaseQuery)
.compareTo(b.name.toLowerCase().indexOf(lowercaseQuery)));
} else {
return const <AppProfile>[];
}
},
onChanged: (data) {
print(data);
},
chipBuilder: (context, state, profile) {
return InputChip(
key: ObjectKey(profile),
label: Text(profile.name),
avatar: CircleAvatar(
backgroundImage: NetworkImage(profile.imageUrl),
),
onDeleted: () => state.deleteChip(profile),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
);
},
suggestionBuilder: (context, state, profile) {
return ListTile(
key: ObjectKey(profile),
leading: CircleAvatar(
backgroundImage: NetworkImage(profile.imageUrl),
),
title: Text(profile.name),
subtitle: Text(profile.email),
onTap: () => state.selectSuggestion(profile),
);
},
)
FormField implementation (ChipsInputField) to be used within Flutter Form Widget依存関係一覧 3 件
{"sdk":"flutter"}{"sdk":"flutter"}^2.0.1用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗