LabWork05 add dispose for searchController
This commit is contained in:
parent
59b3bb7008
commit
2523f8b0d1
33
lib/data/dtos/characters_dto.g.dart
Normal file
33
lib/data/dtos/characters_dto.g.dart
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'characters_dto.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
CharactersDto _$CharactersDtoFromJson(Map<String, dynamic> json) =>
|
||||||
|
CharactersDto(
|
||||||
|
data: (json['data'] as List<dynamic>?)
|
||||||
|
?.map((e) => CharacterDataDto.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
CharacterDataDto _$CharacterDataDtoFromJson(Map<String, dynamic> json) =>
|
||||||
|
CharacterDataDto(
|
||||||
|
id: json['id'] as String?,
|
||||||
|
type: json['type'] as String?,
|
||||||
|
attributes: json['attributes'] == null
|
||||||
|
? null
|
||||||
|
: CharacterAttributesDataDto.fromJson(
|
||||||
|
json['attributes'] as Map<String, dynamic>),
|
||||||
|
);
|
||||||
|
|
||||||
|
CharacterAttributesDataDto _$CharacterAttributesDataDtoFromJson(
|
||||||
|
Map<String, dynamic> json) =>
|
||||||
|
CharacterAttributesDataDto(
|
||||||
|
name: json['name'] as String?,
|
||||||
|
born: json['born'] as String?,
|
||||||
|
died: json['died'] as String?,
|
||||||
|
image: json['image'] as String?,
|
||||||
|
);
|
@ -84,6 +84,12 @@ class _BodyState extends State<Body> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
searchController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
@ -108,17 +114,19 @@ class _BodyState extends State<Body> {
|
|||||||
builder: (context, snapshot) => SingleChildScrollView(
|
builder: (context, snapshot) => SingleChildScrollView(
|
||||||
child: snapshot.hasData
|
child: snapshot.hasData
|
||||||
? Column(
|
? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: snapshot.data?.map((data) {
|
children: snapshot.data?.map((data) {
|
||||||
return _Comment.fromData(
|
return _Comment.fromData(
|
||||||
data,
|
data,
|
||||||
onAction: (String nickname, bool isLiked, bool isDisliked) =>
|
onAction: (String nickname, bool isLiked,
|
||||||
_showSnackBar(context, nickname, isLiked, isDisliked),
|
bool isDisliked) =>
|
||||||
onTap: () => _navToDetails(context, data),
|
_showSnackBar(context, nickname, isLiked,
|
||||||
);
|
isDisliked),
|
||||||
}).toList() ??
|
onTap: () => _navToDetails(context, data),
|
||||||
[],
|
);
|
||||||
)
|
}).toList() ??
|
||||||
|
[],
|
||||||
|
)
|
||||||
: const CircularProgressIndicator(),
|
: const CircularProgressIndicator(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user