I deleted the 'MaterialApp' code block because I couldn't write the codes I wanted at the beginning.
Now it gives an error, how can I fix this? I have to handle this in a very short time, I have to put the codes I wrote in the "MaterialApp" block, but I can't.
Can you help me ?
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: < BottomNavigationBarItem > [
new BottomNavigationBarItem(
icon: new Icon(Icons.home),
title: Text('Enes'),
),
new BottomNavigationBarItem(
icon: new Icon(Icons.bluetooth),
title: Text('Mehmet'),
),
],
),
tabBuilder: (BuildContext context, int index) {
return CupertinoTabView(
builder: (BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Page 1 of tab $index'),
),
child: Center(
child: CupertinoButton(
child: const Text('Next Page'),
onPressed: () {
Navigator.of(context).push(
CupertinoPageRoute < void > (
builder: (BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Page 2 of tab $index'),
),
child: Center(
child: CupertinoButton(
child: const Text('Back'),
onPressed: () {
Navigator.of(context).pop();
},
),
),
);
},
),
);
},
),
),
);
},
);
},
);
}
}