Files
iroute/lib/13/02/pages/home_page.dart
2023-10-19 21:51:44 +08:00

31 lines
626 B
Dart

import 'package:flutter/material.dart';
import '../main.dart';
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
const Color bgColor = Color(0xffCCFFCC);
return Scaffold(
backgroundColor: bgColor,
appBar: AppBar(
title: const Text('主页起点'),
backgroundColor: bgColor,
),
body: Center(child: ElevatedButton(
onPressed: () => toPageA(context),
child: const Text('Push A'),
),
));
}
void toPageA(BuildContext context) {
router.value = ['/', 'a'];
}
}