main.dart 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import 'package:flutter/material.dart';
  2. import 'package:my_feature_module/my_feature_module.dart';
  3. void main() {
  4. runApp(const MyApp());
  5. }
  6. class MyApp extends StatelessWidget {
  7. const MyApp({super.key});
  8. @override
  9. Widget build(BuildContext context) {
  10. return MaterialApp(
  11. title: '舌面诊',
  12. theme: ThemeData(
  13. colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
  14. useMaterial3: true,
  15. ),
  16. home: const HomePage(),
  17. );
  18. }
  19. }
  20. class HomePage extends StatelessWidget {
  21. const HomePage({super.key});
  22. @override
  23. Widget build(BuildContext context) {
  24. return Scaffold(
  25. appBar: AppBar(
  26. title: const Text('舌面诊'),
  27. backgroundColor: Theme.of(context).colorScheme.inversePrimary,
  28. ),
  29. body: Center(
  30. child: Column(
  31. mainAxisAlignment: MainAxisAlignment.center,
  32. children: [
  33. const Text(
  34. '舌面诊',
  35. style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
  36. ),
  37. const SizedBox(height: 32),
  38. ElevatedButton(
  39. onPressed: () {
  40. Navigator.of(context).push(
  41. MaterialPageRoute(
  42. builder: (context) => const SmzPage(),
  43. ),
  44. );
  45. },
  46. style: ElevatedButton.styleFrom(
  47. padding: const EdgeInsets.symmetric(
  48. horizontal: 32,
  49. vertical: 16,
  50. ),
  51. backgroundColor: Colors.green,
  52. foregroundColor: Colors.white,
  53. ),
  54. child: const Text(
  55. '进入舌面诊',
  56. style: TextStyle(fontSize: 18),
  57. ),
  58. ),
  59. ],
  60. ),
  61. ),
  62. );
  63. }
  64. }