mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-24 23:32:27 +00:00

- Updated color references in various widgets to use the new `opaquePrimary` color for better visual consistency. - Refactored `ColorsManager` to improve color definitions and removed redundant color declarations. - Enhanced UI elements across multiple dialogs and widgets to ensure a cohesive design language. This change promotes maintainability and aligns with the updated color scheme.
74 lines
2.0 KiB
Dart
74 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
|
|
import 'package:syncrow_web/utils/color_manager.dart';
|
|
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
|
|
|
class IconNameStatusContainer extends StatelessWidget {
|
|
const IconNameStatusContainer({
|
|
super.key,
|
|
required this.name,
|
|
required this.icon,
|
|
required this.onTap,
|
|
required this.status,
|
|
required this.textColor,
|
|
this.paddingAmount = 12,
|
|
required this.isFullIcon,
|
|
});
|
|
|
|
final String name;
|
|
final String icon;
|
|
final GestureTapCallback onTap;
|
|
final bool status;
|
|
final Color textColor;
|
|
final double? paddingAmount;
|
|
final bool isFullIcon;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: DeviceControlsContainer(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
if (isFullIcon)
|
|
ClipOval(
|
|
child: SvgPicture.asset(
|
|
icon,
|
|
fit: BoxFit.contain,
|
|
),
|
|
)
|
|
else
|
|
ClipOval(
|
|
child: Container(
|
|
height: 60,
|
|
width: 60,
|
|
padding: EdgeInsets.all(paddingAmount ?? 8),
|
|
color: ColorsManager.white,
|
|
child: SvgPicture.asset(
|
|
icon,
|
|
width: 35,
|
|
height: 35,
|
|
fit: BoxFit.contain,
|
|
),
|
|
)),
|
|
const Spacer(),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 6),
|
|
child: Text(
|
|
name,
|
|
textAlign: TextAlign.start,
|
|
style: context.textTheme.titleMedium!.copyWith(
|
|
fontWeight: FontWeight.w400,
|
|
color: textColor,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|