Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Scaffold widgets require a MediaQuery widget anscestor

(This is my first post so please excuse the poor format and mistakes)
I hope you all are doing great.
I am new to dart and programming, and I can’t figuere out how to solve this.
enter image description here

.I have tried adding MaterialApp, which seems to be the solution everyone online is recommending but to no avail. please help

import 'package:flutter/material.dart';



void main() => runApp(
  MaterialApp(home: ScaffoldExample())
);

class ScaffoldExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          "Scaffold",),
        centerTitle: true,
      ),
    ); // scaffold
  }
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

run these commands in terminals hope this will help you

>> flutter clean

>> flutter pub get

if this didn’t worked try stopping and restarting the app. let me know if this help you or not.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading