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

This Flutter package provides a set of utilities and widgets to make your app responsive across different device types and screen sizes.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return ResponsiveBuilder(
      builder: (context, constraints, orientation) {
        return MaterialApp(
          title: 'My Responsive App',
          theme: ThemeData(
            // Your app theme
          ),
          home: Scaffold(
            appBar: AppBar(
              title: Text('Responsive App'),
            ),
            body: AdaptiveContainer(
              mobile: MobileWidget(),
              tablet: TabletWidget(),
              desktop: DesktopWidget(),
            ),
          ),
        );
      },
    );
  }
}

class MobileWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Text('Mobile Layout', style: TextStyle(fontSize: 2.t),),
    );
  }
}

class TabletWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Text('Tablet Layout', style: TextStyle(fontSize: 3.t),),
    );
  }
}

class DesktopWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Text('Desktop Layout', style: TextStyle(fontSize: 4.t),),
    );
  }
}
2
likes
140
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

This Flutter package provides a set of utilities and widgets to make your app responsive across different device types and screen sizes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_responsive_util