responsive_s 0.0.1 copy "responsive_s: ^0.0.1" to clipboard
responsive_s: ^0.0.1 copied to clipboard

Responsive pachage that control size and font as you want to make responsive.

Responsive Logo

Pub.dev Badge

Responsive_s #

Build any app with your optional responsive for width ,height and font size.

Responsive give many optional parameters to control responsive way:

  • static size means the size will be keeping;
  • size change depending on orientation means the width and height will be bigger or smaller depending on orientation of device;
  • size change depending on orientation method is not active on website or TV screen;
  • The package automatically detect screen type;

Usage #

//this example shows the normal responsive.
@override
Widget build(BuildContext context) {
  //the default value of responsive method is staticSize.
  //it's only introductory values.you can change it later.
  Responsive responsive = Responsive(context,
      width: 30, height: 40, responsiveMethod: ResponsiveMethod.staticSize);
  return SafeArea(
    child: Center(
      child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              padding: EdgeInsets.all(5),
              color: Colors.yellow.shade100,
              //30 mean 30% of screen width.
              width: responsive.setWidth(70),
              //40 mean 40% of screen height.
              height: responsive.setHeight(30),
              child: Text(
                'fontSize:${responsive.setFont(14)
                    .roundToDouble()}\nResponsiveMethod:staticSize\ncustomSize:unActive',
                style: TextStyle(fontSize: responsive.setFont(14)),
              ),
            )
          ]),
    ),
  );
}

Result:

  • phone:

test result test result

  • web:

test result

//in this example we shows the custom responsive.
//when custom responsive is not null ,the widget  changes
//the width/height to custom width/height when device is flipped.
//NOTE:this property only for phone... the website don't respond to it
@override
Widget build(BuildContext context) {
  Responsive responsive = Responsive(
    context,
  );
  return SafeArea(
    child: Center(
      child: Container(
        //50 mean 50% of width on portrait orientation and 70 mean
        //70% of  width on landscape orientation.
        width: responsive.setWidth(50, customWidth: 70),
        //70 mean 70% of width on portrait orientation and 50 mean
        //50% of  width on landscape orientation.
        height: responsive.setHeight(70, customHeight: 50),
        color: Colors.greenAccent,
        child: Text(
          'fontSize:${responsive.setFont(8)
              .roundToDouble()}\nResponsiveMethod:staticSize\ncustomSize:Active',
          style: TextStyle(fontSize: responsive.setFont(8)),
        ),
      ),
    ),
  );
}

Result:

  • phone:

test result test result

  • web:

test result

//In this example we will show the responsive when  you give
//SizeChangesDependingOnOrientation to responsive methode.
//desktop and TV don't change according to responsive method.
//If the custom property don't equal to null,then the responsive method
//don't have any active.
@override
Widget build(BuildContext context) {
  Responsive responsive = Responsive(context,
      responsiveMethod: ResponsiveMethod.SizeChangesDependingOnOrientation);
  return SafeArea(
      child: Center(
        child: Container(
          color: Colors.orange,
          width: responsive.setWidth(40),
          height: responsive.setHeight(50),
          child: Text(
            'fontSize:${responsive.setFont(4)
                .floor()}\nResponsiveMethod:SizeChangesDependingOnOrientation\ncustomSize:unActive',
            style: TextStyle(fontSize: responsive.setFont(8, customFont: 12)),
          ),
        ),
      ));
}

Result:

  • phone:

test result test result

  • web:

test result

Overview #

Until now,this package offer many responsive function depending on device:

  • for phone , tablet and ipad:
    • responsive size and responsive font .
    • optional size and font responsive(when device is flipped).
    • remove padding.
    • custom responsive font.
  • for pc/laptop and TV:
    • size and font responsive.
4
likes
150
points
39
downloads

Publisher

unverified uploader

Weekly Downloads

Responsive pachage that control size and font as you want to make responsive.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on responsive_s