responsive_sizer 1.0.0+4 copy "responsive_sizer: ^1.0.0+4" to clipboard
responsive_sizer: ^1.0.0+4 copied to clipboard

outdated

Responsive_sizer helps implement a reponsive layout by providing helper widgets and extensions.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ResponsiveSizer(
      child: MaterialApp(
        title: 'Responsive Sizer Example',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: Home(),
      ),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: [
        Container(
          height: 12.5.h,
          width: 50.w,
          color: Colors.black,
        ),
        Text(
          "This text is responsive",
          style: TextStyle(fontSize: 12.sp),
        ),
        Device.orientation == Orientation.portrait
            ? Text("My Orientation is Portrait")
            : Text("My Orientation is Landscape"),
        Device.screenType == ScreenType.tablet
            ? Text("My Screen's Type is a Tablet")
            : Text("My Screen's Type is a Phone")
      ],
    );
  }
}
565
likes
0
pub points
98%
popularity

Publisher

verified publisherhanstan.link

Responsive_sizer helps implement a reponsive layout by providing helper widgets and extensions.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on responsive_sizer