proxy_layout 2.1.0 copy "proxy_layout: ^2.1.0" to clipboard
proxy_layout: ^2.1.0 copied to clipboard

outdated

Package to select layout per orientation or device size like mobile vs tablet layouts or portrait vs landscape, they can be combine to support full layout customization.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Proxy Layout Home Page'),
      ),
      body: DeviceProxy(
        mobileBuilder: (_) => OrientationProxy(
          landscapeBuilder: (_) => MyMobileLandscapeContent(),
          portraitBuilder: (_) => MyMobilePortraitContent(),
        ),
        tabletBuilder: (_) => OrientationProxy(
          landscapeBuilder: (_) => MyTabletLandscapeContent(),
          portraitBuilder: (_) => MyTabletPortraitContent(),
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

class MyMobilePortraitContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(child: Text('Mobile portrait content'));
  }
}

class MyMobileLandscapeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(child: Text('Mobile landscape content'));
  }
}

class MyTabletPortraitContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(child: Text('Tablet portrait content'));
  }
}

class MyTabletLandscapeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(child: Text('Tablet landscape content'));
  }
}
4
likes
30
pub points
65%
popularity

Publisher

verified publisherjaumard.com

Package to select layout per orientation or device size like mobile vs tablet layouts or portrait vs landscape, they can be combine to support full layout customization.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on proxy_layout