selfprivacy.org.app/lib/ui/components/brand_radio/brand_radio.dart

41 lines
1014 B
Dart
Raw Normal View History

2021-04-10 06:04:23 +03:00
import 'package:flutter/material.dart';
import 'package:selfprivacy/config/brand_colors.dart';
2022-09-14 18:14:55 +03:00
// TODO: Delete this file.
2021-04-10 06:04:23 +03:00
class BrandRadio extends StatelessWidget {
2022-05-24 21:55:39 +03:00
const BrandRadio({
2021-04-10 06:04:23 +03:00
required this.isChecked,
final super.key,
2022-06-05 22:36:32 +03:00
});
2021-04-10 06:04:23 +03:00
final bool isChecked;
@override
2022-06-05 22:36:32 +03:00
Widget build(final BuildContext context) => Container(
height: 20,
width: 20,
alignment: Alignment.center,
padding: const EdgeInsets.all(2),
decoration: BoxDecoration(
shape: BoxShape.circle,
border: _getBorder(),
),
child: isChecked
? Container(
height: 10,
width: 10,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: BrandColors.primary,
),
)
: null,
);
2021-04-10 06:04:23 +03:00
2022-06-05 22:36:32 +03:00
BoxBorder? _getBorder() => Border.all(
color: isChecked ? BrandColors.primary : BrandColors.gray1,
width: 2,
);
2021-04-10 06:04:23 +03:00
}