can anyone help me to solve this error?
-
import 'package:flutter/material.dart';
import './practice2.dart';
import './practice3.dart';
void main()
{
runApp(MaterialApp(home:Akanksha()));
}
class Akanksha extends StatefulWidget {
@override
State createState() {
return AkankshaState();
}
}class AkankshaState extends State{
final questions=const[
{'questionText':'what is your favourite colour?','answers':['black','green','blue'],
},
{'questionText':'what is your fav drama?','answers':['black','green','blue'],
},
{'questionText':'what is your favourite animal?','answers':['black','green','blue'],
},
];
var _questionIndex=0;
void answerQuestion(){
// var aBool=true;
// aBool=false;
setState((){
_questionIndex= _questionIndex+1;
});
print(_questionIndex);
if (_questionIndeximport 'package:flutter/material.dart';
import './practice2.dart';
import './practice3.dart';
void main()
{
runApp(MaterialApp(home:Akanksha()));
}
class Akanksha extends StatefulWidget {
@override
State createState() {
return AkankshaState();
}
}class AkankshaState extends State{
final questions=const[
{'questionText':'what is your favourite colour?','answers':['black','green','blue'],
},
{'questionText':'what is your fav drama?','answers':['black','green','blue'],
},
{'questionText':'what is your favourite animal?','answers':['black','green','blue'],
},
];
var _questionIndex=0;
void answerQuestion(){
// var aBool=true;
// aBool=false;
setState((){
_questionIndex= _questionIndex+1;
});
print(_questionIndex);
if (_questionIndex -
import 'package:flutter/material.dart';
import './practice2.dart';
import './practice3.dart';
void main()
{
runApp(MaterialApp(home:Akanksha()));
}
class Akanksha extends StatefulWidget {
@override
State createState() {
return AkankshaState();
}
}class AkankshaState extends State{
final questions=const[
{'questionText':'what is your favourite colour?','answers':['black','green','blue'],
},
{'questionText':'what is your fav drama?','answers':['black','green','blue'],
},
{'questionText':'what is your favourite animal?','answers':['black','green','blue'],
},
];
var _questionIndex=0;
void answerQuestion(){
// var aBool=true;
// aBool=false;
setState((){
_questionIndex= _questionIndex+1;
});
print(_questionIndex);
if (_questionIndeximport 'package:flutter/material.dart';
import './practice2.dart';
import './practice3.dart';
void main()
{
runApp(MaterialApp(home:Akanksha()));
}
class Akanksha extends StatefulWidget {
@override
State createState() {
return AkankshaState();
}
}class AkankshaState extends State{
final questions=const[
{'questionText':'what is your favourite colour?','answers':['black','green','blue'],
},
{'questionText':'what is your fav drama?','answers':['black','green','blue'],
},
{'questionText':'what is your favourite animal?','answers':['black','green','blue'],
},
];
var _questionIndex=0;
void answerQuestion(){
// var aBool=true;
// aBool=false;
setState((){
_questionIndex= _questionIndex+1;
});
print(_questionIndex);
if (_questionIndex -
import 'package:flutter/material.dart';
import './practice2.dart';
import './practice3.dart';
void main()
{
runApp(MaterialApp(home:Akanksha()));
}
class Akanksha extends StatefulWidget {
@override
State createState() {
return AkankshaState();
}
}class AkankshaState extends State{
final questions=const[
{'questionText':'what is your favourite colour?','answers':['black','green','blue'],
},
{'questionText':'what is your fav drama?','answers':['black','green','blue'],
},
{'questionText':'what is your favourite animal?','answers':['black','green','blue'],
},
];
var _questionIndex=0;
void answerQuestion(){
// var aBool=true;
// aBool=false;
setState((){
_questionIndex= _questionIndex+1;
});
print(_questionIndex);
if (_questionIndeximport 'package:flutter/material.dart';
import './practice2.dart';
import './practice3.dart';
void main()
{
runApp(MaterialApp(home:Akanksha()));
}
class Akanksha extends StatefulWidget {
@override
State createState() {
return AkankshaState();
}
}class AkankshaState extends State{
final questions=const[
{'questionText':'what is your favourite colour?','answers':['black','green','blue'],
},
{'questionText':'what is your fav drama?','answers':['black','green','blue'],
},
{'questionText':'what is your favourite animal?','answers':['black','green','blue'],
},
];
var _questionIndex=0;
void answerQuestion(){
// var aBool=true;
// aBool=false;
setState((){
_questionIndex= _questionIndex+1;
});
print(_questionIndex);
if (_questionIndexIn addition to what Richard said, when editing your post, please remove any unnecessary code. Just post what is relevant to the actual problem. All else is just noise.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
import 'package:flutter/material.dart';
import './practice2.dart';
import './practice3.dart';
void main()
{
runApp(MaterialApp(home:Akanksha()));
}
class Akanksha extends StatefulWidget {
@override
State createState() {
return AkankshaState();
}
}class AkankshaState extends State{
final questions=const[
{'questionText':'what is your favourite colour?','answers':['black','green','blue'],
},
{'questionText':'what is your fav drama?','answers':['black','green','blue'],
},
{'questionText':'what is your favourite animal?','answers':['black','green','blue'],
},
];
var _questionIndex=0;
void answerQuestion(){
// var aBool=true;
// aBool=false;
setState((){
_questionIndex= _questionIndex+1;
});
print(_questionIndex);
if (_questionIndeximport 'package:flutter/material.dart';
import './practice2.dart';
import './practice3.dart';
void main()
{
runApp(MaterialApp(home:Akanksha()));
}
class Akanksha extends StatefulWidget {
@override
State createState() {
return AkankshaState();
}
}class AkankshaState extends State{
final questions=const[
{'questionText':'what is your favourite colour?','answers':['black','green','blue'],
},
{'questionText':'what is your fav drama?','answers':['black','green','blue'],
},
{'questionText':'what is your favourite animal?','answers':['black','green','blue'],
},
];
var _questionIndex=0;
void answerQuestion(){
// var aBool=true;
// aBool=false;
setState((){
_questionIndex= _questionIndex+1;
});
print(_questionIndex);
if (_questionIndexHi, it seems like you are getting an error because you are not using the correct namespace or scope for cout. cout is defined within the std namespace, so you need to either use std::cout or add a using namespace std; directive before your main function. For example:
#include
using namespace std;int main()
{
cout << "Hello world";
return 0;
}or
#include
int main()
{
std::cout << "Hello world";
return 0;
}You can read more about namespaces and cout here:https://stackoverflow.com/questions/15359589/cout-is-not-a-member-of-std-cout-was-not-declared-in-this-scope[^], 'cout' was not declared in this scope [FIXED][^] or https://stackoverflow.com/questions/15185801/cout-was-not-declared-in-this-scope[^] Best regards, Mia from CodeIT