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

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) {
    debugPrint('resize(20) = ${resize(20)}');
    return Container(
      color: Colors.white,

      /// resize using Multiscreen.
      margin: EdgeInsets.only(top: resize(80)),
      child: Align(
        alignment: Alignment.center,
        child: Column(children: <Widget>[
          MaterialButton(
            color: Colors.blue,
            height: resize(40),
            minWidth: resize(280),
            child: Text(
              'text',
              style: TextStyle(color: Colors.white, fontSize: resize(16)),
            ),
            onPressed: () {},
          ),
          MaterialButton(
            color: Colors.blue,
            height: resize(40),
            minWidth: resize(300),
            child: Text(
              'text',
              style: TextStyle(color: Colors.white, fontSize: resize(16)),
            ),
            onPressed: () {},
          ),
          MaterialButton(
            color: Colors.blue,
            height: resize(40),
            minWidth: resize(320),
            child: Text(
              'text',
              style: TextStyle(color: Colors.white, fontSize: resize(16)),
            ),
            onPressed: () {},
          ),
          MaterialButton(
            color: Colors.blue,
            height: resize(40),
            minWidth: resize(340),
            child: Text(
              'text',
              style: TextStyle(color: Colors.white, fontSize: resize(16)),
            ),
            onPressed: () {},
          ),
          MaterialButton(
            color: Colors.blue,
            height: resize(40),
            minWidth: resize(360),
            child: Text(
              'text',
              style: TextStyle(color: Colors.white, fontSize: 16.0.resize360),
            ),
            onPressed: () {},
          ),
        ]),
      ),
    );
  }
}
5
likes
140
pub points
51%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on multiscreen