multi_screen_layout 0.0.1 icon indicating copy to clipboard operation
multi_screen_layout: ^0.0.1 copied to clipboard

[pending analysis]

A collection of Widgets that make multi screen user experiences easy to build

example/lib/main.dart

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

void main() {
  runApp(MaterialApp(home: MyApp()));
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return TwoPageLayout(
      child: _buildMainPage(),
      secondChild: _buildSecondPage(),
    );
  }

  Widget _buildMainPage() {
    return Scaffold(
      appBar: AppBar(
        title: Text('Main Page'),
      ),
      body: Center(
        child: MultiScreenInfo(
          builder: (info) {
            return Column(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                Text('This page always displays!'),
                Text(
                    'isDualScreenDevice: ${info.surfaceDuoInfoModel.isDualScreenDevice}'),
                Text('isAppSpanned: ${info.surfaceDuoInfoModel.isSpanned}'),
                Text('hingeAngle: ${info.surfaceDuoInfoModel.hingeAngle}'),
                RaisedButton(
                  child: Text('Test'),
                  onPressed: () {
                    MultiScreenPlatformHandler.getInfoModel();
                  },
                ),
              ],
            );
          },
        ),
      ),
    );
  }

  Widget _buildSecondPage() {
    return Scaffold(
      appBar: AppBar(
        title: Text('Second Page'),
      ),
      backgroundColor: Colors.tealAccent,
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            Text('This page only shows when spanned on 2 screens!'),
          ],
        ),
      ),
    );
  }
}
17
likes
--
pub points
--%
popularity

Publisher

verified publisher iconjasonrai.ca

A collection of Widgets that make multi screen user experiences easy to build

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on multi_screen_layout