Home
Softono
b

baseflow

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
5

Software by baseflow

flutter_cached_network_image
Open Source

flutter_cached_network_image

# Cached network image [![pub package](https://img.shields.io/pub/v/cached_network_image.svg)](https://pub.dartlang.org/packages/cached_network_image) [![codecov](https://codecov.io/gh/Baseflow/flutter_cached_network_image/branch/main/graph/badge.svg?token=I5qW0RvoXN)](https://codecov.io/gh/Baseflow/flutter_cached_network_image) [![Build Status](https://github.com/Baseflow/flutter_cached_network_image/workflows/app_facing_package/badge.svg?branch=develop)](https://github.com/Baseflow/flutter_cached_network_image/actions/workflows/app_facing_package.yaml) A flutter library to show images from the internet and keep them in the cache directory. ## Sponsors <a href="https://getstream.io/chat/flutter/tutorial/?utm_source=Github&utm_medium=Github_Repo_Content_Ad&utm_content=Developer&utm_campaign=Github_Jan2022_FlutterChat&utm_term=renefloor" target="_blank"><img width="250px" src="https://stream-blog.s3.amazonaws.com/blog/wp-content/uploads/fc148f0fc75d02841d017bb36e14e388/Stream-logo-with-background-.png"/></a><br/><span><a href="https://getstream.io/chat/flutter/tutorial/?utm_source=Github&utm_medium=Github_Repo_Content_Ad&utm_content=Developer&utm_campaign=Github_Jan2022_FlutterChat&utm_term=renefloor" target="_blank">Try the Flutter Chat Tutorial đź’¬</a></span> ## How to use The CachedNetworkImage can be used directly or through the ImageProvider. Both the CachedNetworkImage as CachedNetworkImageProvider have minimal support for web. It currently doesn't include caching. With a placeholder: ```dart CachedNetworkImage( imageUrl: "http://via.placeholder.com/350x150", placeholder: (context, url) => CircularProgressIndicator(), errorWidget: (context, url, error) => Icon(Icons.error), ), ``` Or with a progress indicator: ```dart CachedNetworkImage( imageUrl: "http://via.placeholder.com/350x150", progressIndicatorBuilder: (context, url, downloadProgress) => CircularProgressIndicator(value: downloadProgress.progress), errorWidget: (context, url, error) => Icon(Icons.error), ), ``` ````dart Image(image: CachedNetworkImageProvider(url)) ```` When you want to have both the placeholder functionality and want to get the imageprovider to use in another widget you can provide an imageBuilder: ```dart CachedNetworkImage( imageUrl: "http://via.placeholder.com/200x150", imageBuilder: (context, imageProvider) => Container( decoration: BoxDecoration( image: DecorationImage( image: imageProvider, fit: BoxFit.cover, colorFilter: ColorFilter.mode(Colors.red, BlendMode.colorBurn)), ), ), placeholder: (context, url) => CircularProgressIndicator(), errorWidget: (context, url, error) => Icon(Icons.error), ), ``` ## How it works The cached network images stores and retrieves files using the [flutter_cache_manager](https://pub.dartlang.org/packages/flutter_cache_manager). ## FAQ ### My app crashes when the image loading failed. (I know, this is not really a question.) Does it really crash though? The debugger might pause, as the Dart VM doesn't recognize it as a caught exception; the console might print errors; even your crash reporting tool might report it (I know, that really sucks). However, does it really crash? Probably everything is just running fine. If you really get an app crashes you are fine to report an issue, but do that with a small example so we can reproduce that crash. See for example [this](https://github.com/Baseflow/flutter_cached_network_image/issues/336#issuecomment-760769361) or [this](https://github.com/Baseflow/flutter_cached_network_image/issues/536#issuecomment-760857495) answer on previous posted issues.

Storage & Backup Mobile Development
2.6K Github Stars
flutter-permission-handler
Open Source

flutter-permission-handler

# Flutter permission_handler plugin The Flutter permission_handler plugin is build following the federated plugin architecture. A detailed explanation of the federated plugin concept can be found in the [Flutter documentation](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins). This means the permission_handler plugin is separated into the following packages: 1. [`permission_handler`][1]: the app facing package. This is the package users depend on to use the plugin in their project. For details on how to use the `permission_handler` plugin you can refer to its [README.md][2] file. At this moment the Android and iOS platform implementations are also part of this package. Additional platform support will be added in their own individual "platform package(s)". 2. [`permission_handler_platform_interface`][3]: this packages declares the interface which all platform packages must implement to support the app-facing package. Instructions on how to implement a platform packages can be found in the [README.md][4] of the `permission_handler_platform_interface` package. [1]: https://pub.dev/packages/permission_handler [2]: ./permission_handler/README.md [3]: https://pub.dev/packages/permission_handler_platform_interface [4]: ./permission_handler_platform_interface/README.md

