Is there a way to apply media query to padding top in flutter?

Issue

This Content is from Stack Overflow. Question asked by signature

Is there a way to apply media query to padding top in flutter? The location of top, left, right, bottom is different for each device, so how do I solve it?

import 'package:flutter/material.dart';

class menuwidget3 extends StatelessWidget {
  const menuwidget3({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xfff9f9f9),
      body: SafeArea(
        child: Stack(
          children: [
            Padding(
              padding: const EdgeInsets.only(top: 20, left: 15),
              child: Row(
                children: const [
                  Padding(
                    padding: EdgeInsets.only(left: 5),
                    child: Text(
                      'first',
                      style: TextStyle(
                          color: Colors.black,
                          fontFamily: 'Pretendard',
                          fontWeight: FontWeight.w600,
                          fontSize: 20),
                    ),
                  ),
                ],
              ),
            ),



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?