Я пытаюсь создать проект, в котором пользователь может щелкнуть вкладку в блоке навигации, и он перенаправит их на страницу, где они смогут сыграть в викторину.У меня проблемы с тем, что пользователь нажимает на вкладку, и он перенаправляет их в другой имеющийся у меня файл .dart, который содержит весь код, необходимый для теста.Я очень новичок во Флаттере, поэтому любая информация и советы помогут.Если у вас есть какие-либо вопросы или вам нужна информация, просто спросите.
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter App',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new HomePage(title: 'HomePage'),
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => new _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text("Knowledge Burst"),
backgroundColor: Colors.redAccent,),
drawer: new Drawer(
child: new ListView(
children: <Widget>[
new UserAccountsDrawerHeader(
accountName: new Text("Knowledge Burst"),
accountEmail: null,
decoration: new BoxDecoration(
image: new DecorationImage(
fit: BoxFit.fill,
image: new NetworkImage("")
)
),
),
new ListTile(
title: new Text("History of FBLA"),
trailing: new Icon(Icons.arrow_upward),
),
new ListTile(
title: new Text("FBLA Sponsered"),
trailing: new Icon(Icons.arrow_upward),
),
new ListTile(
title: new Text("FBLA National Office Holders"),
trailing: new Icon(Icons.arrow_upward),
),
new Divider(),
new ListTile(
title: new Text("Economics"),
trailing: new Icon(Icons.arrow_upward),
),
new ListTile(
title: new Text("Entrepreneurship"),
trailing: new Icon(Icons.arrow_upward),
),
new Divider(),
new ListTile(
title: new Text("License and Terms of Use"),
trailing: new Icon(Icons.arrow_upward),
),
new Divider(),
new ListTile(
title: new Text("Close"),
trailing: new Icon(Icons.cancel),
onTap: () => Navigator.of(context).pop(),
),
],
),
),
body: new Center(
child: new Text("HomePage", style: new TextStyle(fontSize:
35.0),),
),
);
}
}