skip to Main Content
 @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar:AppBar(
        title: Text('New project',style: TextStyle(fontSize:25,color: Colors.green,decorationStyle: TextDecorationStyle.dotted ),),
    )
        body: Center(
         child: Column(
          children: <Widget>[
          Text('How many times pushed'),
          Text('ok')
      ],
    ),
    ),

    );

  }
}

When I try to run the code,I am getting the error "Expected ‘,’ before this" close to the body, Whats the soltuion for it

2

Answers


  1. Try below code add , before body start

    return Scaffold(
          appBar: AppBar(
            title: Text(
              'New project',
              style: TextStyle(
                  fontSize: 25,
                  color: Colors.green,
                  decorationStyle: TextDecorationStyle.dotted),
            ),
          ),
          body: Center(
            child: Column(
              children: <Widget>[Text('How many times pushed'), Text('ok')],
            ),
          ),
        );
    

    Result-> image

    Login or Signup to reply.
  2. return Scaffold(
      appBar: AppBar(
        title: Text(
          'New project',
          style: TextStyle(
              fontSize: 25,
              color: Colors.green,
              decorationStyle: TextDecorationStyle.dotted),
        ),
      ), -----------------> add , here
      body: Center(
        child: Column(
          children: <Widget>[Text('How many times pushed'), Text('ok')],
        ),
      ),
    );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search