-
-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Ushie <[email protected]> Co-authored-by: Pun Butrach <[email protected]>
- Loading branch information
1 parent
ef9b1d5
commit 7911459
Showing
21 changed files
with
236 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
class HapticCheckbox extends StatelessWidget { | ||
const HapticCheckbox({ | ||
super.key, | ||
required this.value, | ||
required this.onChanged, | ||
this.activeColor, | ||
this.checkColor, | ||
this.side, | ||
}); | ||
final bool value; | ||
final Function(bool?)? onChanged; | ||
final Color? activeColor; | ||
final Color? checkColor; | ||
final BorderSide? side; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Checkbox( | ||
value: value, | ||
onChanged: (value) => { | ||
HapticFeedback.selectionClick(), | ||
if (onChanged != null) onChanged!(value), | ||
}, | ||
activeColor: activeColor, | ||
checkColor: checkColor, | ||
side: side, | ||
); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
lib/ui/widgets/shared/haptics/haptic_checkbox_list_tile.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
class HapticCheckboxListTile extends StatelessWidget { | ||
const HapticCheckboxListTile({ | ||
super.key, | ||
required this.value, | ||
required this.onChanged, | ||
this.title, | ||
this.subtitle, | ||
this.contentPadding, | ||
}); | ||
final bool value; | ||
final Function(bool?)? onChanged; | ||
final Widget? title; | ||
final Widget? subtitle; | ||
final EdgeInsetsGeometry? contentPadding; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return CheckboxListTile( | ||
contentPadding: contentPadding ?? EdgeInsets.zero, | ||
title: title, | ||
subtitle: subtitle, | ||
value: value, | ||
onChanged: (value) => { | ||
HapticFeedback.lightImpact(), | ||
if (onChanged != null) onChanged!(value), | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; | ||
|
||
class HapticCustomCard extends StatelessWidget { | ||
const HapticCustomCard({ | ||
super.key, | ||
this.isFilled = true, | ||
required this.child, | ||
this.onTap, | ||
this.padding, | ||
this.backgroundColor, | ||
}); | ||
final bool isFilled; | ||
final Widget child; | ||
final Function()? onTap; | ||
final EdgeInsetsGeometry? padding; | ||
final Color? backgroundColor; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return CustomCard( | ||
isFilled: isFilled, | ||
onTap: () => { | ||
HapticFeedback.selectionClick(), | ||
if (onTap != null) onTap!(), | ||
}, | ||
padding: padding, | ||
backgroundColor: backgroundColor, | ||
child: child, | ||
); | ||
} | ||
} |
Oops, something went wrong.