Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_screenutil
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李卓原
2023-05-22 17:26:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7db5dd7d7532d97f7801f6a828c602cac46f5e91
7db5dd7d
1 parent
ef633461
v5.8.2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
19 deletions
CHANGELOG.md
example/lib/main.dart
pubspec.yaml
CHANGELOG.md
View file @
7db5dd7
#
6.0.1
#
5.8.2
-
change useInheritedMediaQuery default value to true
-
update readme
# 6.0.0
-
remove ScreenutilInit layout listener
# 5.8.1
...
...
example/lib/main.dart
View file @
7db5dd7
import
'package:device_preview/device_preview.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'src/first_method.dart'
as
firstMethod
;
import
'src/second_method.dart'
as
secondMethod
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
void
main
(
)
{
const
method
=
int
.
fromEnvironment
(
'method'
,
defaultValue:
1
);
runApp
(
DevicePreview
(
enabled:
kDebugMode
&&
kIsWeb
,
builder:
(
context
)
{
return
method
==
1
?
firstMethod
.
MyApp
()
:
secondMethod
.
MyApp
();
},
),
);
void
main
(
List
<
String
>
args
)
{
WidgetsFlutterBinding
.
ensureInitialized
();
SystemChrome
.
setEnabledSystemUIMode
(
SystemUiMode
.
edgeToEdge
);
runApp
(
const
App
());
}
class
App
extends
StatelessWidget
{
const
App
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
ScreenUtilInit
(
builder:
(
context
,
child
)
=>
MaterialApp
(
themeMode:
ThemeMode
.
system
,
theme:
ThemeData
.
light
(),
darkTheme:
ThemeData
.
dark
(),
home:
const
Home
(),
),
);
}
}
class
Home
extends
StatelessWidget
{
const
Home
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Home'
),
),
body:
const
Center
(
child:
Text
(
'Home'
),
),
);
}
}
\ No newline at end of file
...
...
pubspec.yaml
View file @
7db5dd7
name
:
flutter_screenutil
description
:
A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version
:
6.0.1
version
:
5.8.2
homepage
:
https://github.com/OpenFlutter/flutter_screenutil
environment
:
...
...
Please
register
or
login
to post a comment