mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-15 14:32:48 +00:00
Changed system navigation bar color
This commit is contained in:
parent
83ea589187
commit
b164d520db
47 changed files with 3370 additions and 3207 deletions
|
@ -14,7 +14,7 @@ import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
|||
import 'package:adguard_home_manager/constants/colors.dart';
|
||||
|
||||
class Customization extends StatelessWidget {
|
||||
const Customization({Key? key}) : super(key: key);
|
||||
const Customization({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -65,152 +65,154 @@ class _CustomizationWidgetState extends State<CustomizationWidget> {
|
|||
centerTitle: false,
|
||||
surfaceTintColor: isDesktop(width) ? Colors.transparent : null,
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
SectionLabel(
|
||||
label: AppLocalizations.of(context)!.theme,
|
||||
padding: const EdgeInsets.only(top: 10, left: 16, right: 16, bottom: 5),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
CustomSwitchListTile(
|
||||
value: selectedTheme == 0 ? true : false,
|
||||
onChanged: (value) {
|
||||
selectedTheme = value == true ? 0 : 1;
|
||||
appConfigProvider.setSelectedTheme(value == true ? 0 : 1);
|
||||
},
|
||||
title: AppLocalizations.of(context)!.systemDefined,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ThemeModeButton(
|
||||
icon: Icons.light_mode,
|
||||
value: 1,
|
||||
selected: selectedTheme,
|
||||
label: AppLocalizations.of(context)!.light,
|
||||
onChanged: (value) {
|
||||
selectedTheme = value;
|
||||
appConfigProvider.setSelectedTheme(value);
|
||||
},
|
||||
disabled: selectedTheme == 0 ? true : false,
|
||||
),
|
||||
ThemeModeButton(
|
||||
icon: Icons.dark_mode,
|
||||
value: 2,
|
||||
selected: selectedTheme,
|
||||
label: AppLocalizations.of(context)!.dark,
|
||||
onChanged: (value) {
|
||||
selectedTheme = value;
|
||||
appConfigProvider.setSelectedTheme(value);
|
||||
},
|
||||
disabled: selectedTheme == 0 ? true : false,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SectionLabel(
|
||||
label: AppLocalizations.of(context)!.color,
|
||||
padding: const EdgeInsets.only(top: 45, left: 16, right: 16, bottom: 5),
|
||||
),
|
||||
if (appConfigProvider.androidDeviceInfo != null && appConfigProvider.androidDeviceInfo!.version.sdkInt >= 31) CustomSwitchListTile(
|
||||
value: dynamicColor,
|
||||
onChanged: (value) {
|
||||
setState(() => dynamicColor = value);
|
||||
appConfigProvider.setUseDynamicColor(value);
|
||||
},
|
||||
title: AppLocalizations.of(context)!.useDynamicTheme,
|
||||
),
|
||||
if (!(appConfigProvider.androidDeviceInfo != null && appConfigProvider.androidDeviceInfo!.version.sdkInt >= 31)) const SizedBox(height: 20),
|
||||
if (dynamicColor == false) ...[
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 70,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: colors.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return Row(
|
||||
children: [
|
||||
const SizedBox(width: 15),
|
||||
ColorItem(
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: selectedColor,
|
||||
onChanged: (value) {
|
||||
setState(() => selectedColor = value);
|
||||
appConfigProvider.setStaticColor(value);
|
||||
}
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||
width: 1,
|
||||
height: 60,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey,
|
||||
borderRadius: BorderRadius.circular(1)
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
else if (index == colors.length-1) {
|
||||
return Row(
|
||||
children: [
|
||||
ColorItem(
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: selectedColor,
|
||||
onChanged: (value) {
|
||||
setState(() => selectedColor = value);
|
||||
appConfigProvider.setStaticColor(value);
|
||||
}
|
||||
),
|
||||
const SizedBox(width: 15)
|
||||
],
|
||||
);
|
||||
}
|
||||
else {
|
||||
return ColorItem(
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: selectedColor,
|
||||
onChanged: (value) {
|
||||
setState(() => selectedColor = value);
|
||||
appConfigProvider.setStaticColor(value);
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
children: [
|
||||
SectionLabel(
|
||||
label: AppLocalizations.of(context)!.theme,
|
||||
padding: const EdgeInsets.only(top: 10, left: 16, right: 16, bottom: 5),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 25,
|
||||
top: 10
|
||||
),
|
||||
child: Text(
|
||||
colorTranslation(context, selectedColor),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).listTileTheme.iconColor,
|
||||
fontSize: 16
|
||||
Column(
|
||||
children: [
|
||||
CustomSwitchListTile(
|
||||
value: selectedTheme == 0 ? true : false,
|
||||
onChanged: (value) {
|
||||
selectedTheme = value == true ? 0 : 1;
|
||||
appConfigProvider.setSelectedTheme(value == true ? 0 : 1);
|
||||
},
|
||||
title: AppLocalizations.of(context)!.systemDefined,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ThemeModeButton(
|
||||
icon: Icons.light_mode,
|
||||
value: 1,
|
||||
selected: selectedTheme,
|
||||
label: AppLocalizations.of(context)!.light,
|
||||
onChanged: (value) {
|
||||
selectedTheme = value;
|
||||
appConfigProvider.setSelectedTheme(value);
|
||||
},
|
||||
disabled: selectedTheme == 0 ? true : false,
|
||||
),
|
||||
ThemeModeButton(
|
||||
icon: Icons.dark_mode,
|
||||
value: 2,
|
||||
selected: selectedTheme,
|
||||
label: AppLocalizations.of(context)!.dark,
|
||||
onChanged: (value) {
|
||||
selectedTheme = value;
|
||||
appConfigProvider.setSelectedTheme(value);
|
||||
},
|
||||
disabled: selectedTheme == 0 ? true : false,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SectionLabel(
|
||||
label: AppLocalizations.of(context)!.color,
|
||||
padding: const EdgeInsets.only(top: 45, left: 16, right: 16, bottom: 5),
|
||||
),
|
||||
if (appConfigProvider.androidDeviceInfo != null && appConfigProvider.androidDeviceInfo!.version.sdkInt >= 31) CustomSwitchListTile(
|
||||
value: dynamicColor,
|
||||
onChanged: (value) {
|
||||
setState(() => dynamicColor = value);
|
||||
appConfigProvider.setUseDynamicColor(value);
|
||||
},
|
||||
title: AppLocalizations.of(context)!.useDynamicTheme,
|
||||
),
|
||||
if (!(appConfigProvider.androidDeviceInfo != null && appConfigProvider.androidDeviceInfo!.version.sdkInt >= 31)) const SizedBox(height: 20),
|
||||
if (dynamicColor == false) ...[
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 70,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: colors.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return Row(
|
||||
children: [
|
||||
const SizedBox(width: 15),
|
||||
ColorItem(
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: selectedColor,
|
||||
onChanged: (value) {
|
||||
setState(() => selectedColor = value);
|
||||
appConfigProvider.setStaticColor(value);
|
||||
}
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||
width: 1,
|
||||
height: 60,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey,
|
||||
borderRadius: BorderRadius.circular(1)
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
else if (index == colors.length-1) {
|
||||
return Row(
|
||||
children: [
|
||||
ColorItem(
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: selectedColor,
|
||||
onChanged: (value) {
|
||||
setState(() => selectedColor = value);
|
||||
appConfigProvider.setStaticColor(value);
|
||||
}
|
||||
),
|
||||
const SizedBox(width: 15)
|
||||
],
|
||||
);
|
||||
}
|
||||
else {
|
||||
return ColorItem(
|
||||
color: colors[index],
|
||||
numericValue: index,
|
||||
selectedValue: selectedColor,
|
||||
onChanged: (value) {
|
||||
setState(() => selectedColor = value);
|
||||
appConfigProvider.setStaticColor(value);
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 25,
|
||||
top: 10
|
||||
),
|
||||
child: Text(
|
||||
colorTranslation(context, selectedColor),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).listTileTheme.iconColor,
|
||||
fontSize: 16
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
CustomSwitchListTile(
|
||||
value: useThemeColorInsteadGreenRed,
|
||||
onChanged: (value) {
|
||||
setState(() => useThemeColorInsteadGreenRed = value);
|
||||
appConfigProvider.setUseThemeColorForStatus(value);
|
||||
},
|
||||
title: AppLocalizations.of(context)!.useThemeColorStatus,
|
||||
subtitle: AppLocalizations.of(context)!.useThemeColorStatusDescription,
|
||||
)
|
||||
],
|
||||
CustomSwitchListTile(
|
||||
value: useThemeColorInsteadGreenRed,
|
||||
onChanged: (value) {
|
||||
setState(() => useThemeColorInsteadGreenRed = value);
|
||||
appConfigProvider.setUseThemeColorForStatus(value);
|
||||
},
|
||||
title: AppLocalizations.of(context)!.useThemeColorStatus,
|
||||
subtitle: AppLocalizations.of(context)!.useThemeColorStatusDescription,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue