MVP #141
@@ -3,6 +3,7 @@ import 'package:game_tracker/core/custom_theme.dart';
|
|||||||
import 'package:game_tracker/data/dto/group.dart';
|
import 'package:game_tracker/data/dto/group.dart';
|
||||||
import 'package:game_tracker/presentation/widgets/text_input/custom_search_bar.dart';
|
import 'package:game_tracker/presentation/widgets/text_input/custom_search_bar.dart';
|
||||||
import 'package:game_tracker/presentation/widgets/tiles/group_tile.dart';
|
import 'package:game_tracker/presentation/widgets/tiles/group_tile.dart';
|
||||||
|
import 'package:game_tracker/presentation/widgets/top_centered_message.dart';
|
||||||
|
|
||||||
class ChooseGroupView extends StatefulWidget {
|
class ChooseGroupView extends StatefulWidget {
|
||||||
final List<Group> groups;
|
final List<Group> groups;
|
||||||
@@ -71,26 +72,35 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: Visibility(
|
||||||
padding: const EdgeInsets.only(bottom: 85),
|
visible: filteredGroups.isNotEmpty,
|
||||||
itemCount: filteredGroups.length,
|
replacement: const TopCenteredMessage(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
icon: Icons.info,
|
||||||
return GestureDetector(
|
title: 'No group',
|
||||||
onTap: () {
|
message: 'There is no group matching your search.',
|
||||||
setState(() {
|
),
|
||||||
if (selectedGroupId != filteredGroups[index].id) {
|
child: ListView.builder(
|
||||||
selectedGroupId = filteredGroups[index].id;
|
padding: const EdgeInsets.only(bottom: 85),
|
||||||
} else {
|
itemCount: filteredGroups.length,
|
||||||
selectedGroupId = '';
|
itemBuilder: (BuildContext context, int index) {
|
||||||
}
|
return GestureDetector(
|
||||||
});
|
onTap: () {
|
||||||
},
|
setState(() {
|
||||||
child: GroupTile(
|
if (selectedGroupId != filteredGroups[index].id) {
|
||||||
group: filteredGroups[index],
|
selectedGroupId = filteredGroups[index].id;
|
||||||
isHighlighted: selectedGroupId == filteredGroups[index].id,
|
} else {
|
||||||
),
|
selectedGroupId = '';
|
||||||
);
|
}
|
||||||
},
|
});
|
||||||
|
},
|
||||||
|
child: GroupTile(
|
||||||
|
group: filteredGroups[index],
|
||||||
|
isHighlighted:
|
||||||
|
selectedGroupId == filteredGroups[index].id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user