Паттерн Декоратор — специальный способ организации модулей в программе, который позволяет подставить какую-то новую функцию прямо в середину цепочки вызовов, тем самым чуть-чуть подкорректировав поведение.
Например, в реальном мире очки для чтения это декоратор. Вы ставите их между вашими глазами и текстом. Глобально взаимодействие ваших глаз и текста не меняется: отражённые световые лучи от страницы книги попадают в ваши зрачки, что с очками, что без них. Но очки располагаются посередине: они принимают лучи на вход и преломляют их, передавая дальше вам в глаза уже изменёнными.
Важной особенностью является тот факт, что очки можно снять. Они не требуют ни модификации вашего тела, ни модификации книги. Вообще никакие условия не нужны, кроме наличия самих очков. А если вы в линзах, то внешний наблюдатель может даже этого не знать.
Класс-декоратор должен быть спроектирован так, чтобы не требовать никаких изменений в объектах, с которыми он работает. Его можно отключить, чаще всего буквально закомментировав одну строку.
В примере ниже программа выведет текст "Привет, мир, в натуре.", и вот это дополнение в конце как раз дописано декоратором. Можно убрать или закомментировать подчёркнутую строчку, не трогая остальной код, для всех внешних вызовов сигнатуры останутся теми же самыми, но выводиться будет уже просто "Привет, мир".
В декораторы можно прятать логику, которую буквально навешивают поверх основной функции программы. Например, проверку прав на выполнение операции. Перевод на другой язык, логирование, поддержку обратной совместимости при обновлении и так далее.
#dev
#dart
You can watch live streams simply on multiple platforms like Huya, Douyu, Bilibili, and Douyin using an app called Simple Live. It works on Android, iOS, Windows, MacOS, Linux, and Android TV, though some versions are still in beta. The app is built with Flutter and includes features to get live video and chat messages (danmaku) from these sites. You need to compile the app yourself since no ready-made installer is provided. This gives you a lightweight, easy way to watch live broadcasts from popular Chinese streaming platforms on many devices without extra cost or ads.
https://github.com/xiaoyaocz/dart_simple_live
#dart
The Flutter Packages repository on GitHub holds the source code for official Flutter packages made by the core team, including popular ones like camera, google_maps_flutter, and shared_preferences, all available for use in your apps and also published on pub.dev for easy installation[4]. This means you get reliable, well-maintained tools for features like maps, user preferences, and device hardware access, helping you build apps faster and with less worry about bugs or compatibility issues. The benefit is that you can trust these packages for quality and support, and you can even help improve them by reporting issues or contributing code[4].
https://github.com/flutter/packages
РУКОТВОРНЫЙРОЙ НЕБЕСНЫХ ВАЛУНОВ
Это глубокий снимок двойного астероида Дидим-Диморф, полученный КТ "Хаббл" 19 дек. 2022 г., спустя 3 месяца после столкновения с ударником миссии DART.
Здесь, помимо яркого и узкого шлейфа выброшенной в ходе рукотворного катаклизма пыли, идентифицировано 37 крупных, от 1 до 7 м, валунов (отмечены кружками). Эти объекты - в числе самых маленьких и тусклых (видимый блеск от 26-й до 28-й зв. вел.) из когда-либо фотографировавшихся в Солнечной системе.
Это - не осколки удара; камни уже лежали на поверхности астероида, но были выброшены в космос энергией столкновения и отдаляются от материнского тела на скоростях ~30 см/с. Как отмечается в пресс-релизе НАСА, это можно сравнить со скоростью гигантской черепахи.
Миссия ЕКА "Hera", которая сблизится с системой в конце 2026 г., сможет сфотографировать эти валуны с близкого расстояния.
Научная статья с результатами
#DART#Hera#Dimorphos
🚀 Менторство по Flutter + AI
Делаем реальное AI-мобильное приложение. Полностью удалённо.
Языки: EN / УКР / RU
Что получите:
• Индивидуальное наставничество 1:1 с сеньорами
• Парное программирование, код-ревью, быстрый рост
• Сильный кейс в портфолио
• Перспектива обсудить оплачиваемую работу позже
Стек: Flutter/Dart, AWS, Git, Jira + Scrum
Условия: сейчас без оплаты (фокус на обучении и портфолио)
Как откликнуться — DM @glorymlory:
1. ваш @username
2. 2–3 предложения о текущем стеке/опыте (Flutter или смежное)
3. ваша недельная доступность (часы)
#Flutter#Dart#AI#Mentorship#Remote
#dart#capture_traffic#httpdebug#proxy#proxypin#zhuabao
ProxyPin is a free, open-source tool that lets you capture, inspect, and modify HTTP(S) traffic on many devices like Windows, Mac, Android, iOS, and Linux. It’s easy to use with a nice interface and supports features like scanning QR codes to connect devices without manual setup, filtering traffic by domain, searching requests, rewriting or blocking requests, and saving traffic history. You can also write JavaScript scripts to customize how requests and responses are handled. This helps you debug network issues, analyze app traffic (including Flutter apps), and improve security or performance efficiently across platforms[1][3].
https://github.com/wanghongenpin/proxypin
#dart#android#flutter#flutter_apps#manager#modding#patching#revanced
ReVanced Manager is an app for Android that lets you customize and patch other apps, like YouTube, to remove ads and add features without needing subscriptions. It is easy to use, works on both rooted and non-rooted devices, and offers many options to tailor apps to your liking. You download the official app, then apply patches you want, creating a personalized, ad-free experience. This saves you money and improves app use while staying legal and supported by an active community. It is lightweight, regularly updated, and has a simple interface, making app customization safe and convenient[1][3][5].
https://github.com/ReVanced/revanced-manager
#dart#android#cross_platform#expense_tracker#flutter#grocery_list#ios#kitchenowl#mobile_app#recipe_manager#self_hosted
KitchenOwl is a helpful app for managing your grocery shopping and recipes. It allows you to create and share shopping lists with others, which is great for families. You can also store and share recipes, plan meals, and track how much you spend. The app is open-source and free, meaning you can use it without paying and even help improve it. It works on many devices, including phones and computers, and can be used offline too. This makes shopping easier and helps you stay organized.
https://github.com/TomBursch/kitchenowl
#dart#clash#clashmeta#ech#hysteria#hysteria2#proxy#reality#shadowsocks#shadowtls#sing_box#singbox#ssh#tuic#v2ray#vless#vmess#wireguard#xray
Hiddify is a free, ad-free, open-source proxy VPN app for Android, iOS, Windows, macOS, and Linux. It uses Sing-box to support protocols like Vless, Reality, Hysteria, TUIC, WireGuard, and SSH, with auto node selection by delay, subscription updates, TUN mode, and traffic info. Download from app stores or GitHub. It benefits you by providing secure, fast, private internet access to bypass restrictions in places like Iran or China, ensuring unrestricted browsing without costs or ads.
https://github.com/hiddify/hiddify-app