Skip to content

Commit

Permalink
v5.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
李卓原 committed May 22, 2023
1 parent ef63346 commit 7db5dd7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# 6.0.1
# 5.8.2
- change useInheritedMediaQuery default value to true
- update readme

# 6.0.0
- remove ScreenutilInit layout listener

# 5.8.1
Expand Down
54 changes: 39 additions & 15 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
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'),
),
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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:
Expand Down

0 comments on commit 7db5dd7

Please sign in to comment.