Security Mobile Development
2.2K Github Stars
flutter-geolocator
Open Source

flutter-geolocator

# Flutter geolocator plugin The Flutter geolocator plugin is built following the federated plugin architecture. A detailed explanation of the federated plugin concept can be found in the [Flutter documentation](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins). This means the geolocator plugin is separated into the following packages: 1. [`geolocator`][1]: the app facing package. This is the package users depend on to use the plugin in their project. For details on how to use the [`geolocator`][1] plugin you can refer to its [README.md][2] file. 2. [`geolocator_android`][3]: this package contains the endorsed Android implementation of the geolocator_platform_interface and adds Android support to the [`geolocator`][1] app facing package. More information can be found in its [README.md][4] file; 3. [`geolocator_apple`][5]: this package contains the endorsed iOS and macOS implementations of the geolocator_platform_interface and adds iOS and macOS support to the [`geolocator`][1] app facing package. More information can be found in its [README.md][6] file; 4. [`geolocator_web`][7]: this package contains the endorsed web implementation of the geolocator_platform_interface and adds web support to the [`geolocator`][1] app facing package. More information can be found in its [README.md][8] file; 5. [`geolocator_windows`][9]: this package contains the endorsed Windows implementation of the geolocator_platform_interface and adds Windows support to the [`geolocator`][1] app facing package. More information can be found in its [README.md][10] file; 6. [`geolocator_platform_interface`][11]: this package declares the interface which all platform packages must implement to support the app-facing package. Instructions on how to implement a platform package can be found in the [README.md][12] of the [`geolocator_platform_interface`][11] package. [1]: ./geolocator [2]: ./geolocator/README.md [3]: ./geolocator_android [4]: ./geolocator_android/README.md [5]: ./geolocator_apple [6]: ./geolocator_apple/README.md [7]: ./geolocator_web [8]: ./geolocator_web/README.md [9]: ./geolocator_windows [10]: ./geolocator_windows/README.md [11]: ./geolocator_platform_interface [12]: ./geolocator_platform_interface/README.md

Maps & Location Mobile Development
1.3K Github Stars
flutter_cache_manager
Open Source

flutter_cache_manager

