skip to Main Content

How can I avoid the camera position while building a screen? My Logo is hiding behind the camera. camera position problem while building flutter app

This is what I’ve tried:

Scaffold(
        appBar: PreferredSize(
            preferredSize: const Size(double.infinity, 100),
            child: AppBar(
              title: Image.asset(
                Constants.kLogoPath,
                height: 40,
              ),
              centerTitle: true,
              actions: [
                TextButton(onPressed: () {}, child: const Text("Skip"))
              ],
            )));

2

Answers


  1. Chosen as BEST ANSWER

    I only faced this problem while using an emulator. But while using real devices this problem is fixed automatically.


  2. use SafeArea widget to avoid camera

    SafeArea(
          child: Scaffold(
            appBar: PreferredSize(
              preferredSize: const Size(double.infinity, 100),
              child: AppBar(
                centerTitle: true,
                actions: [TextButton(onPressed: () {}, child: const Text("Skip"))],
              ),
            ),
          ),
        );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search