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