Skip to content

Instantly share code, notes, and snippets.

View loic-sharma's full-sized avatar
🙃

Loïc Sharma loic-sharma

🙃
View GitHub Profile
final counter = signal(0);
final userProfile = signal({ 'name': 'Guest' });
final counterSquared = computed((context) {
final count = context.watch(counter);
return count * count;
})
final printEffect = effect((context) {
final count = context.watch(counter);
print('Counter changed to $count');
@loic-sharma
loic-sharma / README.md
Created November 21, 2025 18:01
Quantifying the demand to stop pinning the Flutter SDK's dependencies

Here is the activity on flutter/flutter#158050 in hte last 100 days (from 2025-08-13 to 2025-11-21):

Total reactions Total comments New reactions New comments
95 14 3 2

How to analyze this data yourself

  1. Install DuckDB.
@loic-sharma
loic-sharma / main.dart
Last active November 19, 2025 03:11
Style API
import 'package:flutter/material.dart';
void main() => runApp(const MyWidget());
class MyWidget extends StatelessWidget {
const MyWidget({super.key});
@override
Widget build(BuildContext context) {
return const Column(
@loic-sharma
loic-sharma / ParagraphSlide.cpp
Created October 30, 2025 18:19
Impact of letter spacing on Arabic text
class ParagraphSlide0 : public ParagraphSlide_Base {
public:
ParagraphSlide0() { fName = "Paragraph0"; }
void draw(SkCanvas* canvas) override {
canvas->drawColor(SK_ColorWHITE);
auto multiplier = 5.67;
const char* text = "English English\n\nمرحبا بالعالم";
auto fontCollection = sk_make_sp<FontCollection>();
@loic-sharma
loic-sharma / ContentView.swift
Created August 8, 2025 22:08
iOS's three finger swipe gesture to undo/redo pops the current page
import SwiftUI
/// This is the main view of the application, analogous to the `MaterialApp` and `HomePage` widgets in the Flutter example.
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
NavigationLink {
TextFieldView()
} label: {
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
void main() {
runApp(const MyApp());
}
@loic-sharma
loic-sharma / opacity.dart
Created June 24, 2025 16:04
Primary constructor experiments
// Current
class Opacity extends SingleChildRenderObjectWidget {
/// Creates a widget that makes its child partially transparent.
///
/// The [opacity] argument must be between zero and one, inclusive.
const Opacity({
super.key,
required this.opacity,
this.alwaysIncludeSemantics = false,
super.child,
@loic-sharma
loic-sharma / 0_README.md
Last active April 30, 2025 18:56
JetBrains Survey: Crossplatform Framework Usage
@loic-sharma
loic-sharma / 0_README.md
Last active April 11, 2025 21:00
Top text input issues in last 90 days

Top text input issues in last 90 days

These are the team-text-input and a: text input issues that had the most reactions from January 11, 2025 to April 11, 2025.

Title Category New reactions
Ability to change the keyboard language programmatically flutter/flutter#99606 Keyboard language 9
Hot restart while keyboard is up leaves the keyboard up flutter/flutter#10713 Software keyboard 9
Let iOS keyboard dismissal synchronize with scroll flutter/flutter#57609 Sofware keyboard 8
@loic-sharma
loic-sharma / 0_today.dart
Created April 5, 2025 22:05
Text widget verbosity
import 'package:flutter/material.dart';
import 'package:flutter/gestures.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override