| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import 'package:common_pub/common_pub.dart';
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import '../../generated/assets.dart';
- import 'home_controller.dart';
- class HomeAppBar extends GetView<HomeController>
- implements PreferredSizeWidget {
- const HomeAppBar({super.key, required this.tab});
- final Widget tab;
- @override
- Widget build(BuildContext context) {
- final statusBarHeight = MediaQuery.of(context).viewPadding.top;
- return SizedBox.expand(
- child: Container(
- padding: EdgeInsets.only(top: statusBarHeight),
- decoration: const BoxDecoration(
- image: DecorationImage(
- image: AssetImage(Assets.imagesBkCommonPage),
- fit: BoxFit.fitWidth),
- boxShadow: [
- BoxShadow(color: Color(0x33000000), spreadRadius: 4, blurRadius: 4)
- ]),
- child: Row(
- mainAxisSize: MainAxisSize.max,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- SizedBox(width: 660, height: double.infinity, child: tab),
- Expanded(
- child: Obx(() => controller.selectMapName.value.isEmpty
- ? const SizedBox()
- : Row(children: [
- Container(
- width: 10,
- height: 34,
- margin: const EdgeInsets.only(right: 12),
- decoration: BoxDecoration(
- color: Colors.blue,
- borderRadius: BorderRadius.circular(5)),
- ),
- Text(controller.selectMapName.value,
- style: const TextStyle(
- color: Colors.white, fontSize: 22))
- ]))),
- TextButton(
- onPressed: () {},
- child: const Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Icon(Icons.radio, color: Colors.white),
- Text(' 广播',
- style: TextStyle(color: Colors.white, fontSize: 20))
- ],
- ))
- ],
- ),
- ));
- }
- @override
- Size get preferredSize => const Size.fromHeight(kToolbarHeight);
- }
|