Skip to content

Commit

Permalink
removed trash
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Sep 25, 2023
1 parent f1459aa commit 66e3215
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions lib/views/main_view/main_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutterlifecyclehooks/flutterlifecyclehooks.dart';
Expand Down Expand Up @@ -66,49 +63,3 @@ class _MainViewState extends ConsumerState<MainView> with LifecycleMixin {
);
}
}

List<String>? getCmds() {
late final String cmd;
var cmdSuffix = '';

const plainPath = 'path/subpath';
const args = 'path/portion/?uid=123&token=abc';
const emojiArgs = '?arr%5b%5d=123&arr%5b%5d=abc&addr=1%20Nowhere%20Rd&addr=Rand%20City%F0%9F%98%82';

if (kIsWeb) {
return [
plainPath,
args,
emojiArgs,
// Cannot create malformed url, since the browser will ensure it is valid
];
}

if (Platform.isIOS) {
cmd = '/usr/bin/xcrun simctl openurl booted';
} else if (Platform.isAndroid) {
cmd = '\$ANDROID_HOME/platform-tools/adb shell \'am start'
' -a android.intent.action.VIEW'
' -c android.intent.category.BROWSABLE -d';
cmdSuffix = "'";
} else {
return null;
}

// https://orchid-forgery.glitch.me/mobile/redirect/
return [
'$cmd "unilinks://host/$plainPath"$cmdSuffix',
'$cmd "unilinks://example.com/$args"$cmdSuffix',
'$cmd "unilinks://example.com/$emojiArgs"$cmdSuffix',
'$cmd "unilinks://@@malformed.invalid.url/path?"$cmdSuffix',
];
}

List<Widget> intersperse(Iterable<Widget> list, Widget item) {
final initialValue = <Widget>[];
return list.fold(initialValue, (all, el) {
if (all.isNotEmpty) all.add(item);
all.add(el);
return all;
});
}

0 comments on commit 66e3215

Please sign in to comment.