flutter_resources 0.0.4 copy "flutter_resources: ^0.0.4" to clipboard
flutter_resources: ^0.0.4 copied to clipboard

outdated

Flutter resources managment plugin.

flutter_resources #

Flutter resources managment plugin.

Getting Started #

  1. Import library.
import 'package:flutter_resources/flutter_resources.dart';
  1. Create resource delegates. For example:
class IntResources extends ResourceDelegate<int> {
  
  @override
  Map<String, Resource<int>> get resources => {
    'name': Resource(15, [
      ResourceOption(5,
        screenSize: ScreenSize.normal,
        displayMetrics: DisplayMetrics.h,
      )
    ]),
    'custom': Resource(10, [
      ResourceOption(2,
        displayMetrics: DisplayMetrics.xh,
        screenSize: ScreenSize.normal,
        displayMetrics: DisplayMetrics.h,
        orientation: Orientation.landscape,
        languageCode: 'en',
        countryCode: 'US',
        platform: PlatformType.Android,
      )
    ])
  };

}

If no one options not conditions will be returned default value.

  1. Put Resources widget before App widget.
Resources( 
    delegates: [
        IntResources(),
        ... // Some resource delegates.
    ],
    child: MaterialApp(), 
)
  1. Get data.
final resources = Resources.of(context);
final custom = resources.get<int>('custom');

Support options #

  • displayMetrics (s, m, h, xh, xxh, xxxh);
  • screenSize (small, normal, large);
  • orientation (portrait, landscape);
  • brightness (dark, light);
  • platform (web, android, ios, fuchsia, macOS, linux, windows)
  • languageCode;
  • countryCode;
3
likes
0
pub points
46%
popularity

Publisher

unverified uploader

Flutter resources managment plugin.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_resources