-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
451 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:application/dtos/episode_mapping_dto.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
|
||
class EpisodeTypeComponent extends StatelessWidget { | ||
final EpisodeMappingDto episode; | ||
|
||
const EpisodeTypeComponent({super.key, required this.episode}); | ||
|
||
String _episodeType(BuildContext context) { | ||
switch (episode.episodeType) { | ||
case 'EPISODE': | ||
return AppLocalizations.of(context)!.episode; | ||
case 'SPECIAL': | ||
return AppLocalizations.of(context)!.special; | ||
case 'FILM': | ||
return AppLocalizations.of(context)!.film; | ||
default: | ||
return ''; | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Text( | ||
AppLocalizations.of(context)!.information( | ||
_episodeType(context), | ||
episode.number, | ||
episode.season, | ||
), | ||
style: Theme.of(context).textTheme.bodyMedium, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:application/utils/constant.dart'; | ||
import 'package:cached_network_image/cached_network_image.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class ImageComponent extends StatelessWidget { | ||
final String uuid; | ||
final String type; | ||
final BorderRadius borderRadius; | ||
final double width; | ||
final double height; | ||
|
||
const ImageComponent({ | ||
super.key, | ||
required this.uuid, | ||
this.type = 'image', | ||
this.borderRadius = BorderRadius.zero, | ||
this.width = double.infinity, | ||
this.height = double.infinity, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ClipRRect( | ||
borderRadius: borderRadius, | ||
child: CachedNetworkImage( | ||
imageUrl: '${Constant.apiUrl}/v1/attachments?uuid=$uuid&type=$type', | ||
filterQuality: FilterQuality.high, | ||
fit: BoxFit.cover, | ||
width: width, | ||
height: height, | ||
placeholder: (context, url) => Container( | ||
color: Colors.grey, | ||
width: width, | ||
height: height, | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:application/components/platforms/platform_component.dart'; | ||
import 'package:application/dtos/platform_dto.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class ListPlatform extends StatelessWidget { | ||
final List<PlatformDto> platforms; | ||
|
||
const ListPlatform({super.key, required this.platforms}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Flex( | ||
direction: Axis.horizontal, | ||
children: [ | ||
for (final platform in platforms) | ||
Padding( | ||
padding: const EdgeInsets.only(left: 4), | ||
child: PlatformComponent(platform: platform), | ||
), | ||
], | ||
); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.