mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-13 13:26:43 +02:00
Merge pull request #246 from ImranR98/dev
Bugfixes for #242 and #245 + Various UI Improvements
This commit is contained in:
@ -150,6 +150,7 @@ class _GeneratedFormState extends State<GeneratedForm> {
|
|||||||
Map<String, dynamic> values = {};
|
Map<String, dynamic> values = {};
|
||||||
late List<List<Widget>> formInputs;
|
late List<List<Widget>> formInputs;
|
||||||
List<List<Widget>> rows = [];
|
List<List<Widget>> rows = [];
|
||||||
|
String? initKey;
|
||||||
|
|
||||||
// If any value changes, call this to update the parent with value and validity
|
// If any value changes, call this to update the parent with value and validity
|
||||||
void someValueChanged({bool isBuilding = false}) {
|
void someValueChanged({bool isBuilding = false}) {
|
||||||
@ -169,13 +170,10 @@ class _GeneratedFormState extends State<GeneratedForm> {
|
|||||||
widget.onValueChanges(returnValues, valid, isBuilding);
|
widget.onValueChanges(returnValues, valid, isBuilding);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
initForm() {
|
||||||
void initState() {
|
initKey = widget.key.toString();
|
||||||
super.initState();
|
|
||||||
|
|
||||||
// Initialize form values as all empty
|
// Initialize form values as all empty
|
||||||
values.clear();
|
values.clear();
|
||||||
int j = 0;
|
|
||||||
for (var row in widget.items) {
|
for (var row in widget.items) {
|
||||||
for (var e in row) {
|
for (var e in row) {
|
||||||
values[e.key] = e.defaultValue;
|
values[e.key] = e.defaultValue;
|
||||||
@ -245,8 +243,17 @@ class _GeneratedFormState extends State<GeneratedForm> {
|
|||||||
someValueChanged(isBuilding: true);
|
someValueChanged(isBuilding: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
initForm();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
if (widget.key.toString() != initKey) {
|
||||||
|
initForm();
|
||||||
|
}
|
||||||
for (var r = 0; r < formInputs.length; r++) {
|
for (var r = 0; r < formInputs.length; r++) {
|
||||||
for (var e = 0; e < formInputs[r].length; e++) {
|
for (var e = 0; e < formInputs[r].length; e++) {
|
||||||
if (widget.items[r][e] is GeneratedFormSwitch) {
|
if (widget.items[r][e] is GeneratedFormSwitch) {
|
||||||
|
@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
|
|||||||
// ignore: implementation_imports
|
// ignore: implementation_imports
|
||||||
import 'package:easy_localization/src/localization.dart';
|
import 'package:easy_localization/src/localization.dart';
|
||||||
|
|
||||||
const String currentVersion = '0.10.5';
|
const String currentVersion = '0.10.6';
|
||||||
const String currentReleaseTag =
|
const String currentReleaseTag =
|
||||||
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
|
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
Map<String, dynamic> additionalSettings = {};
|
Map<String, dynamic> additionalSettings = {};
|
||||||
bool additionalSettingsValid = true;
|
bool additionalSettingsValid = true;
|
||||||
List<String> pickedCategories = [];
|
List<String> pickedCategories = [];
|
||||||
|
int searchnum = 0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -40,10 +41,14 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
|
|
||||||
bool doingSomething = gettingAppInfo || searching;
|
bool doingSomething = gettingAppInfo || searching;
|
||||||
|
|
||||||
changeUserInput(String input, bool valid, bool isBuilding) {
|
changeUserInput(String input, bool valid, bool isBuilding,
|
||||||
|
{bool isSearch = false}) {
|
||||||
userInput = input;
|
userInput = input;
|
||||||
if (!isBuilding) {
|
if (!isBuilding) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
if (isSearch) {
|
||||||
|
searchnum++;
|
||||||
|
}
|
||||||
var source = valid ? sourceProvider.getSource(userInput) : null;
|
var source = valid ? sourceProvider.getSource(userInput) : null;
|
||||||
if (pickedSource.runtimeType != source.runtimeType) {
|
if (pickedSource.runtimeType != source.runtimeType) {
|
||||||
pickedSource = source;
|
pickedSource = source;
|
||||||
@ -169,10 +174,12 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: GeneratedForm(
|
child: GeneratedForm(
|
||||||
|
key: Key(searchnum.toString()),
|
||||||
items: [
|
items: [
|
||||||
[
|
[
|
||||||
GeneratedFormTextField('appSourceURL',
|
GeneratedFormTextField('appSourceURL',
|
||||||
label: tr('appSourceURL'),
|
label: tr('appSourceURL'),
|
||||||
|
defaultValue: userInput,
|
||||||
additionalValidators: [
|
additionalValidators: [
|
||||||
(value) {
|
(value) {
|
||||||
try {
|
try {
|
||||||
@ -296,8 +303,8 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
if (selectedUrls != null &&
|
if (selectedUrls != null &&
|
||||||
selectedUrls.isNotEmpty) {
|
selectedUrls.isNotEmpty) {
|
||||||
changeUserInput(
|
changeUserInput(
|
||||||
selectedUrls[0], true, false);
|
selectedUrls[0], true, false,
|
||||||
addApp(resetUserInputAfter: true);
|
isSearch: true);
|
||||||
}
|
}
|
||||||
}).catchError((e) {
|
}).catchError((e) {
|
||||||
showError(e, context);
|
showError(e, context);
|
||||||
@ -327,6 +334,7 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
height: 16,
|
height: 16,
|
||||||
),
|
),
|
||||||
GeneratedForm(
|
GeneratedForm(
|
||||||
|
key: Key(pickedSource.runtimeType.toString()),
|
||||||
items: pickedSource!
|
items: pickedSource!
|
||||||
.combinedAppSpecificSettingFormItems,
|
.combinedAppSpecificSettingFormItems,
|
||||||
onValueChanges: (values, valid, isBuilding) {
|
onValueChanges: (values, valid, isBuilding) {
|
||||||
|
@ -564,10 +564,7 @@ class _UrlSelectionModalState extends State<UrlSelectionModal> {
|
|||||||
widget.onlyOneSelectionAllowed ? tr('selectURL') : tr('selectURLs')),
|
widget.onlyOneSelectionAllowed ? tr('selectURL') : tr('selectURLs')),
|
||||||
content: Column(children: [
|
content: Column(children: [
|
||||||
...urlWithDescriptionSelections.keys.map((urlWithD) {
|
...urlWithDescriptionSelections.keys.map((urlWithD) {
|
||||||
return Row(children: [
|
select(bool? value) {
|
||||||
Checkbox(
|
|
||||||
value: urlWithDescriptionSelections[urlWithD],
|
|
||||||
onChanged: (value) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
value ??= false;
|
value ??= false;
|
||||||
if (value! && widget.onlyOneSelectionAllowed) {
|
if (value! && widget.onlyOneSelectionAllowed) {
|
||||||
@ -576,6 +573,13 @@ class _UrlSelectionModalState extends State<UrlSelectionModal> {
|
|||||||
urlWithDescriptionSelections[urlWithD] = value!;
|
urlWithDescriptionSelections[urlWithD] = value!;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return Row(children: [
|
||||||
|
Checkbox(
|
||||||
|
value: urlWithDescriptionSelections[urlWithD],
|
||||||
|
onChanged: (value) {
|
||||||
|
select(value);
|
||||||
}),
|
}),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 8,
|
width: 8,
|
||||||
@ -599,13 +603,18 @@ class _UrlSelectionModalState extends State<UrlSelectionModal> {
|
|||||||
const TextStyle(decoration: TextDecoration.underline),
|
const TextStyle(decoration: TextDecoration.underline),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
)),
|
)),
|
||||||
Text(
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
select(!(urlWithDescriptionSelections[urlWithD] ?? false));
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
urlWithD.value.length > 128
|
urlWithD.value.length > 128
|
||||||
? '${urlWithD.value.substring(0, 128)}...'
|
? '${urlWithD.value.substring(0, 128)}...'
|
||||||
: urlWithD.value,
|
: urlWithD.value,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontStyle: FontStyle.italic, fontSize: 12),
|
fontStyle: FontStyle.italic, fontSize: 12),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 8,
|
height: 8,
|
||||||
)
|
)
|
||||||
|
@ -247,7 +247,11 @@ class AppsProvider with ChangeNotifier {
|
|||||||
!(await canDowngradeApps())) {
|
!(await canDowngradeApps())) {
|
||||||
throw DowngradeError();
|
throw DowngradeError();
|
||||||
}
|
}
|
||||||
await InstallPlugin.installApk(file.file.path, 'dev.imranr.obtainium');
|
await InstallPlugin.installApk(file.file.path, obtainiumId);
|
||||||
|
if (file.appId == obtainiumId) {
|
||||||
|
// Obtainium prompt should be lowest
|
||||||
|
await Future.delayed(const Duration(milliseconds: 500));
|
||||||
|
}
|
||||||
apps[file.appId]!.app.installedVersion =
|
apps[file.appId]!.app.installedVersion =
|
||||||
apps[file.appId]!.app.latestVersion;
|
apps[file.appId]!.app.latestVersion;
|
||||||
// Don't correct install status as installation may not be done yet
|
// Don't correct install status as installation may not be done yet
|
||||||
|
@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 0.10.5+111 # When changing this, update the tag in main() accordingly
|
version: 0.10.6+112 # When changing this, update the tag in main() accordingly
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.18.2 <3.0.0'
|
sdk: '>=2.18.2 <3.0.0'
|
||||||
|
Reference in New Issue
Block a user