Flatbutton is invisible. It is not showing asset image on Flatbutton

173 Views Asked by At

it's a code of a main file

class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {

return MaterialApp(
  home: Scaffold(
    appBar: AppBar(
      title: Text("RTSPS"),
    ),
    body: Center(
      child: FlatButton(
      child: Image.asset('assets/1st.png'),
      onPressed:()=>HomePage(),

      ),
    ),
  ),
  );
 }
}

and here is pubspec.yaml file code in which I only made changes in assets

assets:

  - assets/1st.png
0

There are 0 best solutions below