Skip to content

Instantly share code, notes, and snippets.

@ffkev
ffkev / changes in test_quill.html
Last active December 15, 2025 09:42
Changes included in the HTML Editor to support Mulish font.
======================================================================================================
Use the latest test_quill.html as a reference for the full implementation
Create a folder under web/ as web/fonts/ and include all the Mulish fonts for offline access from
the assets/ folder in the Flutter project
======================================================================================================
Refer line 351
@ffkev
ffkev / setHTML_test_quill.html
Last active December 12, 2025 10:55
setHTML for Quill pasting with HTML Delta
case 'setHTML':
if (data.html) {
// setTimeout to make this asynchronous and prevent blocking with large HTML
setTimeout(function() {
try {
// Clear existing content
editor.setContents([{ insert: '\n' }], Quill.sources.API);
// For very large HTML, we need to handle it carefully
const htmlString = String(data.html);
@ffkev
ffkev / quill_html_export.dart
Created September 25, 2025 09:54
Code snippet to export html data from quill editor
ElevatedButton(
child: Text('Download as HTML'),
onPressed: () {
final htmlContent = _model.htmlString ?? '';
final bytes = utf8.encode(htmlContent);
final blob = html.Blob([bytes], 'text/html');
final url = html.Url.createObjectUrlFromBlob(blob);
final anchor = html.AnchorElement(href: url)
..setAttribute('download', 'quill_data.html')
..click();
js: 0.6.7
back_button_interceptor: 8.0.4
g_recaptcha_v3: 1.0.0
universal_html: 2.2.4
encrypt: 5.0.3
cryptography: 2.7.0
syncfusion_flutter_pdf: 29.1.38
flutter_session_manager: 1.0.3
local_captcha: 1.0.5
dio: 5.8.0+1
@ffkev
ffkev / main.dart
Created April 21, 2025 05:09
Gist to display a base64 encoded image in Flutter
import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@ffkev
ffkev / index.html
Created February 26, 2025 11:14
Disable automatic page_view tracking in GA4
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('set', { 'send_page_view': false });
</script>
@ffkev
ffkev / update_json_bool.dart
Created September 5, 2024 11:42
Code that will modify the isSelected value in JSON based on what values are passed to the parser function
import 'dart:convert';
void main() {
String jsonString = '''
{
"baseRequest": [
{"iconCode": 58513, "chipLabel": "India", "isDisabled": true, "isSelected": false},
{"iconCode": 58513, "chipLabel": "Africa", "isDisabled": true, "isSelected": false},
{"iconCode": 58395, "chipLabel": "America", "isDisabled": false, "isSelected": true},
@ffkev
ffkev / launch_web_same_tab.dart
Created August 27, 2024 06:20
Launch a website in the same tab in Flutter web
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@ffkev
ffkev / hyper_link_text_widget.dart
Created August 20, 2024 20:04
This is sample flutter code for a Text widget which will exhibit hyperlink capabilities such as showing a blue underline in the text when it is hovered on top of
@ffkev
ffkev / main.dart
Created July 30, 2024 18:58
Code to enable focusable widgets across a Flutter Web app
void main() async {
WidgetsFlutterBinding.ensureInitialized();
GoRouter.optionURLReflectsImperativeAPIs = true;
usePathUrlStrategy();
await FlutterFlowTheme.initialize();
runApp(
FocusTraversalGroup(
policy: WidgetOrderTraversalPolicy(),