A core package that provides some reusable widgets, text, extensions and utils, etc.
Features
- Ready to use paginated
freezed
domain model. - Ready to use some network exceptions.
SizeConfig
for responsive.- Some extensions for
BuildContext
,DateTime
,Dio
andString
. - Some helper classes and functions
- Logger with some colors and types.
- Some common used
rivperpod
providers for instances. Vimeo
video links fetching viaid
YouTube
video links fetching vialink
orid
.
Getting started
You do not need any requirements right now.
Usage
To use this package, all you have to do is to import.
import 'package:smf_core/smf_core.dart';
Vimeo
To get video id from vimeo url
final VimeoRemoteService service = VimeoRemoteService();
final response = await service.fetchVimeoInfoFromUrl(
url: 'https://vimeo.com/29474908',
);
final videoId = await response.when(
data: (info) => info.videoId.toString(),
);
To get list of vimeo
video links
final vimeoService = VimeoRemoteService();
final response = await vimeoService.fetchAllVimeoVideoLinks(
videoId: videoId,
);
final videLinks = await remoteResponse.when(
data: (videos) => videos,
);
YouTube
To get list of youtube
video links
final youtubeService = YoutubeService();
final urls = await youtubeService.getVideoQualityUrlsFromYoutube(
'https://www.youtube.com/watch?v=gYNTcgZVcWw',
);
// Create resolutions map
Map<String, String> resolutionsMap = {};
for (var link in urls.reversed) {
String processedKey = link.quality.toString();
resolutionsMap[processedKey] = link.url;
}
And you can use above urls
and resolutionsMap
within your player.
Additional information
Package repository link is here
Libraries
- domain/domain_result
- domain/fresh
- domain/paginated_data
- infrastructure/network_exceptions
- infrastructure/network_result
- infrastructure/response_info_dto
- presentation/widgets/common/hide_keyboard
- presentation/widgets/common/placeholder/image_placeholder
- presentation/widgets/common/smf_container
- presentation/widgets/common/smf_dividers
- presentation/widgets/common/text_field/otp_intput
- presentation/widgets/widgets
- shared/config/size_config
- shared/extensions/contextx
- shared/extensions/datetimex
- shared/extensions/diox
- shared/extensions/intx
- shared/extensions/stringx
- shared/helper/api_utils
- shared/helper/datetime_utils
- shared/helper/global_utils
- shared/helper/image_utils
- shared/logging/logger
- shared/providers/core_providers
- smf_core
- vimeo/domain/vimeo_failure
- vimeo/domain/vimeo_video_link
- vimeo/feat_vimeo
- vimeo/infrastructure/extensions
- vimeo/infrastructure/service/vimeo_remote_service
- vimeo/infrastructure/vimeo_config_dto
- vimeo/infrastructure/vimeo_error_response_dto
- vimeo/infrastructure/vimeo_exceptions
- vimeo/infrastructure/vimeo_files_dto
- vimeo/infrastructure/vimeo_link_info_dto
- vimeo/infrastructure/vimeo_repository
- vimeo/infrastructure/vimeo_request_dto
- vimeo/infrastructure/vimeo_response
- vimeo/infrastructure/vimeo_video_link_dto
- youtube/feat_youtube
- youtube/helpers/yt_helper
- youtube/models/youtube_video_quality_url
- youtube/service/youtube_service