This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Foo? foo; | |
foo?.bar ??= 666; | |
print(foo); | |
foo = Foo()..bar = 666; | |
print(foo.bar); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ScopingFunctions<T> on T { | |
/// Calls the specified function [block] with `this` value | |
/// as its argument and returns its result. | |
R let<R>(R Function(T) block) => block(this as T); | |
/// Calls the specified function [block] with `this` value | |
/// as its argument and returns `this` value. | |
T also(void Function(T) block) { | |
block(this as T); | |
return this as T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Loops through all fields in the receiving object and looks for fields | |
* with the same name in the sending object. Then it tries to copy non-null | |
* values to the receiving object, and silently fails when something goes wrong | |
* | |
* Don't use this | |
*/ | |
fun Any.update(new: Any) = javaClass.declaredFields.forEach { field -> | |
try { | |
field.isAccessible = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => MaterialApp( | |
home: TiltedPyramid(), | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Purpose: Shell script to connect a USB connected device via adb over WiFi | |
# | |
# Author: Amanshu Raikwar | |
# | |
# Assumptions: | |
# 1. USB debugging is enabled in the Android device | |
# 2. The Android device is connected to the computer via USB | |
# 3. The Android device is connected to the same wifi as the computer | |
# 4. The Android device is accessible through port 5555 over the wifi network | |
# |
NewerOlder