responsive_container_ns 0.0.2 copy "responsive_container_ns: ^0.0.2" to clipboard
responsive_container_ns: ^0.0.2 copied to clipboard

A new Flutter project.

Features #

Use percentage for width and height values in any Widget

Getting started #

Add the dependency to your "pubspec.yaml" file. dependencies: flutter: sdk: flutter responsive_container: Import package into your code //... import 'package:responsive_container/responsive_container.dart'; //...

Usage #

You can set the widget height and width percentages from 0 to 100 (double) ResponsiveContainer( heightPercent: 50.0, //value percent of screen total height widthPercent: 50.0, //value percent of screen total width child: Container(color: Colors.red,), //any widget )

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

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {

    return new MaterialApp(
        home: Scaffold(
          appBar: AppBar(title: Text("Responsive Container"),),
          body: Center(

              child: ResponsiveContainer(
                heightPercent: 50.0, //value percent of screen total height
                widthPercent: 50.0,  //value percent of screen total width

                child: Container(color: Colors.red,), //any widget
              )
          ),
        )
    );
  }
}
1
likes
100
pub points
58%
popularity

Publisher

unverified uploader

A new Flutter project.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on responsive_container_ns