playx 0.2.2
playx: ^0.2.2 copied to clipboard
Playx eco system helps with redundant features as it provides many utilities for themes, widgets and more.
Playx #
Playx eco system helps with redundant features as it provides many utilities for themes, widgets and more.
Features #
Prefs: Key value pair storage powered bySharedPreferences.PlayX.runPlayX: WrapsrunAppto inject , init ..etc what ever is necessary for using this package.PlayXAppConfig: Install and setup any dependencies that are required by the app.AppTheme: Easily create and mange app theme with the ability to easily change app theme.playx_widget:Contains custom utility widgets to make development faster likeOptimizedScrollView,ImageViewer,AppVersionand more.playx_network: Wrapper around Dio that can perform API requests with better error handling and easily get the result of any API request.exports: packages likeGet,queen_validators,readable,playx_theme,package_info_plus,flutter_svgandcached_network_image,lottie,asyncandsentryto make it easy to update packages from one place. If you have many projects that depend on these packages you will need to update onlyplayxpackage.
Installation #
In pubspec.yaml add these lines to dependencies
playx: ^0.2.2
Usage #
- create an app config class that extends
PlayxAppConfig:
class AppConfig extends PlayXAppConfig {
@override
String get appTitle => "Sourcya App";
// setup and boot your dependencies here
@override
Future<void> boot() async {
final ApiClient client = ApiClient(dio);
Get.put<ApiClient>(client);
}
}
- Create theme config to customize your app theme. defaults to:
class XDefaultThemeConfig extends XThemeConfig {
@override
List<XTheme> get themes => [
XTheme(
id: 'dark',
nameBuilder: () => 'Dark',
theme: ThemeData.dark(),
colorScheme:LightColorScheme(),
),
XTheme(
id: 'light',
nameBuilder: () => 'Light',
theme: ThemeData.light(),
colorScheme:DarkColorScheme(),
),
];
}
For more information about how to customize app theme check out playx_theme
- in
mainmethod callPlayX.runPlayXinstead ofrunAppIt will setup any dependencies in app config, initialize app theme and run the app. usePlayxMaterialAppto configure orientation, theme , screen util and get material app settings.
void main() async {
Playx.runPlayx(
appConfig: AppConfig(),
themeConfig: ThemeConfig(),
//If sentry is needed in the project.
sentryOptions: (options) {
options.dsn = AppConfig.sentryKey;
},
app:PlayxMaterialApp(
debugShowCheckedModeBanner: false,
theme: xTheme.theme,
title: 'playx',
),
);
}
See Also: #
playx_core : core package of playx.
Playx_theme :multi theme features for flutter apps from playx eco system
Playx_widget : Contains custom utility widgets to make development faster.