smf_core 1.0.1 copy "smf_core: ^1.0.1" to clipboard
smf_core: ^1.0.1 copied to clipboard

outdated

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 and String.
  • Some helper classes and functions
  • Logger with some colors and types.
  • Some common used rivperpod providers for instances.
  • Vimeo video links fetching via id
  • YouTube video links fetching via link or id.

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 VimeoService service = VimeoService();

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 = VimeoService();
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

2
likes
0
pub points
22%
popularity

Publisher

unverified uploader

A core package that provides some reusable widgets, text, extensions and utils, etc.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dartz, dio, flutter, flutter_native_image, flutter_riverpod, freezed_annotation, intl, json_annotation, shared_preferences, url_launcher, xml, youtube_explode_dart

More

Packages that depend on smf_core