4

My code keeps giving me error due to return Scaffold. here is my scaffold code:

 class _DashboardState extends State<Dashboard> { @override Widget build(BuildContext context) { return Scaffold( drawer: Drawer( child: Column (children: <Widget>[ AppBar(automaticallyImplyLeading: false, title: Text('Special Options'), backgroundColor: Colors.redAccent.shade400 ), 

Here is the error code I got during debug

Context: Found this candidate, but the arguments don't match.
lib/ui/usertype.dart:29:24: Error: Too few positional arguments: 1 required, 0 given.

file:///C:/flutter/flutter/packages/flutter/lib/src/material/scaffold.dart:1: Context: Found this candidate, but the arguments don't match.
Compiler failed

1 Answer 1

3

Yiu probably accidentally modified Flutter source code.

You can check by running in your Flutter install dir

git status 

It should report no modifications

To fix run in your Flutter install dir

git clean -xfd git stash save --keep-index git stash drop git pull flutter doctor 
Sign up to request clarification or add additional context in comments.

8 Comments

Thanks for the help but after doing that I got errors. what I got from pubspec :Could not find a file named "pubspec.yaml" in "C:\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\font_awesome_flutter-8.2.0".
Thanks error cleared by running flutter pub pub cache repair
Scaffold error suddenly popped up again yesterday, tried the solution over and over again but not working
Not to sure but its only given me scaffold error : Error: Too few positional arguments: 1 required, 0 given. return Scaffold(
Thanks for helping me all through. I really appreciate your effort switching to a stable version then following your steps over again did the magic
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.