mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
Merge branch 'master' of github.com:Aunali321/revanced-manager-flutter
This commit is contained in:
86
lib/ui/widgets/patch_item.dart
Normal file
86
lib/ui/widgets/patch_item.dart
Normal file
@ -0,0 +1,86 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class PatchItem extends StatefulWidget {
|
||||
final String name;
|
||||
final String description;
|
||||
final String version;
|
||||
bool isSelected;
|
||||
|
||||
PatchItem({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.description,
|
||||
required this.version,
|
||||
required this.isSelected,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<PatchItem> createState() => _PatchItemState();
|
||||
}
|
||||
|
||||
class _PatchItemState extends State<PatchItem> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xff1B222B),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
||||
margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
widget.name,
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(widget.version)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
widget.description,
|
||||
softWrap: true,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.visible,
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Transform.scale(
|
||||
scale: 1.2,
|
||||
child: Checkbox(
|
||||
value: widget.isSelected,
|
||||
activeColor: Colors.blueGrey[500],
|
||||
onChanged: (newValue) {
|
||||
setState(() {
|
||||
widget.isSelected = newValue!;
|
||||
});
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -2,7 +2,14 @@ import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class SearchBar extends StatefulWidget {
|
||||
const SearchBar({
|
||||
String? hintText = "Search";
|
||||
Color? backgroundColor;
|
||||
Color? hintTextColor;
|
||||
|
||||
SearchBar({
|
||||
required this.hintText,
|
||||
this.backgroundColor = const Color(0xff1B222B),
|
||||
this.hintTextColor = Colors.white,
|
||||
Key? key,
|
||||
required this.onQueryChanged,
|
||||
}) : super(key: key);
|
||||
@ -19,9 +26,9 @@ class _SearchBarState extends State<SearchBar> {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: const Color(0xff1B222B),
|
||||
color: widget.backgroundColor,
|
||||
border: Border.all(
|
||||
color: const Color(0xff1B222B),
|
||||
color: widget.backgroundColor != null ? widget.backgroundColor! : Colors.white,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
@ -34,9 +41,9 @@ class _SearchBarState extends State<SearchBar> {
|
||||
fillColor: Colors.blueGrey[700],
|
||||
filled: true,
|
||||
contentPadding: const EdgeInsets.all(12.0),
|
||||
hintText: 'Search applications',
|
||||
hintText: widget.hintText,
|
||||
hintStyle: GoogleFonts.poppins(
|
||||
color: Colors.white,
|
||||
color: widget.hintTextColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
prefixIcon: const Icon(
|
||||
|
Reference in New Issue
Block a user