mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
a54ca799b9
* update rules of analysis_options.yaml. and solved all problems * refactor: fix remaining problems --------- Co-authored-by: Ushie <ushiekane@gmail.com>
33 lines
791 B
Dart
33 lines
791 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:revanced_manager/ui/widgets/settingsView/custom_switch.dart';
|
|
|
|
class CustomSwitchTile extends StatelessWidget {
|
|
const CustomSwitchTile({
|
|
Key? key,
|
|
required this.title,
|
|
required this.subtitle,
|
|
required this.value,
|
|
required this.onTap,
|
|
this.padding,
|
|
}) : super(key: key);
|
|
final Widget title;
|
|
final Widget subtitle;
|
|
final bool value;
|
|
final Function(bool) onTap;
|
|
final EdgeInsetsGeometry? padding;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListTile(
|
|
contentPadding: padding ?? EdgeInsets.zero,
|
|
title: title,
|
|
subtitle: subtitle,
|
|
onTap: () => onTap(!value),
|
|
trailing: CustomSwitch(
|
|
value: value,
|
|
onChanged: onTap,
|
|
),
|
|
);
|
|
}
|
|
}
|