'flutter not displaying ui at some devices

I am developing an application using flutter. At some devices home screen of application showing as below

enter image description here

But real ui should be as below

enter image description here

I could not figure out what the cause problem. The devices that not show ui correct, if I debug the application at that device ui is as should be.

I added also main ui flutter code below. The problem occours when I released the application as bundle or apk ( I have test on 2 xaomi devices and also tested firebase test lab on Pixel devices. The result is same. UI is not as should be.)

EDIT : added source code insted of screen shot

 @override
  Widget build(BuildContext context) {
    return Consumer<HomePageViewModel>(builder: (context, viewModel, child) {
      vm = viewModel;
      viewModel.context = context;
      return SafeArea(
        child: Scaffold(
          key: CardScaffoldStateKeys.homePagePageScaffoldKey,
          body: Padding(
            padding: const EdgeInsets.only(left: 20, right: 20),
            child: Flex(
              direction: Axis.vertical,
              children: [
                PageComponent.pageHeader(viewModel.getHeightByPercent(20)),
                Flexible(
                  child: Padding(
                    padding: const EdgeInsets.only(top: 10.0),
                    child: Container(
                      height: viewModel.getHeightByPercent(80),
                      decoration: PageComponent.pageContainerDecoration(),
                      padding: const EdgeInsets.only(top: 10, left: 20, right: 20),
                      child: SingleChildScrollView(
                        child: Column(
                          mainAxisSize: MainAxisSize.max,
                          mainAxisAlignment: MainAxisAlignment.start,
                          crossAxisAlignment: CrossAxisAlignment.stretch,
                          children: [
    // some Text widget
                          ],
                        ),
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ), // This trailing comma makes auto-formatting nicer for build methods.
        ),
      );
    });
  }

added sample project at github

https://github.com/azizkazdal/serviceAppTest



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source