0 purchases
easy screenutil
easy_screenutil #
A flutter plugin for adapting screen and font size.Let your UI display a reasonable layout on different screen sizes!
Note: This plugin is simple and open to future improvements. Your feedback is welcome.
Usage #
Add dependency #
Please check the latest version before installation.
If there is any problem with the new version, please use the previous version
dependencies:
flutter:
sdk: flutter
# add easy_screenutil
easy_screenutil: ^{latest version}
copied to clipboard
Add the following imports to your Dart code #
import 'package:easy_screenutil/easy_screenutil.dart';
copied to clipboard
1、 Initialize by ScreenUtil.
void main() {
ScreenUtil.ensureInitialized(designWidth: 375);
runApp(const MyApp());
}
copied to clipboard
2、 init screen util ScreenUtil.builder.
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: MyHomePage(title: 'Flutter Demo Home Page'),
// init screen util
builder: ScreenUtil.builder,
);
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.