Skip to content

Instantly share code, notes, and snippets.

@Schwusch
Schwusch / super_editor_syntax_highlighting.dart
Last active June 20, 2021 22:04
Simple experiment to combine package:highlight with package:super_editor in Flutter
import 'package:super_editor/super_editor.dart';
import 'package:highlight/highlight.dart' show highlight;
import 'package:flutter_highlight/themes/github.dart';
Widget superEditorHighlighter(String code, String language, TextStyle defaultStyle) {
var result = highlight.parse(code, language: language);
var charCount = 0;
final myDoc = MutableDocument(nodes: [
ParagraphNode(
@Schwusch
Schwusch / main.dart
Created December 14, 2022 18:41
quintessential-glacier-6695
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
Hello everyone, the submarine podcast is with you, its presenter Egor Tolstoy, this is
me and Ekaterina Petrova, hello everyone, if you turned on this episode, you already know
what it is about by the way. I don’t know why, in general, every time in eyeliners we
try to guess some kind of riddle for those who are listening, as if they didn’t see the title of
the release, it seems to me that we ourselves are trying to warm up a little just to tune
in to normal questions, and this is the time where we are dragging time with our
eyeliners, as we are now just trying to get into the flow maybe maybe but in short it
doesn't matter today a new episode in the category of your favorite episodes this is
not food episodes it's a category on. these are issues about programming languages and
today we will talk about dart, not to be confused with dark, we also wrote about dark, but
@Schwusch
Schwusch / selection_transformer.dart
Last active January 5, 2025 15:31 — forked from schultek/selection_transformer.dart
A widget that transforms the text selection when copied.
import 'package:collection/collection.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
typedef SelectionTransform = String Function(Iterable<String>);
/// A widget that transforms the text selection when copied.
///
/// This uses the [SelectionContainer] with a custom [SelectionContainerDelegate] to override the
/// [getSelectedContent] method with a custom implementation.
@Schwusch
Schwusch / blog_arrow_widget.dart
Last active November 23, 2023 19:16
blog_arrow_widget.dart
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) => Scaffold(
body: Stack(
children: [