mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
Bug fixes
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/popup_menu_widget.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
@ -11,30 +10,33 @@ class DeviceAppbar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final String deviceUuid;
|
||||
final double appBarHeight = 56.0;
|
||||
final void Function()? onPressed;
|
||||
const DeviceAppbar({super.key, required this.deviceName, required this.deviceUuid,this.onPressed});
|
||||
const DeviceAppbar(
|
||||
{super.key, required this.deviceName, required this.deviceUuid, this.onPressed});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
return AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
centerTitle: true,
|
||||
title: BodyLarge(
|
||||
text: deviceName ?? "",
|
||||
text: deviceName,
|
||||
fontColor: ColorsManager.primaryColor,
|
||||
fontWeight: FontsManager.bold,
|
||||
),
|
||||
actions: [
|
||||
IconButton(onPressed: () {
|
||||
showPopupMenu(context: context, items: [
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
HomeCubit.getInstance().updateDevice(deviceUuid);
|
||||
},
|
||||
value: 'Update',
|
||||
child: const Text('Update'),
|
||||
)
|
||||
]);
|
||||
}, icon: Icon(Icons.edit))
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
showPopupMenu(context: context, items: [
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
HomeCubit.getInstance().updateDevice(deviceUuid);
|
||||
},
|
||||
value: 'Update',
|
||||
child: const Text('Update'),
|
||||
)
|
||||
]);
|
||||
},
|
||||
icon: Icon(Icons.edit))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user