0

This a empty screen widget that I used as homepage. On my phone (Samsung S8), all the widgets fit to screen perfect, but when I try Samsung A50 which has bigger screen, widget doesn't look like perfect. For example, they look bigger or texts are not written in single line. How can solve my code for looking perfect in all platform?

I share my code:

@override
  Widget build(BuildContext context) {
    return WillPopScope(
      child: SafeArea(
        child: Scaffold(
          backgroundColor: kColorTheme1,
          appBar: AppBar(
            centerTitle: true,
            automaticallyImplyLeading: false,
            elevation: 20,
            backgroundColor: Color(0xFFF2C3D4).withOpacity(1),
            title:TitleBorderedText(title:"SEVIMLI YEMEKLER", textColor: Color(0xFFFFFB00)),
            actions: [
              CircleAvatar(
                radius: 27,
                backgroundColor: Colors.transparent,
                backgroundImage: AssetImage(kCuttedLogoPath),
              ),
            ],
          ),
          body: Container(
            decoration: BoxDecoration(
              image: DecorationImage(
                image: AssetImage(kBGWithLogoOpacity),
                fit: BoxFit.cover,
              ),
            ),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                Expanded(
                  child: GridView.builder(
                    scrollDirection: Axis.vertical,
                    gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
                    itemCount:categoryModels.length,
                    itemBuilder: (context,index){
                      if (categoryModels[index].categoryId==null){
                        return EmptyCard(where: "homeScreen",);
                      }
                      return CategoryCard(category: categoryModels[index]);
                    }
                  ),
                ),
                Column(
                  mainAxisAlignment: MainAxisAlignment.end,
                  crossAxisAlignment: CrossAxisAlignment.stretch,
                  children: [
                    Padding(
                      padding: EdgeInsets.all(10),
                      child: Container(
                        decoration: BoxDecoration(
                          border: Border.all(style: BorderStyle.solid),
                          color: kColorTheme7,
                          borderRadius: BorderRadius.circular(40),
                        ),
                        child: TextButton(
                          onPressed: (){
                            showModalBottomSheet(
                                context: context,
                                builder: (BuildContext context)=> AddMenuScreen(buttonText: "Menü Ekle",route: "homeScreen",),
                            );
                          },
                          child: TitleBorderedText(title: "LEZZET GRUBU EKLE",textColor: Colors.white,)
                        ),
                      ),
                    ),
                  ],
                )
              ],
            ),
          ),
        ),
      ),
paulsm4
  • 114,292
  • 17
  • 138
  • 190
ygzkrmtc
  • 177
  • 12

0 Answers0