Flutter Package to Simplify Adaptive Screen Management

Adaptive Screen Orientation

Flutter package to simplify Adaptive Screen Management for mobile, tablet, and desktop with screen breakpoints and orientation.

Features

  • Update UI when orientation or layout size change.
  • Only need to specify screen for mobile, tablet, and desktop.
  • Change breakpoint pixel easily

Usage

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add adaptive_screen_orientation

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  adaptive_screen_orientation: ^1.0.2

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:adaptive_screen_orientation/adaptive_screen_orientation.dart'; 

example/lib/main.dart

import 'package:adaptive_screen_orientation/adaptive_screen_orientation.dart';
import 'package:example/src/screens/desktop.dart';
import 'package:example/src/screens/mobile_landscape.dart';
import 'package:example/src/screens/mobile_portrait.dart';
import 'package:example/src/screens/tablet_landscape.dart';
import 'package:example/src/screens/tablet_portrait.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Column(
          children: [
            AdaptiveScreenOrientation(
              useAvailableLayout: false,
              mobilePortrait: MobilePortrait(),
              mobileLandscape: MobileLandscape(),
              tabletPortrait: TabletPortrait(),
              tabletLandscape: TabletLandscape(),
              desktop: Desktop(),
            ),
          ],
        ),
      ),
    );
  }
} 

Download details:

Author: effmuhammad

Source: https://github.com/effmuhammad/adaptive_screen_orientation

#screen  #android #ios 

Flutter Package to Simplify Adaptive Screen Management
1.10 GEEK