<b>BREAKING CHANGES IN V2</b> CacheManager v2 introduced some breaking changes when configuring a custom CacheManager. [See the bottom of this page for the changes.](#breaking-changes-in-v2) # flutter_cache_manager [![pub package](https://img.shields.io/pub/v/flutter_cache_manager.svg)](https://pub.dartlang.org/packages/flutter_cache_manager) [![build](https://github.com/Baseflow/flutter_cache_manager/actions/workflows/build.yaml/badge.svg)](https://github.com/Baseflow/flutter_cache_manager/actions/workflows/build.yaml) [![codecov](https://codecov.io/gh/Baseflow/flutter_cache_manager/branch/master/graph/badge.svg)](https://codecov.io/gh/Baseflow/flutter_cache_manager) A CacheManager to download and cache files in the cache directory of the app. Various settings on how long to keep a file can be changed. It uses the cache-control http header to efficiently retrieve files. The more basic usage is explained here. See the complete docs for more info. ## Usage The cache manager can be used to get a file on various ways The easiest way to get a single file is call `.getSingleFile`. ```dart var file = await DefaultCacheManager().getSingleFile(url); ``` `getFileStream(url)` returns a stream with the first result being the cached file and later optionally the downloaded file. `getFileStream(url, withProgress: true)` when you set withProgress on true, this stream will also emit DownloadProgress when the file is not found in the cache. `downloadFile(url)` directly downloads from the web. `getFileFromCache` only retrieves from cache and returns no file when the file is not in the cache. `putFile` gives the option to put a new file into the cache without downloading it. `removeFile` removes a file from the cache. `emptyCache` removes all files from the cache. ### ImageCacheManager If you use the ImageCacheManager mixin on the CacheManager (which is already done on the DefaultCacheManager) you get the following `getImageFile` method for free: ```dart Stream<FileResponse> getImageFile(String url, { String key, Map<String, String> headers, bool withProgress, int maxHeight, // This is extra int maxWidth, // This is extra as well }) ``` The image from the url is resized within the specifications, and the resized images is stored in the cache. It always tries to keep the existing aspect ratios. The original image is also cached and used to resize the image if you call this method with other height/width parameters. ## Other implementations When your files are stored on Firebase Storage you can use [flutter_cache_manager_firebase](https://pub.dev/packages/flutter_cache_manager_firebase). ## Customize The cache manager is customizable by creating a new CacheManager. It is very important to not create more than 1 CacheManager instance with the same key as these bite each other. In the example down here the manager is created as a Singleton, but you could also use for example Provider to Provide a CacheManager on the top level of your app. Below is an example with other settings for the maximum age of files, maximum number of objects and a custom FileService. The key parameter in the constructor is mandatory, all other variables are optional. ```dart class CustomCacheManager { static const key = 'customCacheKey'; static CacheManager instance = CacheManager( Config( key, stalePeriod: const Duration(days: 7), maxNrOfCacheObjects: 20, repo: JsonCacheInfoRepository(databaseName: key), fileSystem: IOFileSystem(key), fileService: HttpFileService(), ), ); } ``` ## Frequently Asked Questions - [How are the cache files stored?](#how-are-the-cache-files-stored) - [When are the cached files updated?](#when-are-the-cached-files-updated) - [When are cached files removed?](#when-are-cached-files-removed) ### How are the cache files stored? By default the cached files are stored in the temporary directory of the app. This means the OS can delete the files any time. Information about the files is stored in a database using sqflite on Android, iOS and macOs, or in a plain JSON file on other platforms. The file name of the database is the key of the cacheManager, that's why that has to be unique. ### When are the cached files updated? A valid url response should contain a Cache-Control header. More info on the header can be found [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control), but in summary it says for how long the image can be expected to be up to date. It also contains an 'eTag' which can be used to check (after that time) whether the file did change or if it is actually still valid. When a file is in the cache that is always directly returned when calling `getSingleFile` or `getFileStream`. After that the information is check if the file is actually still valid. If the file is outdated according to the Cache-Control headers the manager tries to update the file and store the new one in the cache. When you use `getFileStream` this updated file will also be returned in the stream. ### When are cached files removed? The files can be removed by the cache manager or by the operating system. By default the files are stored in a cache folder, which is sometimes cleaned for example on Android with an app update. The cache manager uses 2 variables to determine when to delete a file, the `maxNrOfCacheObjects` and the `stalePeriod`. The cache knows when files have been used latest. When cleaning the cache (which happens continuously), the cache deletes files when there are too many, ordered by last use, and when files just haven't been used for longer than the stale period. ## Breaking changes in v2 - There is no longer a need to extend on BaseCacheManager, you can directly call the constructor. The BaseCacheManager is now only an interface. CacheManager is the implementation you can use directly. - The constructor now expects a Config object with some settings you were used to, but some are slightly different. For example the system where you want to store your files is not just a dictionary anymore, but a FileSystem. That way you have more freedom on where to store your files. - See the example in [Customize](#customize).

Storage & Backup JavaScript Libraries & Components
808 Github Stars
HugoStructuredData
Open Source

HugoStructuredData

# HugoStructuredData Collection of structured data snippets in Google preferred JSON-LD format, with support for Hugo. Based on the work of: https://github.com/JayHoltslander/Structured-Data-JSON-LD This uses the [Hugo pipelines](https://gohugo.io/themes/theme-components/) introduced in [Hugo 0.42](https://gohugo.io/news/0.42-relnotes/) # Support * Feel free to open an issue. Make sure to use one of the templates! * Commercial support is available. Integration with your app or services, samples, feature request, etc. Email: [[email protected]](mailto:[email protected]) * Powered by: [baseflow.com](https://baseflow.com) # Usage Start by adding this theme to your website in the config file: ``` theme: - your-own-theme - structured-data - some-other-theme ``` Change the properties inside `themes/structured-data/config.yaml` to match you details. Add this snippet to the `<head>` of your baseof.html `{{ partial "schemas/schema_Global.html" . }}` Add `contenttypes` to the parameters of the pages you would like to include the schemes in. ``` --- title: "Some person" date: 2018-03-28T21:58:30+02:00 contenttypes: ["Person"] --- ``` Or another example ``` --- title: "This is a blog and article" date: 2018-03-28T21:58:30+02:00 contenttypes: ["BlogPosting, "Article"] --- ``` Other available properties are: ``` --- type: blog layout: post title: "Introducing blog" date: 2018-06-01T16:40:55+01:00 author: notmartijn contenttypes: ["BlogPosting"] --- ``` In this case the author of the file will be `notmartijn` instead of the default author `martijn`. To add, change or remove locations or authors look in the data folder.

Frontend Templates SEO Tools Static Site Generators
44 Github Stars