Extracted Add Devices button into a private method.

This commit is contained in:
Faris Armoush
2025-04-15 15:23:36 +03:00
parent f57348e5cd
commit 08e5e17910

View File

@ -53,18 +53,18 @@ class TagChipDisplay extends StatelessWidget {
return SizedBox(
width: screenWidth * 0.25,
child: Container(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: ColorsManager.textFieldGreyColor,
borderRadius: BorderRadius.circular(15),
border: Border.all(
color: ColorsManager.textFieldGreyColor,
width: 3.0,
width: 3,
),
),
child: Wrap(
spacing: 8.0,
runSpacing: 8.0,
spacing: 8,
runSpacing: 8,
children: [
..._groupedTags.entries.map((entry) {
return Chip(
@ -120,6 +120,11 @@ class TagChipDisplay extends StatelessWidget {
),
);
} else {
return _buildAddDevicesButton(context);
}
}
Widget _buildAddDevicesButton(BuildContext context) {
return TextButton(
onPressed: () => showDialog<void>(
context: context,
@ -144,5 +149,4 @@ class TagChipDisplay extends StatelessWidget {
),
);
}
}
}