hello i’m trying to apply figma design here in flutter using screenutils package the problem is i got bottomoverflowed in the first onbordingpage on my phone (samsung galaxy a10’s) and it didn’t understand what is the problem ,
this is my code :
<code>import 'package:device_preview/device_preview.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_koujinti_1/Colors/Color.dart';
import 'package:flutter_koujinti_1/pages/Splash%20&%20onBording/SplashScreen.dart';
import 'package:flutter_koujinti_1/pages/Splash%20&%20onBording/onbording.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
MyApp({super.key});
@override
Widget build(BuildContext context) {
return ScreenUtilInit( minTextAdapt: true,
designSize: const Size(375, 812),
builder: (context, child) {
return MaterialApp(
theme: ThemeData(textTheme: GoogleFonts.montserratTextTheme()),
debugShowCheckedModeBanner: false,
home: Onbording(),
);
});
}
}class Onbording extends StatefulWidget {
Onbording({super.key});
@override
State<Onbording> createState() => _OnbordingState();
}
class _OnbordingState extends State<Onbording> {
@override
Widget build(BuildContext context) {
// ScreenUtil.init(context, designSize: const Size(375, 812)); i even tried without this line
return PopScope(
canPop: false,
child: Scaffold(
body: Container(
child: Center(
child: Colum(
children: [
Gap(233.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Explore,",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color: Colors.white),
),
Text(
"Cook,",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color:Colors.white),
),
Text(
"Share.",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color: Colors.white),
),
],
),
Gap(150.h),
Container(
width: 375.w,
height: 174.h,
decoration: BoxDecoration(
color: white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(24).w,
topRight: Radius.circular(24).w)),
child: Text("data"),
)
],
),
),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/Onboarding (2).png"))),
),
));
}
}
</code>
<code>import 'package:device_preview/device_preview.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_koujinti_1/Colors/Color.dart';
import 'package:flutter_koujinti_1/pages/Splash%20&%20onBording/SplashScreen.dart';
import 'package:flutter_koujinti_1/pages/Splash%20&%20onBording/onbording.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
MyApp({super.key});
@override
Widget build(BuildContext context) {
return ScreenUtilInit( minTextAdapt: true,
designSize: const Size(375, 812),
builder: (context, child) {
return MaterialApp(
theme: ThemeData(textTheme: GoogleFonts.montserratTextTheme()),
debugShowCheckedModeBanner: false,
home: Onbording(),
);
});
}
}class Onbording extends StatefulWidget {
Onbording({super.key});
@override
State<Onbording> createState() => _OnbordingState();
}
class _OnbordingState extends State<Onbording> {
@override
Widget build(BuildContext context) {
// ScreenUtil.init(context, designSize: const Size(375, 812)); i even tried without this line
return PopScope(
canPop: false,
child: Scaffold(
body: Container(
child: Center(
child: Colum(
children: [
Gap(233.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Explore,",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color: Colors.white),
),
Text(
"Cook,",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color:Colors.white),
),
Text(
"Share.",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color: Colors.white),
),
],
),
Gap(150.h),
Container(
width: 375.w,
height: 174.h,
decoration: BoxDecoration(
color: white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(24).w,
topRight: Radius.circular(24).w)),
child: Text("data"),
)
],
),
),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/Onboarding (2).png"))),
),
));
}
}
</code>
import 'package:device_preview/device_preview.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_koujinti_1/Colors/Color.dart';
import 'package:flutter_koujinti_1/pages/Splash%20&%20onBording/SplashScreen.dart';
import 'package:flutter_koujinti_1/pages/Splash%20&%20onBording/onbording.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
MyApp({super.key});
@override
Widget build(BuildContext context) {
return ScreenUtilInit( minTextAdapt: true,
designSize: const Size(375, 812),
builder: (context, child) {
return MaterialApp(
theme: ThemeData(textTheme: GoogleFonts.montserratTextTheme()),
debugShowCheckedModeBanner: false,
home: Onbording(),
);
});
}
}class Onbording extends StatefulWidget {
Onbording({super.key});
@override
State<Onbording> createState() => _OnbordingState();
}
class _OnbordingState extends State<Onbording> {
@override
Widget build(BuildContext context) {
// ScreenUtil.init(context, designSize: const Size(375, 812)); i even tried without this line
return PopScope(
canPop: false,
child: Scaffold(
body: Container(
child: Center(
child: Colum(
children: [
Gap(233.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Explore,",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color: Colors.white),
),
Text(
"Cook,",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color:Colors.white),
),
Text(
"Share.",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 64.sp,
color: Colors.white),
),
],
),
Gap(150.h),
Container(
width: 375.w,
height: 174.h,
decoration: BoxDecoration(
color: white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(24).w,
topRight: Radius.circular(24).w)),
child: Text("data"),
)
],
),
),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/Onboarding (2).png"))),
),
));
}
}
i searched problems like this in stackoverflow , i watched 5-6 youtoube videos and it works perfect for them
New contributor
Yassine Ben Ayed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.