titlebar_widget.dart 790 B

12345678910111213141516171819202122232425262728293031
  1. import 'package:flutter/material.dart';
  2. const sidebarColor = Color(0xFF0C6AF6);
  3. const backgroundStartColor = Color(0xFF0583EA);
  4. const backgroundEndColor = Color(0xFF0697EA);
  5. class DesktopTitleBar extends StatelessWidget {
  6. final Widget? child;
  7. const DesktopTitleBar({Key? key, this.child}) : super(key: key);
  8. @override
  9. Widget build(BuildContext context) {
  10. return Container(
  11. decoration: const BoxDecoration(
  12. gradient: LinearGradient(
  13. begin: Alignment.topCenter,
  14. end: Alignment.bottomCenter,
  15. colors: [backgroundStartColor, backgroundEndColor],
  16. stops: [0.0, 1.0]),
  17. ),
  18. child: Row(
  19. children: [
  20. Expanded(
  21. child: child ?? Offstage(),
  22. )
  23. ],
  24. ),
  25. );
  26. }
  27. }