flutter_screenutil_plus 1.0.2
flutter_screenutil_plus: ^1.0.2 copied to clipboard
A flutter plugin for adapting screen and font size. Guaranteed to look good on different models
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_screenutil_plus/flutter_screenutil_plus.dart';
import 'home_page.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
// Set the fit size (Find your UI design, look at the dimensions of the device screen and fill it in, unit in dp)
return ScreenUtilPlusInit(
designSize: const Size(360, 690),
minTextAdapt: true,
splitScreenMode: true,
// Use builder only if you need to use library outside ScreenUtilPlusInit context
builder: (context, child) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter ScreenUtil Plus Example',
// You can use the library anywhere in the app even in theme
theme: ThemeData(
primarySwatch: Colors.blue,
textTheme: Typography.englishLike2018.apply(fontSizeFactor: 1.sp),
useMaterial3: true,
),
home: child,
);
},
child: const HomePage(),
);
}
}