Fix Android issues
This commit is contained in:
@ -120,15 +120,19 @@ class _TeamDetailPageState extends State<TeamDetailPage> {
|
||||
}
|
||||
|
||||
final filteredCategories = controller.getFilteredCategories();
|
||||
final categoriesToDisplay = filteredCategories.isEmpty
|
||||
? controller.categories
|
||||
: filteredCategories;
|
||||
// 選択されているカテゴリが表示リストに含まれていない場合、最初の項目を選択する
|
||||
if (controller.selectedCategory.value == null ||
|
||||
!filteredCategories.contains(controller.selectedCategory.value)) {
|
||||
controller.updateCategory(filteredCategories.isNotEmpty
|
||||
? filteredCategories.first
|
||||
: null);
|
||||
}
|
||||
|
||||
// 選択されているカテゴリが表示リストに含まれていない場合、最初の項目を選択する
|
||||
if (controller.selectedCategory.value == null ||
|
||||
!categoriesToDisplay.contains(controller.selectedCategory.value)) {
|
||||
controller.updateCategory(categoriesToDisplay.isNotEmpty
|
||||
? categoriesToDisplay.first
|
||||
!filteredCategories.contains(controller.selectedCategory.value)) {
|
||||
controller.updateCategory(filteredCategories.isNotEmpty
|
||||
? filteredCategories.first
|
||||
: null);
|
||||
}
|
||||
|
||||
@ -147,7 +151,7 @@ class _TeamDetailPageState extends State<TeamDetailPage> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (categoriesToDisplay.isEmpty)
|
||||
if (filteredCategories.isEmpty)
|
||||
const Text('カテゴリデータを読み込めませんでした。',
|
||||
style: TextStyle(color: Colors.red))
|
||||
else
|
||||
@ -156,7 +160,7 @@ class _TeamDetailPageState extends State<TeamDetailPage> {
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'カテゴリ'),
|
||||
value: controller.selectedCategory.value,
|
||||
items: categoriesToDisplay.map((category) =>
|
||||
items: filteredCategories.map((category) =>
|
||||
DropdownMenuItem(
|
||||
value: category,
|
||||
child: Text(category.categoryName),
|
||||
|
||||
Reference in New Issue
Block a user