ios disable select location to save swb and default to Docs dir

This commit is contained in:
Julian 2024-05-13 13:03:13 -06:00
parent bc4d3d7381
commit 81a4d2f1eb
6 changed files with 27 additions and 22 deletions

View file

@ -88,7 +88,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
passwordFocusNode = FocusNode();
passwordRepeatFocusNode = FocusNode();
if (Platform.isAndroid) {
if (Platform.isAndroid || Platform.isIOS) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
final dir = await stackFileSystem.prepareStorage();
if (mounted) {
@ -151,11 +151,11 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
const SizedBox(
height: 10,
),
if (!Platform.isAndroid)
if (!Platform.isAndroid && !Platform.isIOS)
TextField(
autocorrect: Util.isDesktop ? false : true,
enableSuggestions: Util.isDesktop ? false : true,
onTap: Platform.isAndroid
onTap: Platform.isAndroid || Platform.isIOS
? null
: () async {
try {
@ -213,7 +213,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
),
onChanged: (newValue) {},
),
if (!Platform.isAndroid)
if (!Platform.isAndroid && !Platform.isIOS)
const SizedBox(
height: 10,
),

View file

@ -80,7 +80,7 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
passwordFocusNode = FocusNode();
passwordRepeatFocusNode = FocusNode();
if (Platform.isAndroid) {
if (Platform.isAndroid || Platform.isIOS) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
final dir = await stackFileSystem.prepareStorage();
if (mounted) {
@ -179,14 +179,14 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (!Platform.isAndroid)
if (!Platform.isAndroid && !Platform.isIOS)
Consumer(builder: (context, ref, __) {
return Container(
color: Colors.transparent,
child: TextField(
autocorrect: Util.isDesktop ? false : true,
enableSuggestions: Util.isDesktop ? false : true,
onTap: Platform.isAndroid
onTap: Platform.isAndroid || Platform.isIOS
? null
: () async {
try {
@ -248,7 +248,7 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
),
);
}),
if (!Platform.isAndroid)
if (!Platform.isAndroid && !Platform.isIOS)
SizedBox(
height: !isDesktop ? 8 : 24,
),

View file

@ -260,7 +260,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
passwordFocusNode = FocusNode();
passwordRepeatFocusNode = FocusNode();
if (Platform.isAndroid) {
if (Platform.isAndroid || Platform.isIOS) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
final dir = await stackFileSystem.prepareStorage();
if (mounted) {
@ -346,11 +346,11 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
const SizedBox(
height: 10,
),
if (!Platform.isAndroid)
if (!Platform.isAndroid && !Platform.isIOS)
TextField(
autocorrect: Util.isDesktop ? false : true,
enableSuggestions: Util.isDesktop ? false : true,
onTap: Platform.isAndroid
onTap: Platform.isAndroid || Platform.isIOS
? null
: () async {
try {
@ -418,7 +418,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
),
textAlign: TextAlign.left,
),
if (!Platform.isAndroid)
if (!Platform.isAndroid && !Platform.isIOS)
const SizedBox(
height: 10,
),

View file

@ -79,11 +79,16 @@ class SWBFileSystem {
}
Future<void> pickDir(BuildContext context) async {
final String? path = await FilePicker.platform.getDirectoryPath(
dialogTitle: "Choose Backup location",
initialDirectory: startPath!.path,
lockParentWindow: true,
);
final String? path;
if (Platform.isIOS) {
path = startPath?.path;
} else {
path = await FilePicker.platform.getDirectoryPath(
dialogTitle: "Choose Backup location",
initialDirectory: startPath!.path,
lockParentWindow: true,
);
}
dirPath = path;
}

View file

@ -99,7 +99,7 @@ class _CreateAutoBackup extends ConsumerState<CreateAutoBackup> {
passphraseFocusNode = FocusNode();
passphraseRepeatFocusNode = FocusNode();
if (Platform.isAndroid) {
if (Platform.isAndroid || Platform.isIOS) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
final dir = await stackFileSystem.prepareStorage();
if (mounted) {
@ -174,14 +174,14 @@ class _CreateAutoBackup extends ConsumerState<CreateAutoBackup> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (!Platform.isAndroid)
if (!Platform.isAndroid && !Platform.isIOS)
Consumer(builder: (context, ref, __) {
return Container(
color: Colors.transparent,
child: TextField(
autocorrect: false,
enableSuggestions: false,
onTap: Platform.isAndroid
onTap: Platform.isAndroid || Platform.isIOS
? null
: () async {
try {
@ -241,7 +241,7 @@ class _CreateAutoBackup extends ConsumerState<CreateAutoBackup> {
),
);
}),
if (!Platform.isAndroid)
if (!Platform.isAndroid && !Platform.isIOS)
const SizedBox(
height: 24,
),

View file

@ -140,7 +140,7 @@ dependencies:
pointycastle: ^3.6.0
package_info_plus: ^4.0.2
lottie: ^2.3.2
file_picker: ^5.5.0
file_picker: ^8.0.3
connectivity_plus: ^4.0.1
isar: 3.0.5
isar_flutter_libs: 3.0.5 # contains the binaries