Skip to content

Commit

Permalink
fix screenutil pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
anu-1806 committed Oct 28, 2021
1 parent a48475f commit 1c1ab98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
13 changes: 8 additions & 5 deletions app/lib/main.dart
@@ -1,5 +1,6 @@
import 'package:app/screens/home.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

void main() {
runApp(Home());
Expand All @@ -8,10 +9,12 @@ void main() {
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.amber),
color: Colors.grey,
home: MyApp());
return ScreenUtilInit(
designSize: Size(720, 1440),
builder: () => MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.amber),
color: Colors.grey,
home: MyApp()));
}
}
4 changes: 3 additions & 1 deletion app/lib/screens/code.dart
Expand Up @@ -19,7 +19,9 @@ class CodeBD extends StatefulWidget {
class _CodeBDState extends State<CodeBD> {
@override
Widget build(BuildContext context) {
ScreenUtil.init(context, width: 720, height: 1440, allowFontScaling: true);
// ScreenUtil.init(
// BoxConstraints(minHeight: 1440, minWidth: 720),
// );
return DefaultTabController(
length: 3,
child: BackdropScaffold(
Expand Down
1 change: 0 additions & 1 deletion app/lib/screens/home.dart
Expand Up @@ -121,7 +121,6 @@ class _MyAppState extends State<MyApp> {

@override
Widget build(BuildContext context) {
ScreenUtil.init(context, height: 1440, width: 720, allowFontScaling: true);
numbers.shuffle();
return Scaffold(
backgroundColor: Colors.grey[300],
Expand Down

0 comments on commit 1c1ab98

Please sign in to comment.