Skip to content

Instantly share code, notes, and snippets.

View loic-sharma's full-sized avatar

Loïc Sharma loic-sharma

View GitHub Profile
@loic-sharma
loic-sharma / readme.md
Last active March 18, 2024 16:35
Android link error

Android link error reactions each day

flutter/flutter#83596

Data ranges from July 18, 2021 to March 3, 2024.

image

Week New reactions
@loic-sharma
loic-sharma / rfw_json.md
Last active February 26, 2024 17:58
RFW JSON format strawman

Given the following RFW text:

import core.widgets;

widget root = Row(
  children: [
    ...for city in args.cities:
      switch args.showCities {
        true: City(),
@loic-sharma
loic-sharma / main.dart
Last active January 2, 2024 17:42
Windows compositor animation regression
// The Windows compositor changes regresses the animation in
// the `material_floating_search_bar_2` package:
//
// https://pub.dev/packages/material_floating_search_bar_2/versions/0.5.0
//
// Below is a minimal repro of the broken animation. This has two pieces:
//
// 1. The background fades to a grey color
// 2. A box is "revealed" using a custom clipper
//
// Based off https://medium.com/akvelon/how-to-make-textfield-in-multiple-colors-in-flutter-c317ae0efafe
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
final controller = HubQLTextEditingController();
@loic-sharma
loic-sharma / swiftui_tutorial_feedback.md
Last active December 23, 2023 19:55
SwiftUI tutorial feedback

SwiftUI tutorial feedback

Last updated: 2023-12-23

The SwiftUI tutorials are truly excellent. They raise the bar for a UI framework's introduction. Please don't be discouraged by the feedback below, you all have done wonderful work!

I have not completed the tutorials yet. I will add more content as I continue progressing through the tutorials.

Seek feedback

#include <iostream>
class Foo {
public:
std::unique_ptr<int> data;
Foo(int d) {
data = std::make_unique<int>(d);
std::cout << "Constructor called" << std::endl;
};
@loic-sharma
loic-sharma / 1_today_c.md
Last active July 21, 2023 23:44
Flutter Windows object model
---
title: Today's Flutter Windows object model
---
flowchart LR
  subgraph "Windows embedder (internal)"
    FlutterWindowsEngine
    FlutterWindowsView
    FlutterDesktopViewControllerState
@loic-sharma
loic-sharma / main.dart
Last active July 2, 2023 19:12
TextField and Shortcuts
import 'package:flutter/material.dart';
class TextFieldSample extends StatelessWidget {
const TextFieldSample({super.key});
@override
Widget build(BuildContext context) {
return CallbackShortcuts(
bindings: <ShortcutActivator, VoidCallback>{
// This causes the shortcut to handle the 'a' key event
PS C:\Code\f\flutter\packages\flutter\test_fixes> dart --version
Dart SDK version: 3.1.0-232.0.dev (dev) (Tue Jun 20 05:07:42 2023 -0700) on "windows_x64"
PS C:\Code\f\flutter\packages\flutter\test_fixes> dart fix --compare-to-golden
Computing fixes in test_fixes...
Error from the analysis server: Exception while getting bulk fixes: Exception generating fix for MISSING_REQUIRED_ARGUMENT in c:\code\f\flutter\packages\flutter\test_fixes\services\services.dart
Bad state: No element
#0 List.last (dart:core-patch/growable_array.dart:348:5)
#1 ModifyParameters.apply (package:analysis_server/src/services/correction/fix/data_driven/modify_parameters.dart:129:36)
#2 DataDrivenFix.compute.<anonymous closure> (package:analysis_server/src/services/correction/dart/data_driven.dart:105:20)
#3 ChangeBuilderImpl.addDartFileEdit (package:analyzer_plugin/src/utilities/change_builder/change_builder_core.dart:151:26)
@loic-sharma
loic-sharma / main.cpp
Last active June 14, 2023 23:17
Windows runner APIs
{
// Create a view. The view controller takes ownership of the engine.
auto controller = FlutterDesktopViewControllerCreate(width, height, engine);
auto view = FlutterDesktopViewControllerGetView(controller);
HWND hwnd = FlutterDesktopViewGetHWND(view);
// Attach the view's HWND to the window...
// Run app...
// Destroy the view controller. This also destroys the view and the engine.