center_the_widgets 1.0.0+2 copy "center_the_widgets: ^1.0.0+2" to clipboard
center_the_widgets: ^1.0.0+2 copied to clipboard

Sometimes you want to deploy your mobile design-based app for large screens on the web or desktop, and you didn't write any code to make it responsive! CenterTheWidgets is developed to handle this for you.

example/lib/main.dart

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

void main() {
  runApp(
    const MaterialApp(
      home: CenterTheWidgets(
        child: Example(),
        color: Colors.blueGrey,
      ),
    ),
  );
}

class Example extends StatelessWidget {
  const Example({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Example Appbar'),
      ),
      body: Center(
        child: Container(
          margin: const EdgeInsets.symmetric(horizontal: 32),
          width: 200000,
          height: 300,
          color: Colors.orange,
          alignment: Alignment.center,
          child: const Text('Some widgets...'),
        ),
      ),
      bottomSheet: Container(
        color: Colors.green,
        width: MediaQuery.of(context).size.width,
        padding: const EdgeInsets.symmetric(vertical: 16),
        child: const Text(
          'This is a bottomSheet.',
          textAlign: TextAlign.center,
        ),
      ),
    );
  }
}
4
likes
150
points
2
downloads

Publisher

verified publishergabrimatic.info

Weekly Downloads

Sometimes you want to deploy your mobile design-based app for large screens on the web or desktop, and you didn't write any code to make it responsive! CenterTheWidgets is developed to handle this for you.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on center_the_widgets