playx 0.1.0 copy "playx: ^0.1.0" to clipboard
playx: ^0.1.0 copied to clipboard

Playx eco system helps with redundant features as it provides many utilities for themes, widgets and more.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:playx/playx.dart';
import 'package:playx_example/colors/base_color_scheme.dart';
import 'package:playx_example/config/theme_config.dart';

import 'config/app_config.dart';

void main() async {
  final config = AppConfig();

  Playx.runPlayx(
    appConfig: config,
    themeConfig: const AppThemeConfig(),
    app: const MyApp(),
    //not necessary
    sentryOptions: (options) {
      options.dsn = AppConfig.sentryKey;
    },
  );
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PlayXThemeBuilder(
      builder: (xTheme) {
        return MaterialApp(
          title: 'Flutter Demo',
          theme: xTheme.theme,
          home: Scaffold(
            appBar: AppBar(
              title: const Text('Playx Example'),
            ),
            body: OptimizedScrollView(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  Container(
                    width: context.width * .5,
                    color: colorScheme.onBackground,
                    padding: const EdgeInsets.all(8),
                    child: Text(
                      AppTheme.name,
                      style: TextStyle(color: colorScheme.background),
                    ),
                  ),
                  const AppVersion(),
                  ImageViewer.network(
                    'https://avatars.githubusercontent.com/u/35397170?s=200&v=4',
                    height: 100,
                  ),
                  CachedNetworkImage(
                    imageUrl:
                        'https://avatars.githubusercontent.com/u/35397170?s=200&v=4',
                    height: 100,
                  ),
                  SizedBox(
                    height: 300,
                    child: AutoAnimatedList(
                      items: ['Ahmed', 'Mohamed'],
                      itemBuilder: (c, item, index) {
                        return Text(item);
                      },
                    ),
                  )
                ],
              ),
            ),
            floatingActionButton: const FloatingActionButton(
              onPressed: AppTheme.next,
              tooltip: 'Increment',
              child: Icon(Icons.add),
            ),
          ),
        );
      },
    );
  }
}
1
likes
0
pub points
51%
popularity

Publisher

verified publisherplayx.sourcya.io

Playx eco system helps with redundant features as it provides many utilities for themes, widgets and more.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

async, fimber, flutter, flutter_readable, playx_core, playx_theme, playx_widget, queen_validators, sentry_flutter

More

Packages that depend on playx