home_button.dart 632 B

12345678910111213141516171819202122232425
  1. import 'package:flutter/material.dart';
  2. class HomeButton extends StatelessWidget {
  3. const HomeButton({Key? key}) : super(key: key);
  4. @override
  5. Widget build(BuildContext context) {
  6. return Positioned(
  7. top: 30,
  8. right: 30,
  9. child: SizedBox(
  10. width: 70,
  11. height: 80,
  12. child: FloatingActionButton(
  13. shape: const CircleBorder(),
  14. child: const Icon(
  15. Icons.home,
  16. size: 40,
  17. ),
  18. onPressed: () async {
  19. Navigator.pushNamed(context, "/");
  20. },
  21. )));
  22. }
  23. }