media_break_points 1.0.0 copy "media_break_points: ^1.0.0" to clipboard
media_break_points: ^1.0.0 copied to clipboard

This package allows you to apply values depending on media breakpoint provided.

example/example.dart

import 'package:flutter/material.dart';
import 'package:media_break_points/media_break_points.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue, fontFamily: "OpenSans"),
      home: Scaffold(
        appBar: AppBar(
          title: Text("Example breakpoints"),
        ),
        body: LayoutBuilder(builder: (context, constraints) {
          return Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Container(
                  color: valueFor<Color>(context,
                      xs: Colors.red,
                      sm: Colors.green,
                      md: Colors.black,
                      lg: Colors.purple,
                      xl: Colors.yellow),
                  width: valueFor<double>(
                    context,
                    xs: 100,
                    sm: 200,
                    md: 300,
                    lg: 400,
                    xl: 500,
                  ),
                  height: valueFor<double>(
                    context,
                    xs: 400,
                    sm: 300,
                    md: 200,
                    lg: 100,
                    xl: 50,
                  ),
                ),
              ],
            ),
          );
        }),
      ),
    );
  }
}
3
likes
140
pub points
0%
popularity

Publisher

unverified uploader

This package allows you to apply values depending on media breakpoint provided.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on media_break_points