smf_core 0.0.2 smf_core: ^0.0.2 copied to clipboard
A core package that provides some reusable widgets, text, extensions and utils, etc.
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.
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 list of vimeo
video links
final Dio dio = Dio();
final VimeoRemoteService service = VimeoRemoteService(dio);
final VimeoRepository repository = VimeoRepository(service);
final failureOrSuccess = await _repository.getVimeoVideoLinks(videoId);
failureOrSuccess.fold(
(failure) {
// do something with failure
},
(links) {
// do something with links
},
);
YouTube #
To get list of youtube
video links
final urls = await YtHelper.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
adn resolutionsMap
within your player.
Additional information #
Package repository link is here