Compare commits

..

No commits in common. "23de275e1160124ca5f522cf8c6272358e880502" and "d3070ffee1033c97d76d168c7d27191ac25492f7" have entirely different histories.

4 changed files with 7 additions and 18 deletions

View File

@ -62,13 +62,7 @@ Map<String, dynamic> createDefaultSettings(String mountType) {
'EncryptConfig': {'EncryptionToken': '', 'Path': ''},
};
case 'Remote':
return {
'RemoteConfig': {
'ApiPort': 20000,
'EncryptionToken': '',
'HostNameOrIp': '',
},
};
return {'EventLevel': 'info'};
case 'S3':
return {
'S3Config': {

View File

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:repertory/constants.dart' as constants;
import 'package:repertory/helpers.dart';
import 'package:repertory/models/mount_list.dart';
import 'package:repertory/types/mount_config.dart';
@ -17,7 +18,6 @@ class Mount with ChangeNotifier {
}
String? get bucket => mountConfig.bucket;
String get id => '${type}_$name';
String get name => mountConfig.name;
String get path => mountConfig.path;
IconData? get state => mountConfig.state;

View File

@ -84,9 +84,9 @@ class _AddMountScreenState extends State<AddMountScreen> {
),
),
),
if (_mountType.isNotEmpty && _mountType != 'Remote')
if (_mountType.isNotEmpty)
const SizedBox(height: constants.padding),
if (_mountType.isNotEmpty && _mountType != 'Remote')
if (_mountType.isNotEmpty)
Card(
margin: EdgeInsets.all(0.0),
child: Padding(
@ -181,9 +181,7 @@ class _AddMountScreenState extends State<AddMountScreen> {
await mountList.add(
_mountType,
_mountType == 'Remote'
? '${_settings[_mountType]!['RemoteConfig']['HostNameOrIp']}_${_settings[_mountType]!['RemoteConfig']['ApiPort']}'
: _mountNameController.text,
_mountNameController.text,
_settings[_mountType]!,
);
@ -208,9 +206,7 @@ class _AddMountScreenState extends State<AddMountScreen> {
final changed = _mountType != mountType;
_mountType = mountType;
if (_mountType == 'Remote') {
_mountNameController.text = 'remote';
} else if (changed) {
if (changed) {
_mountNameController.text = mountType == 'Sia' ? 'default' : '';
}

View File

@ -15,7 +15,6 @@ class MountListWidget extends StatelessWidget {
itemBuilder: (context, idx) {
return ChangeNotifierProvider(
create: (context) => mountList.items[idx],
key: ValueKey(mountList.items[idx].id),
child: Padding(
padding: EdgeInsets.only(
bottom:
@ -23,7 +22,7 @@ class MountListWidget extends StatelessWidget {
? 0.0
: constants.padding,
),
child: MountWidget(),
child: const MountWidget(),
),
);
},