Skip to content

Instantly share code, notes, and snippets.

View MarcinusX's full-sized avatar
🇵🇱
 🇵🇱

Marcin Szałek MarcinusX

🇵🇱
 🇵🇱
View GitHub Profile
/// Copied from https://github.com/flutter/flutter/issues/33988#issuecomment-600748507
/// Steps to reproduce:
/// 1. Move the map location, bool value keeps changing.
/// 2. Tap on the container anywhere.
/// 3. Now again move the map.
/// 4. bool value does not change.(onCameraIdle() not working).
/// Occurs on google_maps_flutter:0.5.27
import 'package:flutter/material.dart';
@MarcinusX
MarcinusX / main.dart
Created March 8, 2021 07:29
Broken RTL on Web example
import 'package:flutter/material.dart';
void main() => runApp(RtlBrokenApp());
class RtlBrokenApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Padding(
@MarcinusX
MarcinusX / riverpod_future_provider_test.dart
Created January 3, 2023 14:17
This gist is to represent unexpected behaviour when testing FutureProvider in Riverpod 2.1.3
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
void main() {
group('RiverpodFutureProviders', () {
// this fails - async is returned
testWidgets('Future.value works', (tester) async {
@MarcinusX
MarcinusX / timesamp_to_local_datetimes_linter.dart
Last active March 6, 2023 09:48
A linter for parsing protobuf's Timestamps to DateTime. The goal is to always include isLocal: true when doing it.
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/source/source_range.dart';
import 'package:custom_lint_builder/custom_lint_builder.dart';
class PreferTimestampsToLocalDateTimes extends DartLintRule {
PreferTimestampsToLocalDateTimes() : super(code: _code);