mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-06-08 23:57:44 +00:00
Merge branch 'beta'
This commit is contained in:
commit
d86fc363aa
30 changed files with 969 additions and 1014 deletions
|
@ -236,20 +236,9 @@ class _MainState extends State<Main> {
|
||||||
],
|
],
|
||||||
scaffoldMessengerKey: scaffoldMessengerKey,
|
scaffoldMessengerKey: scaffoldMessengerKey,
|
||||||
navigatorKey: globalNavigatorKey,
|
navigatorKey: globalNavigatorKey,
|
||||||
builder: (context, child) {
|
builder: (context, child) => CustomMenuBar(
|
||||||
return CustomMenuBar(
|
child: child!,
|
||||||
child: MediaQuery(
|
),
|
||||||
data: MediaQuery.of(context).copyWith(
|
|
||||||
textScaler: TextScaler.linear(
|
|
||||||
!(Platform.isAndroid || Platform.isIOS)
|
|
||||||
? 0.9
|
|
||||||
: 1.0
|
|
||||||
)
|
|
||||||
),
|
|
||||||
child: child!,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
home: const Layout(),
|
home: const Layout(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -10,12 +10,12 @@ class BlockedServicesSection extends StatelessWidget {
|
||||||
final void Function(bool) onUpdateServicesGlobalSettings;
|
final void Function(bool) onUpdateServicesGlobalSettings;
|
||||||
|
|
||||||
const BlockedServicesSection({
|
const BlockedServicesSection({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.useGlobalSettingsServices,
|
required this.useGlobalSettingsServices,
|
||||||
required this.blockedServices,
|
required this.blockedServices,
|
||||||
required this.onUpdatedBlockedServices,
|
required this.onUpdatedBlockedServices,
|
||||||
required this.onUpdateServicesGlobalSettings
|
required this.onUpdateServicesGlobalSettings
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -37,11 +37,13 @@ class BlockedServicesSection extends StatelessWidget {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Flexible(
|
||||||
AppLocalizations.of(context)!.useGlobalSettings,
|
child: Text(
|
||||||
style: TextStyle(
|
AppLocalizations.of(context)!.useGlobalSettings,
|
||||||
fontSize: 16,
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
fontSize: 16,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Switch(
|
Switch(
|
||||||
|
@ -78,30 +80,32 @@ class BlockedServicesSection extends StatelessWidget {
|
||||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.38),
|
: Theme.of(context).colorScheme.onSurface.withOpacity(0.38),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
Column(
|
Flexible(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Text(
|
children: [
|
||||||
AppLocalizations.of(context)!.selectBlockedServices,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
color: useGlobalSettingsServices == false
|
|
||||||
? Theme.of(context).colorScheme.onSurface
|
|
||||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.38),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (useGlobalSettingsServices == false) ...[
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
Text(
|
||||||
blockedServices.isNotEmpty
|
AppLocalizations.of(context)!.selectBlockedServices,
|
||||||
? "${blockedServices.length} ${AppLocalizations.of(context)!.servicesBlocked}"
|
|
||||||
: AppLocalizations.of(context)!.noBlockedServicesSelected,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).listTileTheme.iconColor
|
fontSize: 16,
|
||||||
|
color: useGlobalSettingsServices == false
|
||||||
|
? Theme.of(context).colorScheme.onSurface
|
||||||
|
: Theme.of(context).colorScheme.onSurface.withOpacity(0.38),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
]
|
if (useGlobalSettingsServices == false) ...[
|
||||||
],
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
blockedServices.isNotEmpty
|
||||||
|
? "${blockedServices.length} ${AppLocalizations.of(context)!.servicesBlocked}"
|
||||||
|
: AppLocalizations.of(context)!.noBlockedServicesSelected,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -47,7 +47,7 @@ class ClientForm extends StatelessWidget {
|
||||||
final void Function(bool) updateUseGlobalSettingsServices;
|
final void Function(bool) updateUseGlobalSettingsServices;
|
||||||
|
|
||||||
const ClientForm({
|
const ClientForm({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.isFullScreen,
|
required this.isFullScreen,
|
||||||
required this.client,
|
required this.client,
|
||||||
required this.nameController,
|
required this.nameController,
|
||||||
|
@ -75,7 +75,7 @@ class ClientForm extends StatelessWidget {
|
||||||
required this.updateEnableSafeSearch,
|
required this.updateEnableSafeSearch,
|
||||||
required this.updateSafeSearch,
|
required this.updateSafeSearch,
|
||||||
required this.updateUseGlobalSettingsServices,
|
required this.updateUseGlobalSettingsServices,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -154,11 +154,13 @@ class ClientForm extends StatelessWidget {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Flexible(
|
||||||
AppLocalizations.of(context)!.useGlobalSettings,
|
child: Text(
|
||||||
style: TextStyle(
|
AppLocalizations.of(context)!.useGlobalSettings,
|
||||||
fontSize: 16,
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
fontSize: 16,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Switch(
|
Switch(
|
||||||
|
|
|
@ -27,12 +27,12 @@ class ClientScreen extends StatefulWidget {
|
||||||
final bool fullScreen;
|
final bool fullScreen;
|
||||||
|
|
||||||
const ClientScreen({
|
const ClientScreen({
|
||||||
Key? key,
|
super.key,
|
||||||
this.client,
|
this.client,
|
||||||
required this.onConfirm,
|
required this.onConfirm,
|
||||||
this.onDelete,
|
this.onDelete,
|
||||||
required this.fullScreen
|
required this.fullScreen
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ClientScreen> createState() => _ClientScreenState();
|
State<ClientScreen> createState() => _ClientScreenState();
|
||||||
|
|
|
@ -7,11 +7,11 @@ class TagsModal extends StatefulWidget {
|
||||||
final void Function(List<String>) onConfirm;
|
final void Function(List<String>) onConfirm;
|
||||||
|
|
||||||
const TagsModal({
|
const TagsModal({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.selectedTags,
|
required this.selectedTags,
|
||||||
required this.tags,
|
required this.tags,
|
||||||
required this.onConfirm,
|
required this.onConfirm,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TagsModal> createState() => _TagsModalState();
|
State<TagsModal> createState() => _TagsModalState();
|
||||||
|
@ -82,12 +82,14 @@ class _TagsModalState extends State<TagsModal> {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Flexible(
|
||||||
widget.tags[index],
|
child: Text(
|
||||||
style: TextStyle(
|
widget.tags[index],
|
||||||
fontSize: 16,
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w400,
|
fontSize: 16,
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Checkbox(
|
Checkbox(
|
||||||
|
|
|
@ -12,11 +12,11 @@ class UpdateIntervalListsModal extends StatefulWidget {
|
||||||
final bool dialog;
|
final bool dialog;
|
||||||
|
|
||||||
const UpdateIntervalListsModal({
|
const UpdateIntervalListsModal({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.interval,
|
required this.interval,
|
||||||
required this.onChange,
|
required this.onChange,
|
||||||
required this.dialog
|
required this.dialog
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<UpdateIntervalListsModal> createState() => _UpdateIntervalListsModalState();
|
State<UpdateIntervalListsModal> createState() => _UpdateIntervalListsModalState();
|
||||||
|
@ -25,7 +25,7 @@ class UpdateIntervalListsModal extends StatefulWidget {
|
||||||
class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
int? selectedOption;
|
int? selectedOption;
|
||||||
|
|
||||||
void _updateRadioValue(value) {
|
void _updateRadioValue(int value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedOption = value;
|
selectedOption = value;
|
||||||
});
|
});
|
||||||
|
@ -41,18 +41,67 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final MediaQueryData mediaQueryData = MediaQuery.of(context);
|
final MediaQueryData mediaQueryData = MediaQuery.of(context);
|
||||||
|
|
||||||
Widget content() {
|
if (widget.dialog == true) {
|
||||||
return Column(
|
return Dialog(
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: ConstrainedBox(
|
||||||
children: [
|
constraints: const BoxConstraints(
|
||||||
Flexible(
|
maxWidth: 500
|
||||||
child: SingleChildScrollView(
|
),
|
||||||
child: Wrap(
|
child: _Content(
|
||||||
children: [
|
selectedOption: selectedOption,
|
||||||
Row(
|
onUpdateValue: _updateRadioValue,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
onConfirm: () => widget.onChange(selectedOption!),
|
||||||
children: [
|
)
|
||||||
Column(
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Padding(
|
||||||
|
padding: mediaQueryData.viewInsets,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).dialogBackgroundColor,
|
||||||
|
borderRadius: const BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(28),
|
||||||
|
topRight: Radius.circular(28)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: _Content(
|
||||||
|
selectedOption: selectedOption,
|
||||||
|
onUpdateValue: _updateRadioValue,
|
||||||
|
onConfirm: () => widget.onChange(selectedOption!),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Content extends StatelessWidget {
|
||||||
|
final int? selectedOption;
|
||||||
|
final void Function(int) onUpdateValue;
|
||||||
|
final void Function() onConfirm;
|
||||||
|
|
||||||
|
const _Content({
|
||||||
|
required this.selectedOption,
|
||||||
|
required this.onUpdateValue,
|
||||||
|
required this.onConfirm,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Wrap(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 24),
|
padding: const EdgeInsets.only(top: 24),
|
||||||
|
@ -62,7 +111,7 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
color: Theme.of(context).listTileTheme.iconColor
|
color: Theme.of(context).listTileTheme.iconColor
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 24,
|
horizontal: 24,
|
||||||
vertical: 16
|
vertical: 16
|
||||||
|
@ -78,157 +127,128 @@ class _UpdateIntervalListsModalState extends State<UpdateIntervalListsModal> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
|
child: Wrap(
|
||||||
|
runSpacing: 16,
|
||||||
|
children: [
|
||||||
|
FractionallySizedBox(
|
||||||
|
widthFactor: 0.5,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 6),
|
||||||
|
child: OptionBox(
|
||||||
|
optionsValue: selectedOption,
|
||||||
|
itemValue: 0,
|
||||||
|
onTap: (v) => onUpdateValue(v as int),
|
||||||
|
label: AppLocalizations.of(context)!.never,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FractionallySizedBox(
|
||||||
|
widthFactor: 0.5,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 6),
|
||||||
|
child: OptionBox(
|
||||||
|
optionsValue: selectedOption,
|
||||||
|
itemValue: 1,
|
||||||
|
onTap: (v) => onUpdateValue(v as int),
|
||||||
|
label: AppLocalizations.of(context)!.hour1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FractionallySizedBox(
|
||||||
|
widthFactor: 0.5,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 6),
|
||||||
|
child: OptionBox(
|
||||||
|
optionsValue: selectedOption,
|
||||||
|
itemValue: 12,
|
||||||
|
onTap: (v) => onUpdateValue(v as int),
|
||||||
|
label: AppLocalizations.of(context)!.hours12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FractionallySizedBox(
|
||||||
|
widthFactor: 0.5,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 6),
|
||||||
|
child: OptionBox(
|
||||||
|
optionsValue: selectedOption,
|
||||||
|
itemValue: 24,
|
||||||
|
onTap: (v) => onUpdateValue(v as int),
|
||||||
|
label: AppLocalizations.of(context)!.hours24,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FractionallySizedBox(
|
||||||
|
widthFactor: 0.5,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 6),
|
||||||
|
child: OptionBox(
|
||||||
|
optionsValue: selectedOption,
|
||||||
|
itemValue: 72,
|
||||||
|
onTap: (v) => onUpdateValue(v as int),
|
||||||
|
label: AppLocalizations.of(context)!.days3,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FractionallySizedBox(
|
||||||
|
widthFactor: 0.5,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 6),
|
||||||
|
child: OptionBox(
|
||||||
|
optionsValue: selectedOption,
|
||||||
|
itemValue: 168,
|
||||||
|
onTap: (v) => onUpdateValue(v as int),
|
||||||
|
label: AppLocalizations.of(context)!.days7,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
)
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
|
||||||
child: Wrap(
|
|
||||||
runSpacing: 16,
|
|
||||||
children: [
|
|
||||||
FractionallySizedBox(
|
|
||||||
widthFactor: 0.5,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 6),
|
|
||||||
child: OptionBox(
|
|
||||||
optionsValue: selectedOption,
|
|
||||||
itemValue: 0,
|
|
||||||
onTap: _updateRadioValue,
|
|
||||||
label: AppLocalizations.of(context)!.never,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
FractionallySizedBox(
|
|
||||||
widthFactor: 0.5,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 6),
|
|
||||||
child: OptionBox(
|
|
||||||
optionsValue: selectedOption,
|
|
||||||
itemValue: 1,
|
|
||||||
onTap: _updateRadioValue,
|
|
||||||
label: AppLocalizations.of(context)!.hour1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
FractionallySizedBox(
|
|
||||||
widthFactor: 0.5,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 6),
|
|
||||||
child: OptionBox(
|
|
||||||
optionsValue: selectedOption,
|
|
||||||
itemValue: 12,
|
|
||||||
onTap: _updateRadioValue,
|
|
||||||
label: AppLocalizations.of(context)!.hours12,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
FractionallySizedBox(
|
|
||||||
widthFactor: 0.5,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 6),
|
|
||||||
child: OptionBox(
|
|
||||||
optionsValue: selectedOption,
|
|
||||||
itemValue: 24,
|
|
||||||
onTap: _updateRadioValue,
|
|
||||||
label: AppLocalizations.of(context)!.hours24,
|
|
||||||
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
FractionallySizedBox(
|
|
||||||
widthFactor: 0.5,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 6),
|
|
||||||
child: OptionBox(
|
|
||||||
optionsValue: selectedOption,
|
|
||||||
itemValue: 72,
|
|
||||||
onTap: _updateRadioValue,
|
|
||||||
label: AppLocalizations.of(context)!.days3,
|
|
||||||
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
FractionallySizedBox(
|
|
||||||
widthFactor: 0.5,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 6),
|
|
||||||
child: OptionBox(
|
|
||||||
optionsValue: selectedOption,
|
|
||||||
itemValue: 168,
|
|
||||||
onTap: _updateRadioValue,
|
|
||||||
label: AppLocalizations.of(context)!.days7,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(24),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
child: Text(AppLocalizations.of(context)!.cancel),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 20),
|
|
||||||
TextButton(
|
|
||||||
onPressed: selectedOption != null
|
|
||||||
? () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
widget.onChange(selectedOption!);
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
style: ButtonStyle(
|
|
||||||
overlayColor: MaterialStateProperty.all(
|
|
||||||
Theme.of(context).colorScheme.primary.withOpacity(0.1)
|
|
||||||
),
|
|
||||||
foregroundColor: MaterialStateProperty.all(
|
|
||||||
selectedOption != null
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Text(AppLocalizations.of(context)!.confirm),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (Platform.isIOS) const SizedBox(height: 16)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (widget.dialog == true) {
|
|
||||||
return Dialog(
|
|
||||||
child: ConstrainedBox(
|
|
||||||
constraints: const BoxConstraints(
|
|
||||||
maxWidth: 500
|
|
||||||
),
|
|
||||||
child: content()
|
|
||||||
),
|
),
|
||||||
);
|
Padding(
|
||||||
}
|
padding: const EdgeInsets.all(24),
|
||||||
else {
|
child: Row(
|
||||||
return Padding(
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
padding: mediaQueryData.viewInsets,
|
children: [
|
||||||
child: Container(
|
TextButton(
|
||||||
height: Platform.isIOS ? 406 : 390,
|
onPressed: () => Navigator.pop(context),
|
||||||
decoration: BoxDecoration(
|
child: Text(AppLocalizations.of(context)!.cancel),
|
||||||
color: Theme.of(context).dialogBackgroundColor,
|
),
|
||||||
borderRadius: const BorderRadius.only(
|
const SizedBox(width: 20),
|
||||||
topLeft: Radius.circular(28),
|
TextButton(
|
||||||
topRight: Radius.circular(28)
|
onPressed: selectedOption != null
|
||||||
),
|
? () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
onConfirm();
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
style: ButtonStyle(
|
||||||
|
overlayColor: MaterialStateProperty.all(
|
||||||
|
Theme.of(context).colorScheme.primary.withOpacity(0.1)
|
||||||
|
),
|
||||||
|
foregroundColor: MaterialStateProperty.all(
|
||||||
|
selectedOption != null
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(AppLocalizations.of(context)!.confirm),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: content()
|
|
||||||
),
|
),
|
||||||
);
|
if (Platform.isIOS) const SizedBox(height: 16)
|
||||||
}
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -197,7 +197,7 @@ class _SelectionScreenState extends State<SelectionScreen> with TickerProviderSt
|
||||||
),
|
),
|
||||||
_Tab(
|
_Tab(
|
||||||
icon: Icons.gpp_bad_rounded,
|
icon: Icons.gpp_bad_rounded,
|
||||||
text: AppLocalizations.of(context)!.blacklist,
|
text: AppLocalizations.of(context)!.blacklists,
|
||||||
quantity: _selectedBlacklists.length
|
quantity: _selectedBlacklists.length
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -263,7 +263,7 @@ class _SelectionScreenState extends State<SelectionScreen> with TickerProviderSt
|
||||||
),
|
),
|
||||||
_Tab(
|
_Tab(
|
||||||
icon: Icons.gpp_bad_rounded,
|
icon: Icons.gpp_bad_rounded,
|
||||||
text: AppLocalizations.of(context)!.blacklist,
|
text: AppLocalizations.of(context)!.blacklists,
|
||||||
quantity: _selectedBlacklists.length
|
quantity: _selectedBlacklists.length
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -336,7 +336,12 @@ class _Tab extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
Icon(icon),
|
Icon(icon),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(text),
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
text,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
)
|
||||||
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Container(
|
Container(
|
||||||
height: 22,
|
height: 22,
|
||||||
|
|
|
@ -14,14 +14,14 @@ class HomeChart extends StatelessWidget {
|
||||||
final int hoursInterval;
|
final int hoursInterval;
|
||||||
|
|
||||||
const HomeChart({
|
const HomeChart({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.data,
|
required this.data,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.primaryValue,
|
required this.primaryValue,
|
||||||
required this.secondaryValue,
|
required this.secondaryValue,
|
||||||
required this.color,
|
required this.color,
|
||||||
required this.hoursInterval
|
required this.hoursInterval
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
|
@ -15,12 +15,12 @@ class MainSwitch extends StatelessWidget {
|
||||||
final Animation<double> animation;
|
final Animation<double> animation;
|
||||||
|
|
||||||
const MainSwitch({
|
const MainSwitch({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.expandableController,
|
required this.expandableController,
|
||||||
required this.updateBlocking,
|
required this.updateBlocking,
|
||||||
required this.disableWithCountdown,
|
required this.disableWithCountdown,
|
||||||
required this.animation,
|
required this.animation,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -88,12 +88,11 @@ class _TopRow extends StatelessWidget {
|
||||||
final Animation<double> animation;
|
final Animation<double> animation;
|
||||||
|
|
||||||
const _TopRow({
|
const _TopRow({
|
||||||
Key? key,
|
|
||||||
required this.legacyMode,
|
required this.legacyMode,
|
||||||
required this.expandableController,
|
required this.expandableController,
|
||||||
required this.updateBlocking,
|
required this.updateBlocking,
|
||||||
required this.animation,
|
required this.animation,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -102,9 +101,9 @@ class _TopRow extends StatelessWidget {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Expanded(
|
||||||
children: [
|
child: Row(
|
||||||
if (legacyMode == false) ...[
|
children: [
|
||||||
RotationTransition(
|
RotationTransition(
|
||||||
turns: animation,
|
turns: animation,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
@ -116,26 +115,30 @@ class _TopRow extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
],
|
Flexible(
|
||||||
Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context)!.allProtections,
|
AppLocalizations.of(context)!.allProtections,
|
||||||
style: const TextStyle(
|
overflow: TextOverflow.ellipsis,
|
||||||
fontSize: 18,
|
style: const TextStyle(
|
||||||
),
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (statusProvider.serverStatus!.timeGeneralDisabled > 0) ...[
|
||||||
|
const SizedBox(height: 2),
|
||||||
|
if (statusProvider.currentDeadline != null) Text(
|
||||||
|
"${AppLocalizations.of(context)!.remainingTime}: ${formatRemainingSeconds(statusProvider.remainingTime)}"
|
||||||
|
)
|
||||||
|
]
|
||||||
|
],
|
||||||
),
|
),
|
||||||
if (statusProvider.serverStatus!.timeGeneralDisabled > 0) ...[
|
),
|
||||||
const SizedBox(height: 2),
|
],
|
||||||
if (statusProvider.currentDeadline != null) Text(
|
),
|
||||||
"${AppLocalizations.of(context)!.remainingTime}: ${formatRemainingSeconds(statusProvider.remainingTime)}"
|
|
||||||
)
|
|
||||||
]
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
Switch(
|
Switch(
|
||||||
value: statusProvider.serverStatus!.generalEnabled,
|
value: statusProvider.serverStatus!.generalEnabled,
|
||||||
onChanged: statusProvider.protectionsManagementProcess.contains('general') == false
|
onChanged: statusProvider.protectionsManagementProcess.contains('general') == false
|
||||||
|
@ -145,7 +148,7 @@ class _TopRow extends StatelessWidget {
|
||||||
}
|
}
|
||||||
updateBlocking(
|
updateBlocking(
|
||||||
value: value,
|
value: value,
|
||||||
filter: legacyMode == true ? 'general_legacy' : 'general'
|
filter: 'general'
|
||||||
);
|
);
|
||||||
} : null,
|
} : null,
|
||||||
)
|
)
|
||||||
|
@ -158,9 +161,8 @@ class _BottomRow extends StatefulWidget {
|
||||||
final void Function(int) disableWithCountdown;
|
final void Function(int) disableWithCountdown;
|
||||||
|
|
||||||
const _BottomRow({
|
const _BottomRow({
|
||||||
Key? key,
|
|
||||||
required this.disableWithCountdown,
|
required this.disableWithCountdown,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<_BottomRow> createState() => _BottomRowState();
|
State<_BottomRow> createState() => _BottomRowState();
|
||||||
|
@ -173,8 +175,12 @@ class _BottomRowState extends State<_BottomRow> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final statusProvider = Provider.of<StatusProvider>(context);
|
final statusProvider = Provider.of<StatusProvider>(context);
|
||||||
|
|
||||||
|
final textScale = MediaQuery.of(context).textScaler.scale(1);
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
height: Platform.isMacOS || Platform.isLinux || Platform.isWindows ? 50 : 40,
|
height: Platform.isMacOS || Platform.isLinux || Platform.isWindows
|
||||||
|
? 50 * textScale
|
||||||
|
: 40 * textScale,
|
||||||
margin: const EdgeInsets.only(top: 8),
|
margin: const EdgeInsets.only(top: 8),
|
||||||
child: Scrollbar(
|
child: Scrollbar(
|
||||||
controller: _chipsScrollController,
|
controller: _chipsScrollController,
|
||||||
|
|
|
@ -181,12 +181,11 @@ class _Modal extends StatelessWidget {
|
||||||
final Animation<double> animation;
|
final Animation<double> animation;
|
||||||
|
|
||||||
const _Modal({
|
const _Modal({
|
||||||
Key? key,
|
|
||||||
required this.expandableController,
|
required this.expandableController,
|
||||||
required this.updateBlocking,
|
required this.updateBlocking,
|
||||||
required this.disableWithCountdown,
|
required this.disableWithCountdown,
|
||||||
required this.animation,
|
required this.animation,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
|
@ -9,17 +9,19 @@ class ServerStatusWidget extends StatelessWidget {
|
||||||
final ServerStatus serverStatus;
|
final ServerStatus serverStatus;
|
||||||
|
|
||||||
const ServerStatusWidget({
|
const ServerStatusWidget({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.serverStatus,
|
required this.serverStatus,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final width = MediaQuery.of(context).size.width;
|
final width = MediaQuery.of(context).size.width;
|
||||||
|
final textScaleFactor = MediaQuery.of(context).textScaler.scale(1);
|
||||||
return Container(
|
|
||||||
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
|
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context)!.serverStatus,
|
AppLocalizations.of(context)!.serverStatus,
|
||||||
|
@ -30,40 +32,39 @@ class ServerStatusWidget extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
SizedBox(
|
GridView(
|
||||||
height: width > 700 ? 66 : 146,
|
primary: false,
|
||||||
child: GridView(
|
shrinkWrap: true,
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: width > 700 ? 4 : 2,
|
crossAxisCount: width > 700 ? 4 : 2,
|
||||||
crossAxisSpacing: 10,
|
crossAxisSpacing: 10,
|
||||||
mainAxisSpacing: 10,
|
mainAxisSpacing: 10,
|
||||||
mainAxisExtent: 65
|
mainAxisExtent: 70*textScaleFactor
|
||||||
),
|
|
||||||
children: [
|
|
||||||
StatusBox(
|
|
||||||
icon: Icons.filter_list_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.ruleFilteringWidget,
|
|
||||||
isEnabled: serverStatus.filteringEnabled
|
|
||||||
),
|
|
||||||
StatusBox(
|
|
||||||
icon: Icons.vpn_lock_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.safeBrowsingWidget,
|
|
||||||
isEnabled: serverStatus.safeBrowsingEnabled
|
|
||||||
),
|
|
||||||
StatusBox(
|
|
||||||
icon: Icons.block,
|
|
||||||
label: AppLocalizations.of(context)!.parentalFilteringWidget,
|
|
||||||
isEnabled: serverStatus.parentalControlEnabled
|
|
||||||
),
|
|
||||||
StatusBox(
|
|
||||||
icon: Icons.search_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.safeSearchWidget,
|
|
||||||
isEnabled: serverStatus.safeSearchEnabled
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
children: [
|
||||||
|
StatusBox(
|
||||||
|
icon: Icons.filter_list_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.ruleFilteringWidget,
|
||||||
|
isEnabled: serverStatus.filteringEnabled
|
||||||
|
),
|
||||||
|
StatusBox(
|
||||||
|
icon: Icons.vpn_lock_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.safeBrowsingWidget,
|
||||||
|
isEnabled: serverStatus.safeBrowsingEnabled
|
||||||
|
),
|
||||||
|
StatusBox(
|
||||||
|
icon: Icons.block,
|
||||||
|
label: AppLocalizations.of(context)!.parentalFilteringWidget,
|
||||||
|
isEnabled: serverStatus.parentalControlEnabled
|
||||||
|
),
|
||||||
|
StatusBox(
|
||||||
|
icon: Icons.search_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.safeSearchWidget,
|
||||||
|
isEnabled: serverStatus.safeSearchEnabled
|
||||||
|
),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -9,11 +9,11 @@ class StatusBox extends StatelessWidget {
|
||||||
final bool isEnabled;
|
final bool isEnabled;
|
||||||
|
|
||||||
const StatusBox({
|
const StatusBox({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.isEnabled
|
required this.isEnabled
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/screens/home/top_items/top_items.dart';
|
import 'package:adguard_home_manager/screens/home/top_items/top_items_section.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/functions/number_format.dart';
|
import 'package:adguard_home_manager/functions/number_format.dart';
|
||||||
import 'package:adguard_home_manager/functions/snackbar.dart';
|
import 'package:adguard_home_manager/functions/snackbar.dart';
|
||||||
|
@ -106,7 +106,7 @@ class TopItemsLists extends StatelessWidget {
|
||||||
case HomeTopItems.queriedDomains:
|
case HomeTopItems.queriedDomains:
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
TopItems(
|
TopItemsSection(
|
||||||
label: AppLocalizations.of(context)!.topQueriedDomains,
|
label: AppLocalizations.of(context)!.topQueriedDomains,
|
||||||
type: HomeTopItems.queriedDomains,
|
type: HomeTopItems.queriedDomains,
|
||||||
data: statusProvider.serverStatus?.stats.topQueriedDomains ?? [],
|
data: statusProvider.serverStatus?.stats.topQueriedDomains ?? [],
|
||||||
|
@ -134,7 +134,7 @@ class TopItemsLists extends StatelessWidget {
|
||||||
case HomeTopItems.blockedDomains:
|
case HomeTopItems.blockedDomains:
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
TopItems(
|
TopItemsSection(
|
||||||
label: AppLocalizations.of(context)!.topBlockedDomains,
|
label: AppLocalizations.of(context)!.topBlockedDomains,
|
||||||
type: HomeTopItems.blockedDomains,
|
type: HomeTopItems.blockedDomains,
|
||||||
data: statusProvider.serverStatus?.stats.topBlockedDomains ?? [],
|
data: statusProvider.serverStatus?.stats.topBlockedDomains ?? [],
|
||||||
|
@ -162,7 +162,7 @@ class TopItemsLists extends StatelessWidget {
|
||||||
case HomeTopItems.recurrentClients:
|
case HomeTopItems.recurrentClients:
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
TopItems(
|
TopItemsSection(
|
||||||
label: AppLocalizations.of(context)!.topClients,
|
label: AppLocalizations.of(context)!.topClients,
|
||||||
type: HomeTopItems.recurrentClients,
|
type: HomeTopItems.recurrentClients,
|
||||||
data: statusProvider.serverStatus?.stats.topClients ?? [],
|
data: statusProvider.serverStatus?.stats.topClients ?? [],
|
||||||
|
@ -186,7 +186,7 @@ class TopItemsLists extends StatelessWidget {
|
||||||
return statusProvider.serverStatus!.stats.topUpstreamResponses != null
|
return statusProvider.serverStatus!.stats.topUpstreamResponses != null
|
||||||
? Column(
|
? Column(
|
||||||
children: [
|
children: [
|
||||||
TopItems(
|
TopItemsSection(
|
||||||
label: AppLocalizations.of(context)!.topUpstreams,
|
label: AppLocalizations.of(context)!.topUpstreams,
|
||||||
type: HomeTopItems.topUpstreams,
|
type: HomeTopItems.topUpstreams,
|
||||||
data: statusProvider.serverStatus?.stats.topUpstreamResponses ?? [],
|
data: statusProvider.serverStatus?.stats.topUpstreamResponses ?? [],
|
||||||
|
@ -210,7 +210,7 @@ class TopItemsLists extends StatelessWidget {
|
||||||
return statusProvider.serverStatus!.stats.topUpstreamsAvgTime != null
|
return statusProvider.serverStatus!.stats.topUpstreamsAvgTime != null
|
||||||
? Column(
|
? Column(
|
||||||
children: [
|
children: [
|
||||||
TopItems(
|
TopItemsSection(
|
||||||
label: AppLocalizations.of(context)!.averageUpstreamResponseTime,
|
label: AppLocalizations.of(context)!.averageUpstreamResponseTime,
|
||||||
type: HomeTopItems.avgUpstreamResponseTime,
|
type: HomeTopItems.avgUpstreamResponseTime,
|
||||||
data: statusProvider.serverStatus?.stats.topUpstreamsAvgTime ?? [],
|
data: statusProvider.serverStatus?.stats.topUpstreamsAvgTime ?? [],
|
||||||
|
|
324
lib/screens/home/top_items/top_items_screen.dart
Normal file
324
lib/screens/home/top_items/top_items_screen.dart
Normal file
|
@ -0,0 +1,324 @@
|
||||||
|
// ignore_for_file: use_build_context_synchronously
|
||||||
|
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:percent_indicator/percent_indicator.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
import 'package:adguard_home_manager/widgets/options_menu.dart';
|
||||||
|
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
||||||
|
|
||||||
|
import 'package:adguard_home_manager/models/menu_option.dart';
|
||||||
|
import 'package:adguard_home_manager/constants/enums.dart';
|
||||||
|
import 'package:adguard_home_manager/functions/number_format.dart';
|
||||||
|
import 'package:adguard_home_manager/providers/status_provider.dart';
|
||||||
|
|
||||||
|
class TopItemsScreen extends StatefulWidget {
|
||||||
|
final HomeTopItems type;
|
||||||
|
final String title;
|
||||||
|
final bool? isClient;
|
||||||
|
final List<Map<String, dynamic>> data;
|
||||||
|
final bool withProgressBar;
|
||||||
|
final String Function(dynamic) buildValue;
|
||||||
|
final List<MenuOption> options;
|
||||||
|
final void Function(dynamic)? onTapEntry;
|
||||||
|
final bool isFullscreen;
|
||||||
|
|
||||||
|
const TopItemsScreen({
|
||||||
|
super.key,
|
||||||
|
required this.type,
|
||||||
|
required this.title,
|
||||||
|
this.isClient,
|
||||||
|
required this.data,
|
||||||
|
required this.withProgressBar,
|
||||||
|
required this.buildValue,
|
||||||
|
required this.options,
|
||||||
|
this.onTapEntry,
|
||||||
|
required this.isFullscreen,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<TopItemsScreen> createState() => _TopItemsScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _TopItemsScreenState extends State<TopItemsScreen> {
|
||||||
|
bool searchActive = false;
|
||||||
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
|
List<Map<String, dynamic>> data = [];
|
||||||
|
List<Map<String, dynamic>> screenData = [];
|
||||||
|
|
||||||
|
void search(String value) {
|
||||||
|
List<Map<String, dynamic>> newValues = widget.data.where((item) => item.keys.toList()[0].contains(value)).toList();
|
||||||
|
setState(() => screenData = newValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
data = widget.data;
|
||||||
|
screenData = widget.data;
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
double total = 0;
|
||||||
|
for (var element in data) {
|
||||||
|
total = total + double.parse(element.values.toList()[0].toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (widget.isFullscreen == true) {
|
||||||
|
return Dialog.fullscreen(
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: searchActive == true
|
||||||
|
? Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 3),
|
||||||
|
child: TextFormField(
|
||||||
|
controller: searchController,
|
||||||
|
onChanged: search,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: AppLocalizations.of(context)!.search,
|
||||||
|
hintStyle: const TextStyle(
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
fontSize: 18
|
||||||
|
),
|
||||||
|
border: InputBorder.none,
|
||||||
|
),
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
fontSize: 18
|
||||||
|
),
|
||||||
|
autofocus: true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Text(widget.title),
|
||||||
|
leading: searchActive == true ?
|
||||||
|
IconButton(
|
||||||
|
onPressed: () => setState(() {
|
||||||
|
searchActive = false;
|
||||||
|
searchController.text = '';
|
||||||
|
screenData = data;
|
||||||
|
}),
|
||||||
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
tooltip: AppLocalizations.of(context)!.exitSearch,
|
||||||
|
) : null,
|
||||||
|
actions: [
|
||||||
|
if (searchActive == false) IconButton(
|
||||||
|
onPressed: () => setState(() => searchActive = true),
|
||||||
|
icon: const Icon(Icons.search),
|
||||||
|
tooltip: AppLocalizations.of(context)!.search,
|
||||||
|
),
|
||||||
|
if (searchActive == true) IconButton(
|
||||||
|
onPressed: () => setState(() {
|
||||||
|
searchController.text = '';
|
||||||
|
screenData = data;
|
||||||
|
}),
|
||||||
|
icon: const Icon(Icons.clear_rounded),
|
||||||
|
tooltip: AppLocalizations.of(context)!.clearSearch,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: _Content(
|
||||||
|
buildValue: widget.buildValue,
|
||||||
|
isClient: widget.isClient,
|
||||||
|
onTapEntry: widget.onTapEntry,
|
||||||
|
options: widget.options,
|
||||||
|
screenData: screenData,
|
||||||
|
total: total,
|
||||||
|
withProgressBar: widget.withProgressBar,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Dialog(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(
|
||||||
|
maxWidth: 500
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
icon: const Icon(Icons.clear_rounded),
|
||||||
|
tooltip: AppLocalizations.of(context)!.close,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: TextField(
|
||||||
|
controller: searchController,
|
||||||
|
onChanged: search,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
filled: true,
|
||||||
|
fillColor: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
||||||
|
hintText: AppLocalizations.of(context)!.search,
|
||||||
|
prefixIcon: const Icon(Icons.search_rounded),
|
||||||
|
contentPadding: const EdgeInsets.only(left: 14, bottom: 9, top: 11),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(color: Colors.transparent),
|
||||||
|
borderRadius: BorderRadius.circular(25.7),
|
||||||
|
),
|
||||||
|
enabledBorder: UnderlineInputBorder(
|
||||||
|
borderSide: const BorderSide(color: Colors.transparent),
|
||||||
|
borderRadius: BorderRadius.circular(25.7),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: _Content(
|
||||||
|
buildValue: widget.buildValue,
|
||||||
|
isClient: widget.isClient,
|
||||||
|
onTapEntry: widget.onTapEntry,
|
||||||
|
options: widget.options,
|
||||||
|
screenData: screenData,
|
||||||
|
total: total,
|
||||||
|
withProgressBar: widget.withProgressBar,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Content extends StatelessWidget {
|
||||||
|
final List<Map<String, dynamic>> screenData;
|
||||||
|
final bool? isClient;
|
||||||
|
final List<MenuOption> options;
|
||||||
|
final bool withProgressBar;
|
||||||
|
final void Function(dynamic)? onTapEntry;
|
||||||
|
final String Function(dynamic) buildValue;
|
||||||
|
final double total;
|
||||||
|
|
||||||
|
const _Content({
|
||||||
|
required this.screenData,
|
||||||
|
required this.isClient,
|
||||||
|
required this.options,
|
||||||
|
required this.withProgressBar,
|
||||||
|
required this.onTapEntry,
|
||||||
|
required this.buildValue,
|
||||||
|
required this.total,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final statusProvider = Provider.of<StatusProvider>(context);
|
||||||
|
|
||||||
|
if (screenData.isNotEmpty) {
|
||||||
|
return ListView.builder(
|
||||||
|
padding: const EdgeInsets.only(top: 0),
|
||||||
|
itemCount: screenData.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
String? name;
|
||||||
|
if (isClient != null && isClient == true) {
|
||||||
|
try {
|
||||||
|
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(screenData[index].keys.toList()[0])).name;
|
||||||
|
} catch (e) {
|
||||||
|
// ---- //
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return OptionsMenu(
|
||||||
|
options: options,
|
||||||
|
value: screenData[index].keys.toList()[0],
|
||||||
|
onTap: onTapEntry != null
|
||||||
|
? (v) {
|
||||||
|
onTapEntry!(v);
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
child: CustomListTile(
|
||||||
|
title: screenData[index].keys.toList()[0],
|
||||||
|
trailing: Text(
|
||||||
|
buildValue(screenData[index].values.toList()[0]),
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitleWidget: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
if (name != null) ...[
|
||||||
|
Text(
|
||||||
|
name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
],
|
||||||
|
if (withProgressBar == true) Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 50,
|
||||||
|
child: Text(
|
||||||
|
"${doubleFormat((screenData[index].values.toList()[0]/total*100), Platform.localeName)}%",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).listTileTheme.textColor
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Flexible(
|
||||||
|
child: LinearPercentIndicator(
|
||||||
|
animation: true,
|
||||||
|
lineHeight: 4,
|
||||||
|
animationDuration: 500,
|
||||||
|
curve: Curves.easeOut,
|
||||||
|
percent: screenData[index].values.toList()[0]/total,
|
||||||
|
barRadius: const Radius.circular(5),
|
||||||
|
progressColor: Theme.of(context).colorScheme.primary,
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.noItemsSearch,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,15 +7,14 @@ import 'package:provider/provider.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/screens/home/top_items/row_item.dart';
|
import 'package:adguard_home_manager/screens/home/top_items/row_item.dart';
|
||||||
import 'package:adguard_home_manager/screens/top_items/top_items_modal.dart';
|
import 'package:adguard_home_manager/screens/home/top_items/top_items_screen.dart';
|
||||||
import 'package:adguard_home_manager/screens/top_items/top_items.dart';
|
|
||||||
import 'package:adguard_home_manager/widgets/custom_pie_chart.dart';
|
import 'package:adguard_home_manager/widgets/custom_pie_chart.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/models/menu_option.dart';
|
import 'package:adguard_home_manager/models/menu_option.dart';
|
||||||
import 'package:adguard_home_manager/constants/enums.dart';
|
import 'package:adguard_home_manager/constants/enums.dart';
|
||||||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||||
|
|
||||||
class TopItems extends StatefulWidget {
|
class TopItemsSection extends StatefulWidget {
|
||||||
final HomeTopItems type;
|
final HomeTopItems type;
|
||||||
final String label;
|
final String label;
|
||||||
final List<Map<String, dynamic>> data;
|
final List<Map<String, dynamic>> data;
|
||||||
|
@ -25,7 +24,7 @@ class TopItems extends StatefulWidget {
|
||||||
final List<MenuOption> menuOptions;
|
final List<MenuOption> menuOptions;
|
||||||
final void Function(dynamic)? onTapEntry;
|
final void Function(dynamic)? onTapEntry;
|
||||||
|
|
||||||
const TopItems({
|
const TopItemsSection({
|
||||||
super.key,
|
super.key,
|
||||||
required this.type,
|
required this.type,
|
||||||
required this.label,
|
required this.label,
|
||||||
|
@ -38,10 +37,10 @@ class TopItems extends StatefulWidget {
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TopItems> createState() => _TopItemsState();
|
State<TopItemsSection> createState() => _TopItemsState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _TopItemsState extends State<TopItems> {
|
class _TopItemsState extends State<TopItemsSection> {
|
||||||
bool _showChart = true;
|
bool _showChart = true;
|
||||||
|
|
||||||
final colors = [
|
final colors = [
|
||||||
|
@ -289,38 +288,37 @@ class _TopItemsState extends State<TopItems> {
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => {
|
onPressed: () => {
|
||||||
if (width > 700 || !(Platform.isAndroid || Platform.isIOS)) {
|
showGeneralDialog(
|
||||||
showDialog(
|
context: context,
|
||||||
context: context,
|
barrierColor: !(width > 700 || !(Platform.isAndroid | Platform.isIOS))
|
||||||
barrierDismissible: false,
|
?Colors.transparent
|
||||||
builder: (context) => TopItemsModal(
|
: Colors.black54,
|
||||||
type: widget.type,
|
transitionBuilder: (context, anim1, anim2, child) {
|
||||||
title: widget.label,
|
return SlideTransition(
|
||||||
isClient: widget.type == HomeTopItems.recurrentClients,
|
position: Tween(
|
||||||
data: widget.data,
|
begin: const Offset(0, 1),
|
||||||
withProgressBar: widget.withProgressBar,
|
end: const Offset(0, 0)
|
||||||
buildValue: widget.buildValue,
|
).animate(
|
||||||
options: widget.menuOptions,
|
CurvedAnimation(
|
||||||
onTapEntry: widget.onTapEntry,
|
parent: anim1,
|
||||||
)
|
curve: Curves.easeInOutCubicEmphasized
|
||||||
|
)
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
pageBuilder: (context, animation, secondaryAnimation) => TopItemsScreen(
|
||||||
|
type: widget.type,
|
||||||
|
title: widget.label,
|
||||||
|
isClient: widget.type == HomeTopItems.recurrentClients,
|
||||||
|
data: widget.data,
|
||||||
|
withProgressBar: widget.withProgressBar,
|
||||||
|
buildValue: widget.buildValue,
|
||||||
|
options: widget.menuOptions,
|
||||||
|
onTapEntry: widget.onTapEntry,
|
||||||
|
isFullscreen: !(width > 700 || !(Platform.isAndroid | Platform.isIOS)),
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
else {
|
|
||||||
Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => TopItemsScreen(
|
|
||||||
type: widget.type,
|
|
||||||
title: widget.label,
|
|
||||||
isClient: widget.type == HomeTopItems.recurrentClients,
|
|
||||||
data: widget.data,
|
|
||||||
withProgressBar: widget.withProgressBar,
|
|
||||||
buildValue: widget.buildValue,
|
|
||||||
menuOptions: widget.menuOptions,
|
|
||||||
onTapEntry: widget.onTapEntry,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
|
@ -17,7 +17,7 @@ class LogsConfigOptions extends StatelessWidget {
|
||||||
final void Function() onConfirm;
|
final void Function() onConfirm;
|
||||||
|
|
||||||
const LogsConfigOptions({
|
const LogsConfigOptions({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.generalSwitch,
|
required this.generalSwitch,
|
||||||
required this.updateGeneralSwitch,
|
required this.updateGeneralSwitch,
|
||||||
required this.anonymizeClientIp,
|
required this.anonymizeClientIp,
|
||||||
|
@ -27,10 +27,12 @@ class LogsConfigOptions extends StatelessWidget {
|
||||||
required this.updateRetentionTime,
|
required this.updateRetentionTime,
|
||||||
required this.onClear,
|
required this.onClear,
|
||||||
required this.onConfirm
|
required this.onConfirm
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final width = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
@ -111,10 +113,12 @@ class LogsConfigOptions extends StatelessWidget {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Flexible(
|
||||||
AppLocalizations.of(context)!.anonymizeClientIp,
|
child: Text(
|
||||||
style: const TextStyle(
|
AppLocalizations.of(context)!.anonymizeClientIp,
|
||||||
fontSize: 16
|
style: const TextStyle(
|
||||||
|
fontSize: 16
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Switch(
|
Switch(
|
||||||
|
@ -159,13 +163,21 @@ class LogsConfigOptions extends StatelessWidget {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
if (width > 500) TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
onClear();
|
onClear();
|
||||||
},
|
},
|
||||||
child: Text(AppLocalizations.of(context)!.clearLogs)
|
child: Text(AppLocalizations.of(context)!.clearLogs)
|
||||||
),
|
),
|
||||||
|
if (width <= 500) IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
onClear();
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.delete_rounded),
|
||||||
|
tooltip: AppLocalizations.of(context)!.clearLogs,
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
TextButton(
|
||||||
|
@ -174,7 +186,7 @@ class LogsConfigOptions extends StatelessWidget {
|
||||||
),
|
),
|
||||||
const SizedBox(width: 20),
|
const SizedBox(width: 20),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: retentionTime != ''
|
onPressed: retentionTime != null
|
||||||
? () {
|
? () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
onConfirm();
|
onConfirm();
|
||||||
|
@ -183,7 +195,7 @@ class LogsConfigOptions extends StatelessWidget {
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(context)!.confirm,
|
AppLocalizations.of(context)!.confirm,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: retentionTime != ''
|
color: retentionTime != null
|
||||||
? Theme.of(context).colorScheme.primary
|
? Theme.of(context).colorScheme.primary
|
||||||
: Colors.grey
|
: Colors.grey
|
||||||
),
|
),
|
||||||
|
@ -201,7 +213,7 @@ class LogsConfigOptions extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ConfigLogsLoading extends StatelessWidget {
|
class ConfigLogsLoading extends StatelessWidget {
|
||||||
const ConfigLogsLoading({Key? key}) : super(key: key);
|
const ConfigLogsLoading({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -232,7 +244,7 @@ class ConfigLogsLoading extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ConfigLogsError extends StatelessWidget {
|
class ConfigLogsError extends StatelessWidget {
|
||||||
const ConfigLogsError({Key? key}) : super(key: key);
|
const ConfigLogsError({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
@ -143,7 +141,6 @@ class _LogsConfigModalState extends State<LogsConfigModal> {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return Container(
|
return Container(
|
||||||
height: Platform.isIOS ? 436 : 420,
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
topLeft: Radius.circular(28),
|
topLeft: Radius.circular(28),
|
||||||
|
|
|
@ -12,10 +12,10 @@ class ClientsModal extends StatefulWidget {
|
||||||
final bool dialog;
|
final bool dialog;
|
||||||
|
|
||||||
const ClientsModal({
|
const ClientsModal({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.value,
|
required this.value,
|
||||||
required this.dialog
|
required this.dialog
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ClientsModal> createState() => _ClientsModalState();
|
State<ClientsModal> createState() => _ClientsModalState();
|
||||||
|
@ -75,10 +75,9 @@ class _ModalContent extends StatelessWidget {
|
||||||
final void Function(List<String>) onClientsSelected;
|
final void Function(List<String>) onClientsSelected;
|
||||||
|
|
||||||
const _ModalContent({
|
const _ModalContent({
|
||||||
Key? key,
|
|
||||||
required this.selectedClients,
|
required this.selectedClients,
|
||||||
required this.onClientsSelected,
|
required this.onClientsSelected,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -188,11 +187,10 @@ class _ListItem extends StatelessWidget {
|
||||||
final void Function(bool) onChanged;
|
final void Function(bool) onChanged;
|
||||||
|
|
||||||
const _ListItem({
|
const _ListItem({
|
||||||
Key? key,
|
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.checkboxActive,
|
required this.checkboxActive,
|
||||||
required this.onChanged,
|
required this.onChanged,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
|
@ -11,10 +11,10 @@ class FilterStatusModal extends StatefulWidget {
|
||||||
final bool dialog;
|
final bool dialog;
|
||||||
|
|
||||||
const FilterStatusModal({
|
const FilterStatusModal({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.value,
|
required this.value,
|
||||||
required this.dialog
|
required this.dialog
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FilterStatusModal> createState() => _FilterStatusModalState();
|
State<FilterStatusModal> createState() => _FilterStatusModalState();
|
||||||
|
@ -39,164 +39,17 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget filterStatusListItem({
|
|
||||||
required String id,
|
|
||||||
required IconData icon,
|
|
||||||
required String label,
|
|
||||||
required void Function(String?) onChanged
|
|
||||||
}) {
|
|
||||||
return Material(
|
|
||||||
color: Colors.transparent,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () => onChanged(id),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
icon,
|
|
||||||
size: 24,
|
|
||||||
color: Theme.of(context).listTileTheme.iconColor
|
|
||||||
),
|
|
||||||
const SizedBox(width: 16),
|
|
||||||
Text(
|
|
||||||
label,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Radio(
|
|
||||||
value: id,
|
|
||||||
groupValue: selectedResultStatus,
|
|
||||||
onChanged: onChanged
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget content() {
|
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Wrap(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
top: 24,
|
|
||||||
bottom: 16,
|
|
||||||
),
|
|
||||||
child: Icon(
|
|
||||||
Icons.shield_rounded,
|
|
||||||
size: 24,
|
|
||||||
color: Theme.of(context).listTileTheme.iconColor
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
AppLocalizations.of(context)!.responseStatus,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 24,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Container(height: 16),
|
|
||||||
filterStatusListItem(
|
|
||||||
id: "all",
|
|
||||||
icon: Icons.shield_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.all,
|
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
|
||||||
),
|
|
||||||
filterStatusListItem(
|
|
||||||
id: "filtered",
|
|
||||||
icon: Icons.shield_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.filtered,
|
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
|
||||||
),
|
|
||||||
filterStatusListItem(
|
|
||||||
id: "processed",
|
|
||||||
icon: Icons.verified_user_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.processedRow,
|
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
|
||||||
),
|
|
||||||
filterStatusListItem(
|
|
||||||
id: "whitelisted",
|
|
||||||
icon: Icons.verified_user_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.processedWhitelistRow,
|
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
|
||||||
),
|
|
||||||
filterStatusListItem(
|
|
||||||
id: "blocked",
|
|
||||||
icon: Icons.gpp_bad_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.blocked,
|
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
|
||||||
),
|
|
||||||
filterStatusListItem(
|
|
||||||
id: "blocked_safebrowsing",
|
|
||||||
icon: Icons.gpp_bad_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.blockedSafeBrowsingRow,
|
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
|
||||||
),
|
|
||||||
filterStatusListItem(
|
|
||||||
id: "blocked_parental",
|
|
||||||
icon: Icons.gpp_bad_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.blockedParentalRow,
|
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
|
||||||
),
|
|
||||||
filterStatusListItem(
|
|
||||||
id: "safe_search",
|
|
||||||
icon: Icons.gpp_bad_rounded,
|
|
||||||
label: AppLocalizations.of(context)!.blockedSafeSearchRow,
|
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
|
||||||
),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(24),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: apply,
|
|
||||||
child: Text(AppLocalizations.of(context)!.apply)
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (Platform.isIOS) const SizedBox(height: 16)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (widget.dialog == true) {
|
if (widget.dialog == true) {
|
||||||
return Dialog(
|
return Dialog(
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
maxWidth: 400
|
maxWidth: 400
|
||||||
),
|
),
|
||||||
child: content()
|
child: _Content(
|
||||||
|
onApply: apply,
|
||||||
|
updateSelectedResultStatus: (v) => setState(() => selectedResultStatus = v),
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
)
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -209,8 +62,199 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
|
||||||
),
|
),
|
||||||
color: Theme.of(context).dialogBackgroundColor
|
color: Theme.of(context).dialogBackgroundColor
|
||||||
),
|
),
|
||||||
child: content()
|
child: _Content(
|
||||||
|
onApply: apply,
|
||||||
|
updateSelectedResultStatus: (v) => setState(() => selectedResultStatus = v),
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Content extends StatelessWidget {
|
||||||
|
final String selectedResultStatus;
|
||||||
|
final void Function(String) updateSelectedResultStatus;
|
||||||
|
final void Function() onApply;
|
||||||
|
|
||||||
|
const _Content({
|
||||||
|
required this.selectedResultStatus,
|
||||||
|
required this.updateSelectedResultStatus,
|
||||||
|
required this.onApply,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Wrap(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 24,
|
||||||
|
bottom: 16,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.shield_rounded,
|
||||||
|
size: 24,
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context)!.responseStatus,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(height: 16),
|
||||||
|
_Item(
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
id: "all",
|
||||||
|
icon: Icons.shield_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.all,
|
||||||
|
onChanged: updateSelectedResultStatus
|
||||||
|
),
|
||||||
|
_Item(
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
id: "filtered",
|
||||||
|
icon: Icons.shield_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.filtered,
|
||||||
|
onChanged: updateSelectedResultStatus
|
||||||
|
),
|
||||||
|
_Item(
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
id: "processed",
|
||||||
|
icon: Icons.verified_user_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.processedRow,
|
||||||
|
onChanged: updateSelectedResultStatus
|
||||||
|
),
|
||||||
|
_Item(
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
id: "whitelisted",
|
||||||
|
icon: Icons.verified_user_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.processedWhitelistRow,
|
||||||
|
onChanged: updateSelectedResultStatus
|
||||||
|
),
|
||||||
|
_Item(
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
id: "blocked",
|
||||||
|
icon: Icons.gpp_bad_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.blocked,
|
||||||
|
onChanged: updateSelectedResultStatus
|
||||||
|
),
|
||||||
|
_Item(
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
id: "blocked_safebrowsing",
|
||||||
|
icon: Icons.gpp_bad_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.blockedSafeBrowsingRow,
|
||||||
|
onChanged: updateSelectedResultStatus
|
||||||
|
),
|
||||||
|
_Item(
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
id: "blocked_parental",
|
||||||
|
icon: Icons.gpp_bad_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.blockedParentalRow,
|
||||||
|
onChanged: updateSelectedResultStatus
|
||||||
|
),
|
||||||
|
_Item(
|
||||||
|
selectedResultStatus: selectedResultStatus,
|
||||||
|
id: "safe_search",
|
||||||
|
icon: Icons.gpp_bad_rounded,
|
||||||
|
label: AppLocalizations.of(context)!.blockedSafeSearchRow,
|
||||||
|
onChanged: updateSelectedResultStatus
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(24),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: onApply,
|
||||||
|
child: Text(AppLocalizations.of(context)!.apply)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (Platform.isIOS) const SizedBox(height: 16)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Item extends StatelessWidget {
|
||||||
|
final String selectedResultStatus;
|
||||||
|
final String id;
|
||||||
|
final IconData icon;
|
||||||
|
final String label;
|
||||||
|
final void Function(String) onChanged;
|
||||||
|
|
||||||
|
const _Item({
|
||||||
|
required this.selectedResultStatus,
|
||||||
|
required this.id,
|
||||||
|
required this.icon,
|
||||||
|
required this.label,
|
||||||
|
required this.onChanged,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => onChanged(id),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
icon,
|
||||||
|
size: 24,
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
label,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Radio(
|
||||||
|
value: id,
|
||||||
|
groupValue: selectedResultStatus,
|
||||||
|
onChanged: (v) => onChanged(v!)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -8,10 +8,10 @@ class AddStaticLeaseModal extends StatefulWidget {
|
||||||
final bool dialog;
|
final bool dialog;
|
||||||
|
|
||||||
const AddStaticLeaseModal({
|
const AddStaticLeaseModal({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.onConfirm,
|
required this.onConfirm,
|
||||||
required this.dialog
|
required this.dialog
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AddStaticLeaseModal> createState() => _AddStaticLeaseModalState();
|
State<AddStaticLeaseModal> createState() => _AddStaticLeaseModalState();
|
||||||
|
@ -80,26 +80,28 @@ class _AddStaticLeaseModalState extends State<AddStaticLeaseModal> {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Flexible(
|
||||||
children: [
|
child: Column(
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.only(top: 24),
|
Padding(
|
||||||
child: Icon(
|
padding: const EdgeInsets.only(top: 24),
|
||||||
Icons.add,
|
child: Icon(
|
||||||
size: 24,
|
Icons.add,
|
||||||
color: Theme.of(context).listTileTheme.iconColor
|
size: 24,
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 16),
|
||||||
const SizedBox(height: 16),
|
Text(
|
||||||
Text(
|
AppLocalizations.of(context)!.addStaticLease,
|
||||||
AppLocalizations.of(context)!.addStaticLease,
|
textAlign: TextAlign.center,
|
||||||
textAlign: TextAlign.center,
|
style: TextStyle(
|
||||||
style: TextStyle(
|
fontSize: 24,
|
||||||
fontSize: 24,
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -414,6 +414,7 @@ class _DhcpScreenState extends State<DhcpScreen> {
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context)!.loadingDhcp,
|
AppLocalizations.of(context)!.loadingDhcp,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
|
|
@ -8,10 +8,10 @@ class DhcpInterfaceItem extends StatelessWidget {
|
||||||
final void Function(NetworkInterface) onSelect;
|
final void Function(NetworkInterface) onSelect;
|
||||||
|
|
||||||
const DhcpInterfaceItem({
|
const DhcpInterfaceItem({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.networkInterface,
|
required this.networkInterface,
|
||||||
required this.onSelect
|
required this.onSelect
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -56,6 +56,7 @@ class DhcpInterfaceItem extends StatelessWidget {
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
if (networkInterface.flags.isNotEmpty) ...[
|
if (networkInterface.flags.isNotEmpty) ...[
|
||||||
Row(
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Flags: ",
|
"Flags: ",
|
||||||
|
@ -64,11 +65,13 @@ class DhcpInterfaceItem extends StatelessWidget {
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant
|
color: Theme.of(context).colorScheme.onSurfaceVariant
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Flexible(
|
||||||
networkInterface.flags.join(', '),
|
child: Text(
|
||||||
style: TextStyle(
|
networkInterface.flags.join(', '),
|
||||||
fontSize: 14,
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant
|
fontSize: 14,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -13,11 +13,11 @@ class SelectInterfaceModal extends StatelessWidget {
|
||||||
final bool dialog;
|
final bool dialog;
|
||||||
|
|
||||||
const SelectInterfaceModal({
|
const SelectInterfaceModal({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.interfaces,
|
required this.interfaces,
|
||||||
required this.onSelect,
|
required this.onSelect,
|
||||||
required this.dialog
|
required this.dialog
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
|
@ -5,9 +5,9 @@ class ClearDnsCacheDialog extends StatelessWidget {
|
||||||
final void Function() onConfirm;
|
final void Function() onConfirm;
|
||||||
|
|
||||||
const ClearDnsCacheDialog({
|
const ClearDnsCacheDialog({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.onConfirm
|
required this.onConfirm
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -22,6 +22,7 @@ class ClearDnsCacheDialog extends StatelessWidget {
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context)!.clearDnsCache,
|
AppLocalizations.of(context)!.clearDnsCache,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
|
|
|
@ -19,7 +19,7 @@ import 'package:adguard_home_manager/models/rewrite_rules.dart';
|
||||||
import 'package:adguard_home_manager/classes/process_modal.dart';
|
import 'package:adguard_home_manager/classes/process_modal.dart';
|
||||||
|
|
||||||
class DnsRewritesScreen extends StatefulWidget {
|
class DnsRewritesScreen extends StatefulWidget {
|
||||||
const DnsRewritesScreen({Key? key}) : super(key: key);
|
const DnsRewritesScreen({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<DnsRewritesScreen> createState() => _DnsRewritesScreenState();
|
State<DnsRewritesScreen> createState() => _DnsRewritesScreenState();
|
||||||
|
@ -152,6 +152,7 @@ class _DnsRewritesScreenState extends State<DnsRewritesScreen> {
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context)!.loadingRewriteRules,
|
AppLocalizations.of(context)!.loadingRewriteRules,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
@ -305,6 +306,7 @@ class _DnsRewritesScreenState extends State<DnsRewritesScreen> {
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
Text(
|
Text(
|
||||||
AppLocalizations.of(context)!.rewriteRulesNotLoaded,
|
AppLocalizations.of(context)!.rewriteRulesNotLoaded,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
|
|
@ -177,10 +177,12 @@ class _SafeSearchSettingsScreenState extends State<SafeSearchSettingsScreen> {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Flexible(
|
||||||
AppLocalizations.of(context)!.enableSafeSearch,
|
child: Text(
|
||||||
style: const TextStyle(
|
AppLocalizations.of(context)!.enableSafeSearch,
|
||||||
fontSize: 18
|
style: const TextStyle(
|
||||||
|
fontSize: 18
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Switch(
|
Switch(
|
||||||
|
|
|
@ -1,241 +0,0 @@
|
||||||
// ignore_for_file: use_build_context_synchronously
|
|
||||||
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:percent_indicator/percent_indicator.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|
||||||
|
|
||||||
import 'package:adguard_home_manager/widgets/options_menu.dart';
|
|
||||||
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
|
||||||
|
|
||||||
import 'package:adguard_home_manager/models/menu_option.dart';
|
|
||||||
import 'package:adguard_home_manager/constants/enums.dart';
|
|
||||||
import 'package:adguard_home_manager/providers/status_provider.dart';
|
|
||||||
import 'package:adguard_home_manager/functions/snackbar.dart';
|
|
||||||
import 'package:adguard_home_manager/functions/number_format.dart';
|
|
||||||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
|
||||||
|
|
||||||
class TopItemsScreen extends StatefulWidget {
|
|
||||||
final HomeTopItems type;
|
|
||||||
final String title;
|
|
||||||
final bool? isClient;
|
|
||||||
final List<Map<String, dynamic>> data;
|
|
||||||
final bool withProgressBar;
|
|
||||||
final String Function(dynamic) buildValue;
|
|
||||||
final List<MenuOption> menuOptions;
|
|
||||||
final void Function(dynamic)? onTapEntry;
|
|
||||||
|
|
||||||
const TopItemsScreen({
|
|
||||||
super.key,
|
|
||||||
required this.type,
|
|
||||||
required this.title,
|
|
||||||
this.isClient,
|
|
||||||
required this.data,
|
|
||||||
required this.withProgressBar,
|
|
||||||
required this.buildValue,
|
|
||||||
required this.menuOptions,
|
|
||||||
this.onTapEntry,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<TopItemsScreen> createState() => _TopItemsScreenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _TopItemsScreenState extends State<TopItemsScreen> {
|
|
||||||
bool searchActive = false;
|
|
||||||
final TextEditingController searchController = TextEditingController();
|
|
||||||
|
|
||||||
List<Map<String, dynamic>> data = [];
|
|
||||||
List<Map<String, dynamic>> screenData = [];
|
|
||||||
|
|
||||||
void search(String value) {
|
|
||||||
List<Map<String, dynamic>> newValues = widget.data.where((item) => item.keys.toList()[0].contains(value)).toList();
|
|
||||||
setState(() => screenData = newValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
data = widget.data;
|
|
||||||
screenData = widget.data;
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final statusProvider = Provider.of<StatusProvider>(context);
|
|
||||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
|
||||||
|
|
||||||
double total = 0;
|
|
||||||
for (var element in data) {
|
|
||||||
total = total + double.parse(element.values.toList()[0].toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: searchActive == true
|
|
||||||
? Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 3),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: searchController,
|
|
||||||
onChanged: search,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: AppLocalizations.of(context)!.search,
|
|
||||||
hintStyle: const TextStyle(
|
|
||||||
fontWeight: FontWeight.normal,
|
|
||||||
fontSize: 18
|
|
||||||
),
|
|
||||||
border: InputBorder.none,
|
|
||||||
),
|
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.normal,
|
|
||||||
fontSize: 18
|
|
||||||
),
|
|
||||||
autofocus: true,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Text(widget.title),
|
|
||||||
leading: searchActive == true ?
|
|
||||||
IconButton(
|
|
||||||
onPressed: () => setState(() {
|
|
||||||
searchActive = false;
|
|
||||||
searchController.text = '';
|
|
||||||
screenData = data;
|
|
||||||
}),
|
|
||||||
icon: const Icon(Icons.arrow_back),
|
|
||||||
tooltip: AppLocalizations.of(context)!.exitSearch,
|
|
||||||
) : null,
|
|
||||||
actions: [
|
|
||||||
if (searchActive == false) IconButton(
|
|
||||||
onPressed: () => setState(() => searchActive = true),
|
|
||||||
icon: const Icon(Icons.search),
|
|
||||||
tooltip: AppLocalizations.of(context)!.search,
|
|
||||||
),
|
|
||||||
if (searchActive == true) IconButton(
|
|
||||||
onPressed: () => setState(() {
|
|
||||||
searchController.text = '';
|
|
||||||
screenData = data;
|
|
||||||
}),
|
|
||||||
icon: const Icon(Icons.clear_rounded),
|
|
||||||
tooltip: AppLocalizations.of(context)!.clearSearch,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10)
|
|
||||||
],
|
|
||||||
bottom: PreferredSize(
|
|
||||||
preferredSize: const Size(double.maxFinite, 1),
|
|
||||||
child: Container(
|
|
||||||
width: double.maxFinite,
|
|
||||||
height: 1,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: searchActive == true
|
|
||||||
? Colors.grey.withOpacity(0.5)
|
|
||||||
: Colors.transparent
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: RefreshIndicator(
|
|
||||||
onRefresh: () async {
|
|
||||||
final result = await statusProvider.getServerStatus();
|
|
||||||
if (mounted && result == false) {
|
|
||||||
showSnacbkar(
|
|
||||||
appConfigProvider: appConfigProvider,
|
|
||||||
label: AppLocalizations.of(context)!.serverStatusNotRefreshed,
|
|
||||||
color: Colors.red
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: screenData.isNotEmpty
|
|
||||||
? ListView.builder(
|
|
||||||
itemCount: screenData.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
String? name;
|
|
||||||
if (widget.isClient != null && widget.isClient == true) {
|
|
||||||
try {
|
|
||||||
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(screenData[index].keys.toList()[0])).name;
|
|
||||||
} catch (e) {
|
|
||||||
// ---- //
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return OptionsMenu(
|
|
||||||
value: screenData[index].keys.toList()[0],
|
|
||||||
options: widget.menuOptions,
|
|
||||||
onTap: widget.onTapEntry != null
|
|
||||||
? (v) {
|
|
||||||
widget.onTapEntry!(v);
|
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: CustomListTile(
|
|
||||||
title: screenData[index].keys.toList()[0],
|
|
||||||
trailing: Text(
|
|
||||||
widget.buildValue(screenData[index].values.toList()[0]),
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitleWidget: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
if (name != null) ...[
|
|
||||||
Text(
|
|
||||||
name,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
],
|
|
||||||
if (widget.withProgressBar == true) Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 50,
|
|
||||||
child: Text(
|
|
||||||
"${doubleFormat((screenData[index].values.toList()[0]/total*100), Platform.localeName)}%",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).listTileTheme.textColor
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Flexible(
|
|
||||||
child: LinearPercentIndicator(
|
|
||||||
animation: true,
|
|
||||||
lineHeight: 4,
|
|
||||||
animationDuration: 500,
|
|
||||||
curve: Curves.easeOut,
|
|
||||||
percent: screenData[index].values.toList()[0]/total,
|
|
||||||
barRadius: const Radius.circular(5),
|
|
||||||
progressColor: Theme.of(context).colorScheme.primary,
|
|
||||||
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
: Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
||||||
child: Text(
|
|
||||||
AppLocalizations.of(context)!.noItemsSearch,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,218 +0,0 @@
|
||||||
// ignore_for_file: use_build_context_synchronously
|
|
||||||
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:percent_indicator/percent_indicator.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|
||||||
|
|
||||||
import 'package:adguard_home_manager/widgets/options_menu.dart';
|
|
||||||
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
|
||||||
|
|
||||||
import 'package:adguard_home_manager/models/menu_option.dart';
|
|
||||||
import 'package:adguard_home_manager/constants/enums.dart';
|
|
||||||
import 'package:adguard_home_manager/functions/number_format.dart';
|
|
||||||
import 'package:adguard_home_manager/providers/status_provider.dart';
|
|
||||||
|
|
||||||
class TopItemsModal extends StatefulWidget {
|
|
||||||
final HomeTopItems type;
|
|
||||||
final String title;
|
|
||||||
final bool? isClient;
|
|
||||||
final List<Map<String, dynamic>> data;
|
|
||||||
final bool withProgressBar;
|
|
||||||
final String Function(dynamic) buildValue;
|
|
||||||
final List<MenuOption> options;
|
|
||||||
final void Function(dynamic)? onTapEntry;
|
|
||||||
|
|
||||||
const TopItemsModal({
|
|
||||||
super.key,
|
|
||||||
required this.type,
|
|
||||||
required this.title,
|
|
||||||
this.isClient,
|
|
||||||
required this.data,
|
|
||||||
required this.withProgressBar,
|
|
||||||
required this.buildValue,
|
|
||||||
required this.options,
|
|
||||||
this.onTapEntry,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<TopItemsModal> createState() => _TopItemsModalState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _TopItemsModalState extends State<TopItemsModal> {
|
|
||||||
bool searchActive = false;
|
|
||||||
final TextEditingController searchController = TextEditingController();
|
|
||||||
|
|
||||||
List<Map<String, dynamic>> data = [];
|
|
||||||
List<Map<String, dynamic>> screenData = [];
|
|
||||||
|
|
||||||
void search(String value) {
|
|
||||||
List<Map<String, dynamic>> newValues = widget.data.where((item) => item.keys.toList()[0].contains(value)).toList();
|
|
||||||
setState(() => screenData = newValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
data = widget.data;
|
|
||||||
screenData = widget.data;
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final statusProvider = Provider.of<StatusProvider>(context);
|
|
||||||
|
|
||||||
double total = 0;
|
|
||||||
for (var element in data) {
|
|
||||||
total = total + double.parse(element.values.toList()[0].toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return Dialog(
|
|
||||||
child: ConstrainedBox(
|
|
||||||
constraints: const BoxConstraints(
|
|
||||||
maxWidth: 500
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 1,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
IconButton(
|
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
icon: const Icon(Icons.clear_rounded),
|
|
||||||
tooltip: AppLocalizations.of(context)!.close,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 1,
|
|
||||||
child: TextField(
|
|
||||||
controller: searchController,
|
|
||||||
onChanged: search,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
filled: true,
|
|
||||||
fillColor: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
|
||||||
hintText: AppLocalizations.of(context)!.search,
|
|
||||||
prefixIcon: const Icon(Icons.search_rounded),
|
|
||||||
contentPadding: const EdgeInsets.only(left: 14, bottom: 9, top: 11),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: const BorderSide(color: Colors.transparent),
|
|
||||||
borderRadius: BorderRadius.circular(25.7),
|
|
||||||
),
|
|
||||||
enabledBorder: UnderlineInputBorder(
|
|
||||||
borderSide: const BorderSide(color: Colors.transparent),
|
|
||||||
borderRadius: BorderRadius.circular(25.7),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (screenData.isNotEmpty) Flexible(
|
|
||||||
child: ListView.builder(
|
|
||||||
padding: const EdgeInsets.only(top: 0),
|
|
||||||
itemCount: screenData.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
String? name;
|
|
||||||
if (widget.isClient != null && widget.isClient == true) {
|
|
||||||
try {
|
|
||||||
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(screenData[index].keys.toList()[0])).name;
|
|
||||||
} catch (e) {
|
|
||||||
// ---- //
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return OptionsMenu(
|
|
||||||
options: widget.options,
|
|
||||||
value: screenData[index].keys.toList()[0],
|
|
||||||
onTap: widget.onTapEntry != null
|
|
||||||
? (v) {
|
|
||||||
widget.onTapEntry!(v);
|
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
child: CustomListTile(
|
|
||||||
title: screenData[index].keys.toList()[0],
|
|
||||||
trailing: Text(
|
|
||||||
widget.buildValue(screenData[index].values.toList()[0]),
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitleWidget: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
if (name != null) ...[
|
|
||||||
Text(
|
|
||||||
name,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
],
|
|
||||||
if (widget.withProgressBar == true) Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: 50,
|
|
||||||
child: Text(
|
|
||||||
"${doubleFormat((screenData[index].values.toList()[0]/total*100), Platform.localeName)}%",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).listTileTheme.textColor
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Flexible(
|
|
||||||
child: LinearPercentIndicator(
|
|
||||||
animation: true,
|
|
||||||
lineHeight: 4,
|
|
||||||
animationDuration: 500,
|
|
||||||
curve: Curves.easeOut,
|
|
||||||
percent: screenData[index].values.toList()[0]/total,
|
|
||||||
barRadius: const Radius.circular(5),
|
|
||||||
progressColor: Theme.of(context).colorScheme.primary,
|
|
||||||
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (screenData.isEmpty) Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
||||||
child: Text(
|
|
||||||
AppLocalizations.of(context)!.noItemsSearch,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -743,7 +743,7 @@ class ApiClientV2 {
|
||||||
return ApiResponse(
|
return ApiResponse(
|
||||||
successful: result.successful,
|
successful: result.successful,
|
||||||
content: result.body != null ? EncryptionValidationResult(
|
content: result.body != null ? EncryptionValidationResult(
|
||||||
isObject: false,
|
isObject: true,
|
||||||
encryptionValidation: EncryptionValidation.fromJson(jsonDecode(result.body!))
|
encryptionValidation: EncryptionValidation.fromJson(jsonDecode(result.body!))
|
||||||
) : null
|
) : null
|
||||||
);
|
);
|
||||||
|
|
|
@ -29,12 +29,14 @@ class CustomListTileDialog extends StatelessWidget {
|
||||||
),
|
),
|
||||||
const SizedBox(width: 24),
|
const SizedBox(width: 24),
|
||||||
],
|
],
|
||||||
Text(
|
Flexible(
|
||||||
title,
|
child: Text(
|
||||||
style: TextStyle(
|
title,
|
||||||
fontSize: 16,
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w400,
|
fontSize: 16,
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue