responsive_x 0.1.1 copy "responsive_x: ^0.1.1" to clipboard
responsive_x: ^0.1.1 copied to clipboard

A simple Flutter package to handle responsiveness using extensions

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (context, constraints) {
        return OrientationBuilder(
          builder: (context, orientation) {
            SizeConfig(
              designScreenWidth: 360,
              designScreenHeight: 640,
            ).init(constraints, orientation);

            return MaterialApp(
              title: 'Flutter Demo',
              theme: ThemeData(
                primarySwatch: Colors.blue,
                visualDensity: VisualDensity.adaptivePlatformDensity,
              ),
              home: MyHomePage(),
            );
          },
        );
      },
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Container(
          height: 200.height,
          width: 200.width,
          color: Colors.pink,
          child: Center(
            child: Text(
              'ResponsiveX',
              style: TextStyle(
                fontSize: 20.fontSize,
                color: Colors.white,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
        ),
      ),
    );
  }
}
14
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A simple Flutter package to handle responsiveness using extensions

Repository (GitHub)
View/report issues

License

BSD-2-Clause (license)

Dependencies

flutter

More

Packages that depend on responsive_x