More UI changes

This commit is contained in:
Juan Gilsanz Polo 2022-11-04 22:56:00 +01:00
parent 55010f8896
commit 5067122344
36 changed files with 819 additions and 743 deletions

View file

@ -25,7 +25,12 @@ ThemeData lightTheme(ColorScheme? dynamicColorScheme) => ThemeData(
), ),
), ),
navigationBarTheme: NavigationBarThemeData( navigationBarTheme: NavigationBarThemeData(
indicatorColor: dynamicColorScheme != null ? dynamicColorScheme.primaryContainer : adguardGreenColor, indicatorColor: dynamicColorScheme != null ? dynamicColorScheme.secondaryContainer : adguardGreenColor,
iconTheme: MaterialStateProperty.all(
IconThemeData(
color: dynamicColorScheme != null ? dynamicColorScheme.onSecondaryContainer : adguardGreenColor,
)
)
), ),
floatingActionButtonTheme: FloatingActionButtonThemeData( floatingActionButtonTheme: FloatingActionButtonThemeData(
foregroundColor: Colors.white, foregroundColor: Colors.white,
@ -79,7 +84,12 @@ ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
scaffoldBackgroundColor: dynamicColorScheme != null ? dynamicColorScheme.background :const Color.fromRGBO(18, 18, 18, 1), scaffoldBackgroundColor: dynamicColorScheme != null ? dynamicColorScheme.background :const Color.fromRGBO(18, 18, 18, 1),
dialogBackgroundColor: dynamicColorScheme != null ? dynamicColorScheme.background : const Color.fromRGBO(44, 44, 44, 1), dialogBackgroundColor: dynamicColorScheme != null ? dynamicColorScheme.background : const Color.fromRGBO(44, 44, 44, 1),
navigationBarTheme: NavigationBarThemeData( navigationBarTheme: NavigationBarThemeData(
indicatorColor: dynamicColorScheme != null ? dynamicColorScheme.primaryContainer : adguardGreenColor, indicatorColor: dynamicColorScheme != null ? dynamicColorScheme.secondaryContainer : adguardGreenColor,
iconTheme: MaterialStateProperty.all(
IconThemeData(
color: dynamicColorScheme != null ? dynamicColorScheme.onSecondaryContainer : adguardGreenColor,
)
)
), ),
snackBarTheme: SnackBarThemeData( snackBarTheme: SnackBarThemeData(
contentTextStyle: const TextStyle( contentTextStyle: const TextStyle(

View file

@ -199,7 +199,7 @@ class _AddedListState extends State<AddedList> {
padding: const EdgeInsets.only(top: 0), padding: const EdgeInsets.only(top: 0),
itemCount: widget.data.length, itemCount: widget.data.length,
itemBuilder: (context, index) => ListTile( itemBuilder: (context, index) => ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15), contentPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
isThreeLine: true, isThreeLine: true,
onLongPress: () => openOptionsModal(widget.data[index]), onLongPress: () => openOptionsModal(widget.data[index]),
onTap: () => openClientModal(widget.data[index]), onTap: () => openClientModal(widget.data[index]),
@ -207,16 +207,22 @@ class _AddedListState extends State<AddedList> {
padding: const EdgeInsets.only(bottom: 5), padding: const EdgeInsets.only(bottom: 5),
child: Text( child: Text(
widget.data[index].name, widget.data[index].name,
style: const TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.normal fontWeight: FontWeight.normal,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
), ),
subtitle: Column( subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(widget.data[index].ids.toString().replaceAll(RegExp(r'^\[|\]$'), '')), Text(
widget.data[index].ids.toString().replaceAll(RegExp(r'^\[|\]$'), ''),
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant
),
),
const SizedBox(height: 7), const SizedBox(height: 7),
Row( Row(
children: [ children: [

View file

@ -121,26 +121,15 @@ class _ClientsWidgetState extends State<ClientsWidget> with TickerProviderStateM
], ],
bottom: TabBar( bottom: TabBar(
controller: tabController, controller: tabController,
unselectedLabelColor: Theme.of(context).colorScheme.onSurfaceVariant,
tabs: [ tabs: [
Tab( Tab(
child: Row( icon: const Icon(Icons.devices),
mainAxisAlignment: MainAxisAlignment.center, text: AppLocalizations.of(context)!.activeClients,
children: [
const Icon(Icons.devices),
const SizedBox(width: 20),
Text(AppLocalizations.of(context)!.activeClients)
],
),
), ),
Tab( Tab(
child: Row( icon: const Icon(Icons.add_rounded),
mainAxisAlignment: MainAxisAlignment.center, text: AppLocalizations.of(context)!.added,
children: [
const Icon(Icons.add),
const SizedBox(width: 20),
Text(AppLocalizations.of(context)!.added)
],
),
), ),
] ]
) )
@ -154,9 +143,7 @@ class _ClientsWidgetState extends State<ClientsWidget> with TickerProviderStateM
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
border: Border( border: Border(
top: BorderSide( top: BorderSide(
color: Theme.of(context).brightness == Brightness.light color: Theme.of(context).colorScheme.surfaceVariant
? const Color.fromRGBO(220, 220, 220, 1)
: const Color.fromRGBO(50, 50, 50, 1)
) )
) )
), ),

View file

@ -56,7 +56,12 @@ class ClientsList extends StatelessWidget {
subtitle: data[index].name != '' subtitle: data[index].name != ''
? data[index].ip ? data[index].ip
: null, : null,
trailing: Text(data[index].source), trailing: Text(
data[index].source,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface
),
),
) )
); );
} }

View file

@ -14,51 +14,54 @@ class OptionsModal extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AlertDialog( return AlertDialog(
contentPadding: const EdgeInsets.all(0), contentPadding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 16
),
title: Column( title: Column(
children: [ children: [
const Icon(Icons.more_horiz), const Icon(Icons.more_horiz),
const SizedBox(height: 20), const SizedBox(height: 16),
Text(AppLocalizations.of(context)!.options) Text(AppLocalizations.of(context)!.options)
], ],
), ),
content: SizedBox( content: Column(
height: 150, mainAxisSize: MainAxisSize.min,
width: double.minPositive, children: [
child: ListView( const SizedBox(height: 24),
physics: const NeverScrollableScrollPhysics(), ListTile(
children: [ onTap: () {
const SizedBox(height: 25), Navigator.pop(context);
ListTile( onEdit();
onTap: () { },
Navigator.pop(context); title: Text(
onEdit(); AppLocalizations.of(context)!.edit,
}, style: TextStyle(
title: Padding( color: Theme.of(context).colorScheme.onSurface
padding: const EdgeInsets.all(10.0),
child: Text(AppLocalizations.of(context)!.edit),
),
leading: const Padding(
padding: EdgeInsets.only(left: 10),
child: Icon(Icons.edit),
), ),
), ),
ListTile( leading: Icon(
onTap: () { Icons.edit,
Navigator.pop(context); color: Theme.of(context).colorScheme.onSurfaceVariant,
onDelete(); ),
}, ),
title: Padding( ListTile(
padding: const EdgeInsets.all(10.0), onTap: () {
child: Text(AppLocalizations.of(context)!.delete), Navigator.pop(context);
), onDelete();
leading: const Padding( },
padding: EdgeInsets.only(left: 10), title: Text(
child: Icon(Icons.delete), AppLocalizations.of(context)!.delete,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
], leading: Icon(
), Icons.delete,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
],
), ),
actions: [ actions: [
TextButton( TextButton(

View file

@ -14,15 +14,26 @@ class RemoveClientModal extends StatelessWidget {
return AlertDialog( return AlertDialog(
title: Column( title: Column(
children: [ children: [
const Icon( Icon(
Icons.delete_rounded, Icons.delete_rounded,
size: 26, size: 24,
color: Theme.of(context).colorScheme.secondary
), ),
const SizedBox(height: 20), const SizedBox(height: 16),
Text(AppLocalizations.of(context)!.removeClient) Text(
AppLocalizations.of(context)!.removeClient,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface
),
)
], ],
), ),
content: Text(AppLocalizations.of(context)!.removeClientMessage), content: Text(
AppLocalizations.of(context)!.removeClientMessage,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant
),
),
actions: [ actions: [
TextButton( TextButton(
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),

View file

@ -1,18 +1,15 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:material_segmented_control/material_segmented_control.dart';
import 'package:flutter_web_browser/flutter_web_browser.dart'; import 'package:flutter_web_browser/flutter_web_browser.dart';
import 'package:adguard_home_manager/widgets/custom_radio_toggle.dart';
import 'package:adguard_home_manager/constants/urls.dart'; import 'package:adguard_home_manager/constants/urls.dart';
class AddCustomRule extends StatefulWidget { class AddCustomRule extends StatefulWidget {
final ScrollController scrollController;
final void Function(String) onConfirm; final void Function(String) onConfirm;
const AddCustomRule({ const AddCustomRule({
Key? key, Key? key,
required this.scrollController,
required this.onConfirm required this.onConfirm
}) : super(key: key); }) : super(key: key);
@ -24,19 +21,14 @@ class _AddCustomRuleState extends State<AddCustomRule> {
final TextEditingController domainController = TextEditingController(); final TextEditingController domainController = TextEditingController();
String? domainError; String? domainError;
String preset = "block"; int preset = 0;
bool addImportant = false; bool addImportant = false;
bool checkValidValues() { bool checkValidValues() {
if ( if (
domainController.text != '' && domainController.text != '' &&
domainError == null && domainError == null
(
preset == 'block' ||
preset == 'unblock' ||
preset == 'custom'
)
) { ) {
return true; return true;
} }
@ -61,10 +53,10 @@ class _AddCustomRuleState extends State<AddCustomRule> {
String fieldValue = value ?? domainController.text; String fieldValue = value ?? domainController.text;
if (preset == 'block') { if (preset == 0) {
rule = "||${fieldValue.trim()}^"; rule = "||${fieldValue.trim()}^";
} }
else if (preset == 'unblock') { else if (preset == 1) {
rule = "@@||${fieldValue.trim()}^"; rule = "@@||${fieldValue.trim()}^";
} }
else { else {
@ -96,318 +88,311 @@ class _AddCustomRuleState extends State<AddCustomRule> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( Map<int, Widget> presets = {
padding: MediaQuery.of(context).viewInsets, 0: Text(
child: Container( AppLocalizations.of(context)!.block,
decoration: BoxDecoration( style: TextStyle(
color: Theme.of(context).dialogBackgroundColor, color: Theme.of(context).colorScheme.onSurface,
borderRadius: const BorderRadius.only( fontSize: 14,
topLeft: Radius.circular(28), fontWeight: FontWeight.w500
topRight: Radius.circular(28)
)
), ),
child: Column( ),
children: [ 1: Text(
Expanded( AppLocalizations.of(context)!.unblock,
child: ListView( style: TextStyle(
controller: widget.scrollController, color: Theme.of(context).colorScheme.onSurface,
children: [ fontSize: 14,
const Padding( fontWeight: FontWeight.w500
padding: EdgeInsets.only(top: 28), ),
child: Icon( ),
Icons.shield_rounded, 2: Text(
size: 26, AppLocalizations.of(context)!.custom,
), style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 14,
fontWeight: FontWeight.w500
),
),
};
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.addCustomRule),
),
body: ListView(
children: [
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5
),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(30),
border: Border.all(
color: Theme.of(context).primaryColor
)
),
child: Text(
buildRule(),
textAlign: TextAlign.center,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w500
), ),
const SizedBox(height: 20), )
Text( ),
AppLocalizations.of(context)!.addCustomRule, ],
textAlign: TextAlign.center, ),
style: const TextStyle( const SizedBox(height: 30),
fontSize: 24 Padding(
), padding: const EdgeInsets.symmetric(horizontal: 24),
), child: TextFormField(
const SizedBox(height: 30), controller: domainController,
Row( onChanged: (value) => setState(() => {}),
mainAxisAlignment: MainAxisAlignment.center, decoration: InputDecoration(
mainAxisSize: MainAxisSize.min, prefixIcon: const Icon(Icons.link_rounded),
children: [ border: const OutlineInputBorder(
Container( borderRadius: BorderRadius.all(
padding: const EdgeInsets.symmetric( Radius.circular(10)
horizontal: 10, )
vertical: 5 ),
), errorText: domainError,
decoration: BoxDecoration( labelText: AppLocalizations.of(context)!.domain,
color: Theme.of(context).primaryColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(30),
border: Border.all(
color: Theme.of(context).primaryColor
)
),
child: Text(
buildRule(),
textAlign: TextAlign.center,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w500
),
)
),
],
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: TextFormField(
controller: domainController,
onChanged: (value) => setState(() => {}),
decoration: InputDecoration(
prefixIcon: const Icon(Icons.link_rounded),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10)
)
),
errorText: domainError,
labelText: AppLocalizations.of(context)!.domain,
),
),
),
const SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
CustomRadioToggle(
groupSelected: preset,
value: 'block',
label: AppLocalizations.of(context)!.block,
onTap: (value) => setState(() => preset = value)
),
CustomRadioToggle(
groupSelected: preset,
value: 'unblock',
label: AppLocalizations.of(context)!.unblock,
onTap: (value) => setState(() => preset = value)
),
CustomRadioToggle(
groupSelected: preset,
value: 'custom',
label: AppLocalizations.of(context)!.custom,
onTap: (value) => setState(() => preset = value)
),
],
),
const SizedBox(height: 20),
Material(
color: Colors.transparent,
child: InkWell(
onTap: () => setState(() => addImportant = !addImportant),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(left: 10),
child: Text(
AppLocalizations.of(context)!.addImportant,
style: const TextStyle(
fontSize: 16
),
),
),
Switch(
value: addImportant,
onChanged: (value) => setState(() => addImportant = value),
activeColor: Theme.of(context).primaryColor,
)
],
),
),
),
),
const SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Card(
child: Padding(
padding: const EdgeInsets.all(20),
child: Column(
children: [
Row(
children: [
const Icon(Icons.info),
const SizedBox(width: 20),
Text(
AppLocalizations.of(context)!.examples,
style: const TextStyle(
fontSize: 18
),
)
],
),
const SizedBox(height: 20),
SizedBox(
width: double.maxFinite,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"||example.org^",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 5),
Text(
AppLocalizations.of(context)!.example1,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 20),
Text(
"@@||example.org^",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 5),
Text(
AppLocalizations.of(context)!.example2,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 20),
Text(
"! Here goes a comment",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
Text(
"# Also a comment",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 5),
Text(
AppLocalizations.of(context)!.example3,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 20),
Text(
"/REGEX/",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 5),
Text(
AppLocalizations.of(context)!.example4,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor
),
),
],
),
)
],
),
),
),
),
const SizedBox(height: 20),
Material(
color: Colors.transparent,
child: InkWell(
onTap: openDocsPage,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(left: 10),
child: Text(
AppLocalizations.of(context)!.moreInformation,
style: const TextStyle(
fontSize: 16
),
),
),
const Padding(
padding: EdgeInsets.only(right: 15),
child: Icon(Icons.open_in_new),
)
],
),
),
),
),
],
), ),
), ),
Padding( ),
padding: const EdgeInsets.only( const SizedBox(height: 30),
left: 28, MaterialSegmentedControl(
right: 28, children: presets,
top: 20, selectionIndex: preset,
bottom: 28 onSegmentChosen: (value) => setState(() => preset = value),
selectedColor: Theme.of(context).colorScheme.secondaryContainer,
unselectedColor: Colors.transparent,
borderColor: Theme.of(context).colorScheme.onSurface,
),
const SizedBox(height: 20),
Material(
color: Colors.transparent,
child: InkWell(
onTap: () => setState(() => addImportant = !addImportant),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 28),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(left: 10),
child: Text(
AppLocalizations.of(context)!.addImportant,
style: TextStyle(
fontSize: 16,
color: Theme.of(context).colorScheme.onSurface
),
),
),
Switch(
value: addImportant,
onChanged: (value) => setState(() => addImportant = value),
activeColor: Theme.of(context).primaryColor,
)
],
),
), ),
child: Row( ),
mainAxisAlignment: MainAxisAlignment.end, ),
children: [ const SizedBox(height: 20),
TextButton( Padding(
onPressed: () => Navigator.pop(context), padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(AppLocalizations.of(context)!.cancel) child: Card(
), child: Padding(
const SizedBox(width: 20), padding: const EdgeInsets.all(20),
TextButton( child: Column(
onPressed: checkValidValues() == true children: [
? () { Row(
Navigator.pop(context); children: [
widget.onConfirm(buildRule()); Icon(
} Icons.info,
: null, color: Theme.of(context).colorScheme.onSurface
child: Text( ),
AppLocalizations.of(context)!.confirm, const SizedBox(width: 20),
style: TextStyle( Text(
color: checkValidValues() == true AppLocalizations.of(context)!.examples,
? Theme.of(context).primaryColor style: TextStyle(
: Colors.grey fontSize: 18,
color: Theme.of(context).colorScheme.onSurface
),
)
],
),
const SizedBox(height: 20),
SizedBox(
width: double.maxFinite,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"||example.org^",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 5),
Text(
AppLocalizations.of(context)!.example1,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 20),
Text(
"@@||example.org^",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 5),
Text(
AppLocalizations.of(context)!.example2,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 20),
Text(
"! Here goes a comment",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
Text(
"# Also a comment",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 5),
Text(
AppLocalizations.of(context)!.example3,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 20),
Text(
"/REGEX/",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
const SizedBox(height: 5),
Text(
AppLocalizations.of(context)!.example4,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor
),
),
],
), ),
) )
), ],
], ),
), ),
) ),
], ),
), const SizedBox(height: 20),
Material(
color: Colors.transparent,
child: InkWell(
onTap: openDocsPage,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(left: 10),
child: Text(
AppLocalizations.of(context)!.moreInformation,
style: TextStyle(
fontSize: 16,
color: Theme.of(context).colorScheme.onSurface
),
),
),
Padding(
padding: const EdgeInsets.only(right: 15),
child: Icon(
Icons.open_in_new,
color: Theme.of(context).colorScheme.onSurface
),
)
],
),
),
),
),
const SizedBox(height: 20)
],
), ),
); );
} }
} }
// Padding(
// padding: const EdgeInsets.only(
// left: 28,
// right: 28,
// top: 20,
// bottom: 28
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// TextButton(
// onPressed: () => Navigator.pop(context),
// child: Text(AppLocalizations.of(context)!.cancel)
// ),
// const SizedBox(width: 20),
// TextButton(
// onPressed: checkValidValues() == true
// ? () {
// Navigator.pop(context);
// widget.onConfirm(buildRule());
// }
// : null,
// child: Text(
// AppLocalizations.of(context)!.confirm,
// style: TextStyle(
// color: checkValidValues() == true
// ? Theme.of(context).primaryColor
// : Colors.grey
// ),
// )
// ),
// ],
// ),
// )

View file

@ -71,19 +71,21 @@ class _BlockedServicesModalState extends State<BlockedServicesModal> {
child: ListView( child: ListView(
controller: widget.scrollController, controller: widget.scrollController,
children: [ children: [
const Padding( Padding(
padding: EdgeInsets.only(top: 28), padding: const EdgeInsets.only(top: 24),
child: Icon( child: Icon(
Icons.block, Icons.block,
size: 26, size: 24,
color: Theme.of(context).colorScheme.secondary,
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 16),
Text( Text(
AppLocalizations.of(context)!.blockedServices, AppLocalizations.of(context)!.blockedServices,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: TextStyle(
fontSize: 24 fontSize: 24,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
@ -102,8 +104,9 @@ class _BlockedServicesModalState extends State<BlockedServicesModal> {
children: [ children: [
Text( Text(
services[index]['label']!, services[index]['label']!,
style: const TextStyle( style: TextStyle(
fontSize: 16 fontSize: 16,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
Checkbox( Checkbox(

View file

@ -120,7 +120,7 @@ class _CheckHostModalState extends State<CheckHostModal> {
return Padding( return Padding(
padding: MediaQuery.of(context).viewInsets, padding: MediaQuery.of(context).viewInsets,
child: Container( child: Container(
height: 350, height: 330,
width: double.maxFinite, width: double.maxFinite,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
@ -138,24 +138,26 @@ class _CheckHostModalState extends State<CheckHostModal> {
? const NeverScrollableScrollPhysics() ? const NeverScrollableScrollPhysics()
: null, : null,
children: [ children: [
const Padding( Padding(
padding: EdgeInsets.only(top: 24), padding: const EdgeInsets.only(top: 24),
child: Icon( child: Icon(
Icons.shield_rounded, Icons.shield_rounded,
size: 26, size: 24,
color: Theme.of(context).colorScheme.secondary,
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 16),
Text( Text(
AppLocalizations.of(context)!.checkHostFiltered, AppLocalizations.of(context)!.checkHostFiltered,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: TextStyle(
fontSize: 24 fontSize: 24,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
const SizedBox(height: 30), const SizedBox(height: 16),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 24),
child: TextFormField( child: TextFormField(
controller: domainController, controller: domainController,
onChanged: validateDomain, onChanged: validateDomain,
@ -202,8 +204,8 @@ class _CheckHostModalState extends State<CheckHostModal> {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
bottom: 20, bottom: 24,
right: 20 right: 24
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,

View file

@ -148,10 +148,8 @@ class _CustomRulesListState extends State<CustomRulesList> {
widget.data[index], widget.data[index],
style: TextStyle( style: TextStyle(
color: checkIfComment(widget.data[index]) == true color: checkIfComment(widget.data[index]) == true
? Theme.of(context).brightness == Brightness.light ? Theme.of(context).colorScheme.onSurface.withOpacity(0.6)
? const Color.fromRGBO(100, 100, 100, 1) : Theme.of(context).colorScheme.onSurface,
: const Color.fromRGBO(200, 200, 200, 1)
: null,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
), ),

View file

@ -64,20 +64,12 @@ class FiltersFab extends StatelessWidget {
} }
void openAddCustomRule() { void openAddCustomRule() {
ScaffoldMessenger.of(context).clearSnackBars(); Navigator.of(context).push(
showFlexibleBottomSheet( MaterialPageRoute(
minHeight: 0.7, builder: (context) => AddCustomRule(
initHeight: 0.7, onConfirm: confirmAddRule
maxHeight: 0.95, ),
isCollapsible: true, )
duration: const Duration(milliseconds: 250),
anchors: [0.7, 0.95],
context: context,
builder: (ctx, controller, offset) => AddCustomRule(
scrollController: controller,
onConfirm: confirmAddRule
),
bottomSheetColor: Colors.transparent
); );
} }

View file

@ -19,7 +19,7 @@ class FilterListTile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [

View file

@ -367,36 +367,19 @@ class _FiltersWidgetState extends State<FiltersWidget> with TickerProviderStateM
bottom: TabBar( bottom: TabBar(
controller: tabController, controller: tabController,
isScrollable: true, isScrollable: true,
unselectedLabelColor: Theme.of(context).colorScheme.onSurfaceVariant,
tabs: [ tabs: [
Tab( Tab(
child: Row( icon: const Icon(Icons.verified_user_rounded),
mainAxisAlignment: MainAxisAlignment.center, text: AppLocalizations.of(context)!.whitelists,
children: [
const Icon(Icons.verified_user_rounded),
const SizedBox(width: 20),
Text(AppLocalizations.of(context)!.whitelists),
],
),
), ),
Tab( Tab(
child: Row( icon: const Icon(Icons.gpp_bad_rounded),
mainAxisAlignment: MainAxisAlignment.center, text: AppLocalizations.of(context)!.blacklist,
children: [
const Icon(Icons.gpp_bad_rounded),
const SizedBox(width: 20),
Text(AppLocalizations.of(context)!.blacklist),
],
),
), ),
Tab( Tab(
child: Row( icon: const Icon(Icons.shield_rounded),
mainAxisAlignment: MainAxisAlignment.center, text: AppLocalizations.of(context)!.customRules,
children: [
const Icon(Icons.shield_rounded),
const SizedBox(width: 20),
Text(AppLocalizations.of(context)!.customRules),
],
),
), ),
] ]
) )
@ -410,9 +393,7 @@ class _FiltersWidgetState extends State<FiltersWidget> with TickerProviderStateM
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
border: Border( border: Border(
top: BorderSide( top: BorderSide(
color: Theme.of(context).brightness == Brightness.light color: Theme.of(context).colorScheme.surfaceVariant
? const Color.fromRGBO(220, 220, 220, 1)
: const Color.fromRGBO(50, 50, 50, 1)
) )
) )
), ),

View file

@ -14,18 +14,27 @@ class RemoveCustomRule extends StatelessWidget {
return AlertDialog( return AlertDialog(
title: Column( title: Column(
children: [ children: [
const Icon( Icon(
Icons.shield_rounded, Icons.shield_rounded,
size: 26, size: 24,
color: Theme.of(context).colorScheme.secondary
), ),
const SizedBox(height: 20), const SizedBox(height: 16),
Text( Text(
AppLocalizations.of(context)!.removeCustomRule, AppLocalizations.of(context)!.removeCustomRule,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface
),
) )
], ],
), ),
content: Text(AppLocalizations.of(context)!.removeCustomRuleMessage), content: Text(
AppLocalizations.of(context)!.removeCustomRuleMessage,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface
),
),
actions: [ actions: [
TextButton( TextButton(
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),

View file

@ -42,7 +42,7 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
return Padding( return Padding(
padding: mediaQueryData.viewInsets, padding: mediaQueryData.viewInsets,
child: Container( child: Container(
height: 410, height: 390,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).dialogBackgroundColor, color: Theme.of(context).dialogBackgroundColor,
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
@ -59,211 +59,216 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
? const NeverScrollableScrollPhysics() ? const NeverScrollableScrollPhysics()
: null, : null,
children: [ children: [
const Padding( Padding(
padding: EdgeInsets.only(top: 24), padding: const EdgeInsets.only(top: 24),
child: Icon( child: Icon(
Icons.update_rounded, Icons.update_rounded,
size: 26, size: 24,
), color: Theme.of(context).colorScheme.secondary,
),
Container(
padding: const EdgeInsets.all(24),
width: double.maxFinite,
child: Text(
AppLocalizations.of(context)!.updateFrequency,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 24,
), ),
), ),
), Container(
SizedBox( padding: const EdgeInsets.symmetric(
width: double.maxFinite, horizontal: 24,
child: Padding( vertical: 16
padding: const EdgeInsets.symmetric(horizontal: 20), ),
child: Column( width: double.maxFinite,
children: [ child: Text(
Row( AppLocalizations.of(context)!.updateFrequency,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, textAlign: TextAlign.center,
children: [ overflow: TextOverflow.ellipsis,
Container( style: TextStyle(
width: (mediaQueryData.size.width-70)/2, fontSize: 24,
margin: const EdgeInsets.only( color: Theme.of(context).colorScheme.onSurface
top: 10, ),
right: 5, ),
bottom: 5 ),
), SizedBox(
child: OptionBox( width: double.maxFinite,
optionsValue: selectedOption, child: Padding(
itemValue: 0, padding: const EdgeInsets.symmetric(horizontal: 20),
onTap: _updateRadioValue, child: Column(
child: Center( children: [
child: AnimatedDefaultTextStyle( Row(
duration: const Duration(milliseconds: 250), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
style: TextStyle( children: [
fontWeight: FontWeight.bold, Container(
fontSize: 14, width: (mediaQueryData.size.width-70)/2,
color: selectedOption == 0 margin: const EdgeInsets.only(
? Theme.of(context).primaryColor top: 10,
: Theme.of(context).textTheme.bodyText1!.color right: 5,
), bottom: 5
child: Text(AppLocalizations.of(context)!.never), ),
), child: OptionBox(
), optionsValue: selectedOption,
), itemValue: 0,
), onTap: _updateRadioValue,
Container( child: Center(
width: (mediaQueryData.size.width-70)/2, child: AnimatedDefaultTextStyle(
margin: const EdgeInsets.only( duration: const Duration(milliseconds: 250),
top: 10, style: TextStyle(
left: 5, fontWeight: FontWeight.bold,
bottom: 5 fontSize: 14,
), color: selectedOption == 0
child: OptionBox( ? Theme.of(context).primaryColor
optionsValue: selectedOption, : Theme.of(context).textTheme.bodyText1!.color
itemValue: 1, ),
onTap: _updateRadioValue, child: Text(AppLocalizations.of(context)!.never),
child: Center( ),
child: AnimatedDefaultTextStyle( ),
duration: const Duration(milliseconds: 250), ),
style: TextStyle( ),
fontWeight: FontWeight.bold, Container(
fontSize: 14, width: (mediaQueryData.size.width-70)/2,
color: selectedOption == 1 margin: const EdgeInsets.only(
? Theme.of(context).primaryColor top: 10,
: Theme.of(context).textTheme.bodyText1!.color left: 5,
), bottom: 5
child: Text(AppLocalizations.of(context)!.hour1), ),
), child: OptionBox(
), optionsValue: selectedOption,
), itemValue: 1,
), onTap: _updateRadioValue,
], child: Center(
), child: AnimatedDefaultTextStyle(
Row( duration: const Duration(milliseconds: 250),
mainAxisAlignment: MainAxisAlignment.spaceEvenly, style: TextStyle(
children: [ fontWeight: FontWeight.bold,
Container( fontSize: 14,
width: (mediaQueryData.size.width-70)/2, color: selectedOption == 1
margin: const EdgeInsets.only( ? Theme.of(context).primaryColor
top: 5, : Theme.of(context).textTheme.bodyText1!.color
right: 5, ),
bottom: 5 child: Text(AppLocalizations.of(context)!.hour1),
), ),
child: OptionBox( ),
optionsValue: selectedOption, ),
itemValue: 12, ),
onTap: _updateRadioValue, ],
child: Center( ),
child: AnimatedDefaultTextStyle( Row(
duration: const Duration(milliseconds: 250), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
style: TextStyle( children: [
fontWeight: FontWeight.bold, Container(
fontSize: 14, width: (mediaQueryData.size.width-70)/2,
color: selectedOption == 12 margin: const EdgeInsets.only(
? Theme.of(context).primaryColor top: 5,
: Theme.of(context).textTheme.bodyText1!.color right: 5,
), bottom: 5
child: Text(AppLocalizations.of(context)!.hours12), ),
), child: OptionBox(
), optionsValue: selectedOption,
), itemValue: 12,
), onTap: _updateRadioValue,
Container( child: Center(
width: (mediaQueryData.size.width-70)/2, child: AnimatedDefaultTextStyle(
margin: const EdgeInsets.only( duration: const Duration(milliseconds: 250),
top: 5, style: TextStyle(
left: 5, fontWeight: FontWeight.bold,
bottom: 5 fontSize: 14,
), color: selectedOption == 12
child: OptionBox( ? Theme.of(context).primaryColor
optionsValue: selectedOption, : Theme.of(context).textTheme.bodyText1!.color
itemValue: 24, ),
onTap: _updateRadioValue, child: Text(AppLocalizations.of(context)!.hours12),
child: Center( ),
child: AnimatedDefaultTextStyle( ),
duration: const Duration(milliseconds: 250), ),
style: TextStyle( ),
fontWeight: FontWeight.bold, Container(
fontSize: 14, width: (mediaQueryData.size.width-70)/2,
color: selectedOption == 24 margin: const EdgeInsets.only(
? Theme.of(context).primaryColor top: 5,
: Theme.of(context).textTheme.bodyText1!.color left: 5,
), bottom: 5
child: Text(AppLocalizations.of(context)!.hours24), ),
), child: OptionBox(
), optionsValue: selectedOption,
), itemValue: 24,
), onTap: _updateRadioValue,
], child: Center(
), child: AnimatedDefaultTextStyle(
Row( duration: const Duration(milliseconds: 250),
mainAxisAlignment: MainAxisAlignment.spaceEvenly, style: TextStyle(
children: [ fontWeight: FontWeight.bold,
Container( fontSize: 14,
width: (mediaQueryData.size.width-70)/2, color: selectedOption == 24
margin: const EdgeInsets.only( ? Theme.of(context).primaryColor
top: 5, : Theme.of(context).textTheme.bodyText1!.color
right: 5, ),
bottom: 10 child: Text(AppLocalizations.of(context)!.hours24),
), ),
child: OptionBox( ),
optionsValue: selectedOption, ),
itemValue: 72, ),
onTap: _updateRadioValue, ],
child: Center( ),
child: AnimatedDefaultTextStyle( Row(
duration: const Duration(milliseconds: 250), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
style: TextStyle( children: [
fontWeight: FontWeight.bold, Container(
fontSize: 14, width: (mediaQueryData.size.width-70)/2,
color: selectedOption == 72 margin: const EdgeInsets.only(
? Theme.of(context).primaryColor top: 5,
: Theme.of(context).textTheme.bodyText1!.color right: 5,
), bottom: 10
child: Text(AppLocalizations.of(context)!.days3), ),
), child: OptionBox(
), optionsValue: selectedOption,
), itemValue: 72,
), onTap: _updateRadioValue,
Container( child: Center(
width: (mediaQueryData.size.width-70)/2, child: AnimatedDefaultTextStyle(
margin: const EdgeInsets.only( duration: const Duration(milliseconds: 250),
top: 5, style: TextStyle(
left: 5, fontWeight: FontWeight.bold,
bottom: 10 fontSize: 14,
), color: selectedOption == 72
child: OptionBox( ? Theme.of(context).primaryColor
optionsValue: selectedOption, : Theme.of(context).textTheme.bodyText1!.color
itemValue: 168, ),
onTap: _updateRadioValue, child: Text(AppLocalizations.of(context)!.days3),
child: Center( ),
child: AnimatedDefaultTextStyle( ),
duration: const Duration(milliseconds: 250), ),
style: TextStyle( ),
fontWeight: FontWeight.bold, Container(
fontSize: 14, width: (mediaQueryData.size.width-70)/2,
color: selectedOption == 168 margin: const EdgeInsets.only(
? Theme.of(context).primaryColor top: 5,
: Theme.of(context).textTheme.bodyText1!.color left: 5,
), bottom: 10
child: Text(AppLocalizations.of(context)!.days7), ),
), child: OptionBox(
), optionsValue: selectedOption,
), itemValue: 168,
), onTap: _updateRadioValue,
], child: Center(
), child: AnimatedDefaultTextStyle(
], duration: const Duration(milliseconds: 250),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: selectedOption == 168
? Theme.of(context).primaryColor
: Theme.of(context).textTheme.bodyText1!.color
),
child: Text(AppLocalizations.of(context)!.days7),
),
),
),
),
],
),
],
),
), ),
), ),
),
], ],
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(24),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [

View file

@ -50,9 +50,10 @@ class HomeChart extends StatelessWidget {
children: [ children: [
Text( Text(
label, label,
style: const TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
!isEmpty !isEmpty
@ -110,10 +111,11 @@ class HomeChart extends StatelessWidget {
], ],
), ),
), ),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: Divider( child: Divider(
thickness: 1, thickness: 1,
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),

View file

@ -83,10 +83,11 @@ class _HomeState extends State<Home> {
controller: scrollController, controller: scrollController,
children: [ children: [
ServerStatus(serverStatus: serversProvider.serverStatus.data!), ServerStatus(serverStatus: serversProvider.serverStatus.data!),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: Divider( child: Divider(
thickness: 1, thickness: 1,
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
@ -128,10 +129,11 @@ class _HomeState extends State<Home> {
data: serversProvider.serverStatus.data!.stats.topQueriedDomains, data: serversProvider.serverStatus.data!.stats.topQueriedDomains,
type: 'topQueriedDomains', type: 'topQueriedDomains',
), ),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: Divider( child: Divider(
thickness: 1, thickness: 1,
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
@ -141,10 +143,11 @@ class _HomeState extends State<Home> {
data: serversProvider.serverStatus.data!.stats.topBlockedDomains, data: serversProvider.serverStatus.data!.stats.topBlockedDomains,
type: 'topBlockedDomains', type: 'topBlockedDomains',
), ),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 20),
child: Divider( child: Divider(
thickness: 1, thickness: 1,
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),

View file

@ -144,7 +144,7 @@ class ManagementModal extends StatelessWidget {
child: Icon( child: Icon(
Icons.shield_rounded, Icons.shield_rounded,
size: 24, size: 24,
color: Theme.of(context).colorScheme.onSurface, color: Theme.of(context).colorScheme.secondary,
), ),
), ),
Padding( Padding(

View file

@ -21,9 +21,10 @@ class ServerStatus extends StatelessWidget {
children: [ children: [
Text( Text(
AppLocalizations.of(context)!.serverStatus, AppLocalizations.of(context)!.serverStatus,
style: const TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),

View file

@ -48,8 +48,9 @@ class TopItems extends StatelessWidget {
Text( Text(
item.keys.toList()[0], item.keys.toList()[0],
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: const TextStyle( style: TextStyle(
fontSize: 16 fontSize: 16,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
if (name != null) ...[ if (name != null) ...[
@ -59,14 +60,19 @@ class TopItems extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Theme.of(context).listTileTheme.iconColor color: Theme.of(context).colorScheme.onSurfaceVariant
), ),
), ),
] ]
], ],
), ),
), ),
Text(item.values.toList()[0].toString()) Text(
item.values.toList()[0].toString(),
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface
),
)
], ],
), ),
); );
@ -93,9 +99,10 @@ class TopItems extends StatelessWidget {
children: [ children: [
Text( Text(
label, label,
style: const TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),

View file

@ -57,12 +57,14 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
Icon( Icon(
icon, icon,
size: 24, size: 24,
color: Theme.of(context).colorScheme.onSurfaceVariant,
), ),
const SizedBox(width: 16), const SizedBox(width: 16),
Text( Text(
label, label,
style: const TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Theme.of(context).colorScheme.onSurface
), ),
) )
], ],
@ -92,21 +94,23 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
), ),
child: Column( child: Column(
children: [ children: [
const Padding( Padding(
padding: EdgeInsets.only( padding: const EdgeInsets.only(
top: 24, top: 24,
bottom: 16, bottom: 16,
), ),
child: Icon( child: Icon(
Icons.shield_rounded, Icons.shield_rounded,
size: 24, size: 24,
color: Theme.of(context).colorScheme.secondary,
), ),
), ),
Text( Text(
AppLocalizations.of(context)!.responseStatus, AppLocalizations.of(context)!.responseStatus,
style: const TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
fontWeight: FontWeight.w400 fontWeight: FontWeight.w400,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),

View file

@ -136,16 +136,19 @@ class LogDetailsScreen extends StatelessWidget {
subtitleWidget: getResult(), subtitleWidget: getResult(),
trailing: log.cached == true trailing: log.cached == true
? Container( ? Container(
padding: const EdgeInsets.all(5), padding: const EdgeInsets.symmetric(
decoration: BoxDecoration( horizontal: 10,
color: Theme.of(context).listTileTheme.iconColor, vertical: 5
borderRadius: BorderRadius.circular(10)
), ),
child: const Text( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(30)
),
child: Text(
"CACHE", "CACHE",
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Colors.white, color: Theme.of(context).colorScheme.onPrimaryContainer,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
), ),
), ),
@ -270,16 +273,19 @@ class LogDetailsScreen extends StatelessWidget {
title: a.value, title: a.value,
subtitle: "TTL: ${a.ttl.toString()}", subtitle: "TTL: ${a.ttl.toString()}",
trailing: Container( trailing: Container(
padding: const EdgeInsets.all(5), padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).listTileTheme.iconColor, color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(10) borderRadius: BorderRadius.circular(30)
), ),
child: Text( child: Text(
a.type, a.type,
style: const TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Colors.white, color: Theme.of(context).colorScheme.onPrimaryContainer,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
), ),
), ),

View file

@ -19,7 +19,7 @@ class LogListTile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [

View file

@ -72,7 +72,7 @@ class LogTile extends StatelessWidget {
)), )),
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [

View file

@ -126,19 +126,21 @@ class _LogsConfigModalWidgetState extends State<LogsConfigModalWidget> {
? const NeverScrollableScrollPhysics() ? const NeverScrollableScrollPhysics()
: null, : null,
children: [ children: [
const Padding( Padding(
padding: EdgeInsets.only(top: 24), padding: const EdgeInsets.only(top: 24),
child: Icon( child: Icon(
Icons.settings, Icons.settings,
size: 24, size: 24,
color: Theme.of(context).colorScheme.secondary,
), ),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Text( Text(
AppLocalizations.of(context)!.logsSettings, AppLocalizations.of(context)!.logsSettings,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: TextStyle(
fontSize: 24 fontSize: 24,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),

View file

@ -171,7 +171,7 @@ class _LogsFiltersModalWidgetState extends State<LogsFiltersModalWidget> {
return Padding( return Padding(
padding: MediaQuery.of(context).viewInsets, padding: MediaQuery.of(context).viewInsets,
child: Container( child: Container(
height: 350, height: 360,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).dialogBackgroundColor, color: Theme.of(context).dialogBackgroundColor,
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
@ -187,23 +187,25 @@ class _LogsFiltersModalWidgetState extends State<LogsFiltersModalWidget> {
? const NeverScrollableScrollPhysics() ? const NeverScrollableScrollPhysics()
: null, : null,
children: [ children: [
const Padding( Padding(
padding: EdgeInsets.only( padding: const EdgeInsets.only(
top: 24, top: 24,
bottom: 16, bottom: 16,
), ),
child: Icon( child: Icon(
Icons.filter_list_rounded, Icons.filter_list_rounded,
size: 24, size: 24,
color: Theme.of(context).colorScheme.secondary,
), ),
), ),
Text( Text(
AppLocalizations.of(context)!.filters, AppLocalizations.of(context)!.filters,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
height: 1.3 height: 1.3,
color: Theme.of(context).colorScheme.onSurface
), ),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
@ -285,7 +287,7 @@ class _LogsFiltersModalWidgetState extends State<LogsFiltersModalWidget> {
subtitle: "${translatedString[logsProvider.selectedResultStatus]}", subtitle: "${translatedString[logsProvider.selectedResultStatus]}",
onTap: openSelectFilterStatus, onTap: openSelectFilterStatus,
icon: Icons.shield_rounded, icon: Icons.shield_rounded,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
), ),
], ],
), ),

View file

@ -196,7 +196,7 @@ class Settings extends StatelessWidget {
onPressed: () => openWeb(Urls.playStore), onPressed: () => openWeb(Urls.playStore),
icon: SvgPicture.asset( icon: SvgPicture.asset(
'assets/resources/google-play.svg', 'assets/resources/google-play.svg',
color: Theme.of(context).textTheme.bodyText2!.color, color: Theme.of(context).colorScheme.onSurfaceVariant,
width: 30, width: 30,
height: 30, height: 30,
), ),
@ -206,7 +206,7 @@ class Settings extends StatelessWidget {
onPressed: () => openWeb(Urls.gitHub), onPressed: () => openWeb(Urls.gitHub),
icon: SvgPicture.asset( icon: SvgPicture.asset(
'assets/resources/github.svg', 'assets/resources/github.svg',
color: Theme.of(context).textTheme.bodyText2!.color, color: Theme.of(context).colorScheme.onSurfaceVariant,
width: 30, width: 30,
height: 30, height: 30,
), ),

View file

@ -3,10 +3,9 @@
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
import 'package:material_segmented_control/material_segmented_control.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:adguard_home_manager/widgets/custom_radio_toggle.dart';
import 'package:adguard_home_manager/providers/app_config_provider.dart'; import 'package:adguard_home_manager/providers/app_config_provider.dart';
import 'package:adguard_home_manager/functions/encode_base64.dart'; import 'package:adguard_home_manager/functions/encode_base64.dart';
import 'package:adguard_home_manager/services/http_requests.dart'; import 'package:adguard_home_manager/services/http_requests.dart';
@ -249,6 +248,25 @@ class _AddServerModalState extends State<AddServerModal> {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
Map<int, Widget> connectionTypes = {
0: Text(
'HTTP',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 14,
fontWeight: FontWeight.w500
),
),
1: Text(
'HTTPS',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 14,
fontWeight: FontWeight.w500
),
)
};
void connect() async { void connect() async {
Server serverObj = Server( Server serverObj = Server(
id: uuid.v4(), id: uuid.v4(),
@ -457,7 +475,7 @@ class _AddServerModalState extends State<AddServerModal> {
); );
} }
} }
print(connectionType);
return Stack( return Stack(
children: [ children: [
Scaffold( Scaffold(
@ -529,22 +547,23 @@ class _AddServerModalState extends State<AddServerModal> {
} }
), ),
sectionLabel(AppLocalizations.of(context)!.connection), sectionLabel(AppLocalizations.of(context)!.connection),
Row( Padding(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, padding: const EdgeInsets.symmetric(horizontal: 10),
children: [ child: MaterialSegmentedControl(
CustomRadioToggle( children: connectionTypes,
groupSelected: connectionType, selectionIndex: connectionType == 'http' ? 0 : 1,
value: 'http', onSegmentChosen: (value) => setState(() {
label: 'HTTP', if (value == 0) {
onTap: (value) => setState(() => connectionType = value) connectionType = 'http';
), }
CustomRadioToggle( else if (value == 1) {
groupSelected: connectionType, connectionType = 'https';
value: 'https', }
label: 'HTTPS', }),
onTap: (value) => setState(() => connectionType = value) selectedColor: Theme.of(context).colorScheme.secondaryContainer,
), unselectedColor: Colors.transparent,
], borderColor: Theme.of(context).colorScheme.onSurface,
),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
textField( textField(

View file

@ -52,13 +52,9 @@ class BottomNavBar extends StatelessWidget {
destinations: screens.map((screen) => NavigationDestination( destinations: screens.map((screen) => NavigationDestination(
icon: Icon( icon: Icon(
screen.icon, screen.icon,
color: screens.indexOf(screen) == appConfigProvider.selectedScreen color: screens[appConfigProvider.selectedScreen] == screen
? Theme.of(context).navigationBarTheme.indicatorColor!.computeLuminance() > 0.5 ? ? Theme.of(context).colorScheme.onSecondaryContainer
appConfigProvider.useDynamicColor == true : Theme.of(context).colorScheme.onSurfaceVariant,
? Theme.of(context).primaryColor
: Colors.black
: Colors.white
: null,
), ),
label: translatedName(screen.name) label: translatedName(screen.name)
)).toList(), )).toList(),

View file

@ -27,7 +27,7 @@ class CustomListTile extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: onTap, onTap: onTap,
child: Padding( child: Padding(
padding: padding ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: padding ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [

View file

@ -23,7 +23,12 @@ class ProcessDialog extends StatelessWidget {
children: [ children: [
const CircularProgressIndicator(), const CircularProgressIndicator(),
const SizedBox(width: 40), const SizedBox(width: 40),
Text(message) Text(
message,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface
),
)
], ],
), ),
), ),

View file

@ -49,7 +49,7 @@ class DeleteModal extends StatelessWidget {
Icon( Icon(
Icons.delete, Icons.delete,
size: 24, size: 24,
color: Theme.of(context).colorScheme.onSurfaceVariant color: Theme.of(context).colorScheme.secondary
), ),
Padding( Padding(
padding: const EdgeInsets.only(top: 16), padding: const EdgeInsets.only(top: 16),
@ -74,7 +74,7 @@ class DeleteModal extends StatelessWidget {
AppLocalizations.of(context)!.removeWarning, AppLocalizations.of(context)!.removeWarning,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.onSurface color: Theme.of(context).colorScheme.onSurfaceVariant
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
@ -83,7 +83,7 @@ class DeleteModal extends StatelessWidget {
"${serverToDelete.connectionMethod}://${serverToDelete.domain}${serverToDelete.path ?? ""}${serverToDelete.port != null ? ':${serverToDelete.port}' : ""}", "${serverToDelete.connectionMethod}://${serverToDelete.domain}${serverToDelete.path ?? ""}${serverToDelete.port != null ? ':${serverToDelete.port}' : ""}",
style: TextStyle( style: TextStyle(
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
color: Theme.of(context).colorScheme.onSurface color: Theme.of(context).colorScheme.onSurfaceVariant
), ),
), ),
), ),

View file

@ -190,9 +190,9 @@ class _ServersListState extends State<ServersList> with SingleTickerProviderStat
color: Theme.of(context).colorScheme.primaryContainer, color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(20) borderRadius: BorderRadius.circular(20)
), ),
child: const Icon( child: Icon(
Icons.star, Icons.star,
color: Colors.white, color: Theme.of(context).colorScheme.onPrimaryContainer,
size: 10, size: 10,
), ),
), ),
@ -388,7 +388,7 @@ class _ServersListState extends State<ServersList> with SingleTickerProviderStat
child: InkWell( child: InkWell(
onTap: () => widget.onChange(index), onTap: () => widget.onChange(index),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: topRow(servers[index], index), child: topRow(servers[index], index),
), ),
), ),
@ -398,7 +398,7 @@ class _ServersListState extends State<ServersList> with SingleTickerProviderStat
child: InkWell( child: InkWell(
onTap: () => widget.onChange(index), onTap: () => widget.onChange(index),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Column( child: Column(
children: [ children: [
topRow(servers[index], index), topRow(servers[index], index),

View file

@ -34,16 +34,18 @@ class _UpdateModalState extends State<UpdateModal> {
scrollable: true, scrollable: true,
title: Column( title: Column(
children: [ children: [
const Icon( Icon(
Icons.system_update_rounded, Icons.system_update_rounded,
size: 26, size: 24,
color: Theme.of(context).colorScheme.secondary,
), ),
const SizedBox(height: 20), const SizedBox(height: 16),
Text( Text(
AppLocalizations.of(context)!.updateAvailable, AppLocalizations.of(context)!.updateAvailable,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: TextStyle(
fontSize: 26 fontSize: 24,
color: Theme.of(context).colorScheme.onSurface
), ),
) )
], ],
@ -51,11 +53,26 @@ class _UpdateModalState extends State<UpdateModal> {
content: Column( content: Column(
children: [ children: [
const SizedBox(height: 10), const SizedBox(height: 10),
Text("${AppLocalizations.of(context)!.installedVersion}: ${appConfigProvider.getAppInfo!.version}"), Text(
"${AppLocalizations.of(context)!.installedVersion}: ${appConfigProvider.getAppInfo!.version}",
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant
),
),
const SizedBox(height: 10), const SizedBox(height: 10),
Text("${AppLocalizations.of(context)!.newVersion}: ${widget.gitHubRelease.tagName}"), Text(
"${AppLocalizations.of(context)!.newVersion}: ${widget.gitHubRelease.tagName}",
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant
),
),
const SizedBox(height: 10), const SizedBox(height: 10),
Text("${AppLocalizations.of(context)!.source}: GitHub"), Text(
"${AppLocalizations.of(context)!.source}: GitHub",
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant
),
),
const SizedBox(height: 20), const SizedBox(height: 20),
GestureDetector( GestureDetector(
onTap: () => setState(() => doNotRemember = !doNotRemember), onTap: () => setState(() => doNotRemember = !doNotRemember),
@ -70,7 +87,14 @@ class _UpdateModalState extends State<UpdateModal> {
), ),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Flexible(child: Text(AppLocalizations.of(context)!.doNotRememberAgainUpdate)) Flexible(
child: Text(
AppLocalizations.of(context)!.doNotRememberAgainUpdate,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant
),
)
)
], ],
), ),
) )

View file

@ -329,6 +329,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.5" version: "0.1.5"
material_segmented_control:
dependency: "direct main"
description:
name: material_segmented_control
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:

View file

@ -50,6 +50,7 @@ dependencies:
bottom_sheet: ^3.1.2 bottom_sheet: ^3.1.2
percent_indicator: ^4.2.2 percent_indicator: ^4.2.2
store_checker: ^1.1.0 store_checker: ^1.1.0
material_segmented_control: ^4.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: