mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-04-30 05:54:26 +02:00
feat: partial implementation of patches sources.
This commit is contained in:
parent
89ca3f0040
commit
8a12278b47
@ -71,7 +71,10 @@
|
|||||||
"aboutLabel": "About",
|
"aboutLabel": "About",
|
||||||
"contributorsLabel": "Contributors",
|
"contributorsLabel": "Contributors",
|
||||||
"rootModeLabel": "Root Mode",
|
"rootModeLabel": "Root Mode",
|
||||||
"rootModeHint": "Enable this if you want to patch applications as rooted."
|
"rootModeHint": "Enable this if you want to patch applications as rooted.",
|
||||||
|
"organizationLabel": "Organization",
|
||||||
|
"patchesSourceLabel" : "Patches Source",
|
||||||
|
"integrationsSourceLabel": "Integrations Source"
|
||||||
},
|
},
|
||||||
"rootCheckerView": {
|
"rootCheckerView": {
|
||||||
"widgetTitle": "Is your device rooted?",
|
"widgetTitle": "Is your device rooted?",
|
||||||
|
@ -19,9 +19,9 @@ final kSettingItemSubtitleTextStyle = GoogleFonts.roboto(
|
|||||||
fontWeight: FontWeight.w300,
|
fontWeight: FontWeight.w300,
|
||||||
);
|
);
|
||||||
|
|
||||||
const ghOrg = 'revanced';
|
String ghOrg = 'revanced';
|
||||||
const patchesRepo = 'revanced-patches';
|
String patchesRepo = 'revanced-patches';
|
||||||
const integrationsRepo = 'revanced-integrations';
|
String integrationsRepo = 'revanced-integrations';
|
||||||
const patcherRepo = 'revanced-patcher';
|
const patcherRepo = 'revanced-patcher';
|
||||||
const cliRepo = 'revanced-cli';
|
const cliRepo = 'revanced-cli';
|
||||||
const managerRepo = 'revanced-manager';
|
const managerRepo = 'revanced-manager';
|
||||||
|
@ -128,7 +128,7 @@ class Navigation extends StatelessWidget {
|
|||||||
case 1:
|
case 1:
|
||||||
return const PatcherView();
|
return const PatcherView();
|
||||||
case 2:
|
case 2:
|
||||||
return const SettingsView();
|
return SettingsView();
|
||||||
default:
|
default:
|
||||||
return const HomeView();
|
return const HomeView();
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,18 @@ import 'package:revanced_manager/constants.dart';
|
|||||||
import 'package:revanced_manager/theme.dart';
|
import 'package:revanced_manager/theme.dart';
|
||||||
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/settingsView/about_info_widget.dart';
|
import 'package:revanced_manager/ui/widgets/settingsView/about_info_widget.dart';
|
||||||
|
import 'package:revanced_manager/ui/widgets/settingsView/custom_text_field.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_switch_item.dart';
|
import 'package:revanced_manager/ui/widgets/settingsView/settings_switch_item.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
import 'package:stacked_themes/stacked_themes.dart';
|
import 'package:stacked_themes/stacked_themes.dart';
|
||||||
|
|
||||||
class SettingsView extends StatelessWidget {
|
class SettingsView extends StatelessWidget {
|
||||||
const SettingsView({Key? key}) : super(key: key);
|
final TextEditingController organizationController = TextEditingController();
|
||||||
|
final TextEditingController patchesSourceController = TextEditingController();
|
||||||
|
final TextEditingController integrationsSourceController =
|
||||||
|
TextEditingController();
|
||||||
|
|
||||||
|
SettingsView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -19,7 +25,8 @@ class SettingsView extends StatelessWidget {
|
|||||||
viewModelBuilder: () => SettingsViewModel(),
|
viewModelBuilder: () => SettingsViewModel(),
|
||||||
onModelReady: (model) => model.initialize(),
|
onModelReady: (model) => model.initialize(),
|
||||||
builder: (context, SettingsViewModel model, child) => Scaffold(
|
builder: (context, SettingsViewModel model, child) => Scaffold(
|
||||||
body: SafeArea(
|
body: SingleChildScrollView(
|
||||||
|
child: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -75,6 +82,30 @@ class SettingsView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
CustomTextField(
|
||||||
|
inputController: organizationController,
|
||||||
|
label: 'settingsView.organizationLabel',
|
||||||
|
hint: ghOrg,
|
||||||
|
onChanged: (value) {
|
||||||
|
ghOrg = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
CustomTextField(
|
||||||
|
inputController: patchesSourceController,
|
||||||
|
label: 'settingsView.patchesSourceLabel',
|
||||||
|
hint: patchesRepo,
|
||||||
|
onChanged: (value) {
|
||||||
|
patchesRepo = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
CustomTextField(
|
||||||
|
inputController: integrationsSourceController,
|
||||||
|
label: 'settingsView.integrationsSourceLabel',
|
||||||
|
hint: integrationsRepo,
|
||||||
|
onChanged: (value) {
|
||||||
|
integrationsRepo = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 16.0,
|
horizontal: 16.0,
|
||||||
@ -119,6 +150,7 @@ class SettingsView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
|
|
||||||
class CustomSwitch extends StatelessWidget {
|
class CustomSwitch extends StatelessWidget {
|
||||||
final ValueChanged<bool> onChanged;
|
final ValueChanged<bool> onChanged;
|
||||||
|
81
lib/ui/widgets/settingsView/custom_text_field.dart
Normal file
81
lib/ui/widgets/settingsView/custom_text_field.dart
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
import 'package:revanced_manager/theme.dart';
|
||||||
|
|
||||||
|
class CustomTextField extends StatelessWidget {
|
||||||
|
final TextEditingController inputController;
|
||||||
|
final String label;
|
||||||
|
final String hint;
|
||||||
|
final Function(String)? onChanged;
|
||||||
|
|
||||||
|
const CustomTextField({
|
||||||
|
Key? key,
|
||||||
|
required this.inputController,
|
||||||
|
required this.label,
|
||||||
|
required this.hint,
|
||||||
|
required this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
const errorColor = Color(0xffEF4444);
|
||||||
|
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
TextField(
|
||||||
|
controller: inputController,
|
||||||
|
onChanged: onChanged,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: isDark ? Colors.grey[300] : Colors.black,
|
||||||
|
),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
label: I18nText(label),
|
||||||
|
labelStyle:
|
||||||
|
TextStyle(color: isDark ? Colors.grey[300] : Colors.black),
|
||||||
|
filled: true,
|
||||||
|
fillColor: Theme.of(context).colorScheme.primary,
|
||||||
|
hintText: hint,
|
||||||
|
hintStyle: TextStyle(color: Colors.grey.withOpacity(.75)),
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 0.0, horizontal: 20.0),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Theme.of(context).colorScheme.tertiary,
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
gapPadding: 4.0,
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
),
|
||||||
|
errorBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: errorColor, width: 1.0),
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Theme.of(context).colorScheme.tertiary,
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user