multi_screen_layout 0.0.1 copy "multi_screen_layout: ^0.0.1" to clipboard
multi_screen_layout: ^0.0.1 copied to clipboard

outdated

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!'),
          ],
        ),
      ),
    );
  }
}
26
likes
0
pub points
57%
popularity

Publisher

verified publisherjasonrai.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