km_screen 0.0.2 copy "km_screen: ^0.0.2" to clipboard
km_screen: ^0.0.2 copied to clipboard

A package for device screens

km_screen #

This package is a wrap of Media Query

Usage #

  1. KMScreen is set up by MaterialApp or WdigetApp in ancestor Context.
  2. Refer to various properties at any place.
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'My App',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: BottomNavigationWidget(),
    );
  }
}

class BottomNavigationWidget extends StatelessWidget {
  final List<Widget> _tabItem = [
    HomeWidget(),
    SettingWidget(),
  ];

  @override
  Widget build(BuildContext context) {
    // KMScreen setup
    KMScreen.setup(context: context);
    print("width: ${KMScreen.size.width}, height: ${KMScreen.size.height}");

    return _mainWidget();
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A package for device screens

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on km_screen