preview_title.dart 829 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'dart:io';
  2. import 'package:flutter/material.dart';
  3. ///预览标题
  4. class PreviewTitle extends StatelessWidget {
  5. final String? title;
  6. const PreviewTitle({super.key, this.title});
  7. @override
  8. Widget build(BuildContext context) {
  9. return Column(
  10. children: [
  11. Row(
  12. children: [
  13. IconButton(
  14. onPressed: () => Navigator.pop(context),
  15. icon: Icon(Platform.isAndroid
  16. ? Icons.arrow_back
  17. : Icons.arrow_back_ios_new),
  18. color: Colors.white,
  19. ),
  20. Text(
  21. title ?? "",
  22. style: Theme.of(context)
  23. .textTheme
  24. .titleMedium
  25. ?.copyWith(color: Colors.white),
  26. ),
  27. ],
  28. ),
  29. ],
  30. );
  31. }
  32. }