Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Scaffold Code suddenly starts to give me error

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

like image 399
Gbadegesin Taiwo Avatar asked Sep 15 '25 10:09

Gbadegesin Taiwo


1 Answers

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
like image 78
Günter Zöchbauer Avatar answered Sep 16 '25 23:09

Günter Zöchbauer