Skip to content
pubscout

adaptive_screen_utils

2.4.0, released 2 years ago by voltvave.com

Flutter package for creating responsive UIs based on screen size and orientation.

WASM-ready
$ flutter pub add adaptive_screen_utils
Source repository

What it does

Adaptive screen utils provides methods to check screen size categories like wearable, compact, medium, and expanded based on width, height, and orientation. It allows developers to build responsive UIs that adapt to mobile, tablet, and desktop screens.

AI-written summary of version 2.4.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to build a responsive Flutter UI targeting multiple form factors like mobile, tablet, and desktop.
  • You want a simple utility to check screen size classes using methods like compact, medium, and expanded.

Skip it when

  • You require complex, highly customized grid systems or advanced constraint-based layouts.
  • You prefer heavy declarative layout frameworks with comprehensive breakpoint builders.

Strengths

  • Supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux.
  • Provides simple extension methods and functions to easily identify device types.
  • Inspired by Android window size classes for intuitive responsive design.

Weaknesses

  • The approach to determining device types based on width, height, and orientation is a simple approach and may not be accurate for all devices.
  • Limited documentation on advanced responsive scaling features compared to larger layout packages.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Just add the dependency to pubspec.yaml and import the package.

import 'package:adaptive_screen_utils/adaptive_screen_utils.dart';

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final desktop = expanded(context);
    final tablet = medium(context);
    return Scaffold(
      appBar: AppBar(
        title: Text('Adaptive Screen Utils'),
      ),
      body: Builder(
        builder: (context) {
         if (desktop) {
            return Center(child: Text('Desktop'));
          } else if (tablet) {
            return Center(child: Text('Tablet'));
          }
          return Center(child: Text('Mobile'));
        },
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace adaptive_screen_utils.

  • responsive_framework

    Choose this for a more robust scaling and resizing framework across diverse screen dimensions.

  • responsive_builder

    Choose this if you prefer builder widgets specifically targeted at screen size breakpoints.

  • sizer

    Choose this if you prefer sizing elements relative to screen width and height percentages.