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

outdated

The best way to create responsive layouts for dynamic screen sizes.

example/main.dart

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

// ignore: must_be_immutable
class Home extends StatelessWidget {
  int built = 0;

  Widget customDrawer() {
    return Flexible(
      flex: 1,
      child: Container(
        color: Colors.blue[800],
        child: ListView(
          children: [
            Material(
                color: Colors.blueAccent,
                child: ListTile(
                  leading: Icon(Icons.home),
                  selected: true,
                  title: Text('Home', style: TextStyle(color: Colors.white)),
                  onTap: () {},
                ))
          ],
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    built++;
    return SuperLayoutBuilder(
      triggerWidth: [850],
      triggerHeight: [500],
      builder: (c, m) => Scaffold(
        drawer: m.size.width <= 850 ? customDrawer() : null,
        appBar: AppBar(
          elevation: 0,
          title: Text('Home'),
        ),
        body: Column(
          children: <Widget>[
            Expanded(
              child: Row(
                children: <Widget>[
                  m.size.width <= 850 ? Container() : customDrawer(),
                  Flexible(
                    flex: 4,
                    child: Container(
                      child: Text('Times built: $built',
                          style: TextStyle(fontSize: 32)),
                    ),
                  )
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
6
likes
30
pub points
24%
popularity

Publisher

verified publishercleancode.dev

The best way to create responsive layouts for dynamic screen sizes.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

bloc_pattern, flutter, rxdart

More

Packages that depend on super_layout_builder