2020-12-06 07:46:12 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:selfprivacy/config/brand_colors.dart';
|
|
|
|
|
2022-09-14 16:45:50 +00:00
|
|
|
// TODO: Delete this file.
|
|
|
|
|
2020-12-06 07:46:12 +00:00
|
|
|
class SwitcherBlock extends StatelessWidget {
|
|
|
|
const SwitcherBlock({
|
2021-03-15 15:39:44 +00:00
|
|
|
required this.child,
|
|
|
|
required this.isActive,
|
|
|
|
required this.onChange,
|
2022-10-26 16:26:09 +00:00
|
|
|
super.key,
|
2022-06-05 19:36:32 +00:00
|
|
|
});
|
2020-12-06 07:46:12 +00:00
|
|
|
|
|
|
|
final Widget child;
|
|
|
|
final bool isActive;
|
2020-12-08 19:26:51 +00:00
|
|
|
final ValueChanged<bool> onChange;
|
2020-12-06 07:46:12 +00:00
|
|
|
|
|
|
|
@override
|
2022-06-05 19:36:32 +00:00
|
|
|
Widget build(final BuildContext context) => Container(
|
2022-09-14 16:45:50 +00:00
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
2022-06-05 22:40:34 +00:00
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Flexible(child: child),
|
|
|
|
const SizedBox(width: 5),
|
|
|
|
Switch(
|
|
|
|
activeColor: BrandColors.green1,
|
|
|
|
activeTrackColor: BrandColors.green2,
|
|
|
|
onChanged: onChange,
|
|
|
|
value: isActive,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
2020-12-06 07:46:12 +00:00
|
|
|
}
|