multiscreen 1.0.4 copy "multiscreen: ^1.0.4" to clipboard
multiscreen: ^1.0.4 copied to clipboard

outdated

Support multiscreen(different resolution and size of display) for mobile application.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.light(),
      home: _MyPage(),
    );
  }
}

class _MyPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _MyPageState();
  }
}

class _MyPageState extends State<_MyPage> {
  @override
  Widget build(BuildContext context) {
    /// init Multiscreen instance.
    Multiscreen.init(context, 360);
    return Container(
      color: Colors.white,
      /// resize using Multiscreen.
      margin: EdgeInsets.only(top: Multiscreen.instance.resize(80)),
      child: Align(
        alignment: Alignment.center,
        child: Column(children: <Widget>[
          MaterialButton(
            color: Colors.blue,
            height: Multiscreen.instance.resize(40),
            minWidth: Multiscreen.instance.resize(280),
            child: Text(
              'text',
              style: TextStyle(
                  color: Colors.white,
                  fontSize: Multiscreen.instance.resize(16)),
            ),
            onPressed: () {},
          ),
          MaterialButton(
            color: Colors.blue,
            height: Multiscreen.instance.resize(40),
            minWidth: Multiscreen.instance.resize(300),
            child: Text(
              'text',
              style: TextStyle(
                  color: Colors.white,
                  fontSize: Multiscreen.instance.resize(16)),
            ),
            onPressed: () {},
          ),
          MaterialButton(
            color: Colors.blue,
            height: Multiscreen.instance.resize(40),
            minWidth: Multiscreen.instance.resize(320),
            child: Text(
              'text',
              style: TextStyle(
                  color: Colors.white,
                  fontSize: Multiscreen.instance.resize(16)),
            ),
            onPressed: () {},
          ),
          MaterialButton(
            color: Colors.blue,
            height: Multiscreen.instance.resize(40),
            minWidth: Multiscreen.instance.resize(340),
            child: Text(
              'text',
              style: TextStyle(
                  color: Colors.white,
                  fontSize: Multiscreen.instance.resize(16)),
            ),
            onPressed: () {},
          ),
          MaterialButton(
            color: Colors.blue,
            height: Multiscreen.instance.resize(40),
            minWidth: Multiscreen.instance.resize(360),
            child: Text(
              'text',
              style: TextStyle(
                  color: Colors.white,
                  fontSize: Multiscreen.instance.resize(16)),
            ),
            onPressed: () {},
          ),
        ]),
      ),
    );
  }
}
5
likes
0
pub points
51%
popularity

Publisher

unverified uploader

Support multiscreen(different resolution and size of display) for mobile application.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on multiscreen