Skip to content

Instantly share code, notes, and snippets.

View SureshKumar311's full-sized avatar

Suresh Kumar SureshKumar311

View GitHub Profile
@SureshKumar311
SureshKumar311 / flutter_web_disableShortcut.dart.dart
Last active February 22, 2023 11:41
DisableShortcut on Flutter web
//Use this for block default contextmenu on flutter web
if (kIsWeb && kReleaseMode) {
//contextmenu will work on debug mode only
html.document.body!.addEventListener('contextmenu', (event) => event.preventDefault());
//to prevent onPaste over hold web app
//html.document.onPaste.listen((event)=>event.preventDefault());
}
/// Chid widget will not be able to use shortcuts on flutter web
@SureshKumar311
SureshKumar311 / url_Encryption.dart
Last active January 16, 2023 08:08
Flutter Web URL Encryption
//This method uses encrypt:^5.0.1 package to encrypt the url
//Key and IV should be same for both encryption and decryption
//https://pub.dev/packages/encrypt
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:flutter/material.dart';
String enCryptURL(String url, {bool isrestoreRoute = false}) {
//final Uri uri = Uri.parse(enCryptURL(routeInformation.location ?? ""));
//return RouteInformation(location: enCryptURL(location, isrestoreRoute: true));