appsize 1.2.1 copy "appsize: ^1.2.1" to clipboard
appsize: ^1.2.1 copied to clipboard

A Flutter package for Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple.

example/lib/main.dart

import 'package:appsize/appsize.dart';
import 'package:example/screens/home_screen.dart';
import 'package:example/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

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

class AppSizes extends StatefulWidget {
  const AppSizes({super.key});

  @override
  State<AppSizes> createState() => _AppSizesState();
}

class _AppSizesState extends State<AppSizes> {
  @override
  void initState() {
    super.initState();

    WidgetsBinding.instance.addPostFrameCallback((_) async {
      await Future.wait([
        SystemChrome.setPreferredOrientations([
          DeviceOrientation.portraitUp,
          DeviceOrientation.portraitDown,
          DeviceOrientation.landscapeLeft,
          DeviceOrientation.landscapeRight,
        ]),
        SystemChrome.setEnabledSystemUIMode(
          SystemUiMode.manual,
          overlays: SystemUiOverlay.values,
        ),
      ]);
    });
  }

  @override
  Widget build(BuildContext context) {
    return AppSize.child(
      child: const MyApp(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Sizer',
      theme: ThemeData.light().theme,
      home: const HomeScreen(),
    );
  }
}
11
likes
150
points
39
downloads

Publisher

verified publishermibus-app.com.ar

Weekly Downloads

A Flutter package for Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, universal_io

More

Packages that depend on appsize