mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-15 14:32:48 +00:00
Added theme modal
This commit is contained in:
parent
91ec08614c
commit
eace1767f0
13 changed files with 495 additions and 13 deletions
55
lib/screens/settings/custom_radio.dart
Normal file
55
lib/screens/settings/custom_radio.dart
Normal file
|
@ -0,0 +1,55 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomRadio extends StatelessWidget {
|
||||
final int value;
|
||||
final int groupValue;
|
||||
final Function(int)? onChange;
|
||||
final Color backgroundColor;
|
||||
|
||||
const CustomRadio({
|
||||
Key? key,
|
||||
required this.value,
|
||||
required this.groupValue,
|
||||
this.onChange,
|
||||
required this.backgroundColor,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 20,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: value == groupValue
|
||||
? Theme.of(context).primaryColor
|
||||
: Theme.of(context).brightness == Brightness.dark
|
||||
? const Color.fromRGBO(184, 184, 184, 1)
|
||||
: const Color.fromRGBO(104, 104, 104, 1)
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 16,
|
||||
height: 16,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(35),
|
||||
color: backgroundColor
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 12,
|
||||
height: 12,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
color: value == groupValue
|
||||
? Theme.of(context).primaryColor
|
||||
: backgroundColor
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue