Skip to content

Instantly share code, notes, and snippets.

Avatar
🇵🇱
 🇵🇱

Marcin Szałek MarcinusX

🇵🇱
 🇵🇱
View GitHub Profile
@MarcinusX
MarcinusX / main.dart
Created Mar 8, 2021
Broken RTL on Web example
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(RtlBrokenApp());
class RtlBrokenApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Padding(
View google_maps_flutter_bug.dart
/// 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';
View air_hockey.dart
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
class AirHockey extends StatefulWidget {
@override
_AirHockeyState createState() => _AirHockeyState();
}
@MarcinusX
MarcinusX / main.dart
Created Mar 21, 2019
Ripple effect transition
View main.dart
import 'package:flutter/material.dart';
import 'package:rect_getter/rect_getter.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fab overlay transition',
View BMI Calculator - height
https://marcinszalek.pl/tag/bmi-calculator/
@MarcinusX
MarcinusX / card_title.dart
Last active Sep 4, 2018
BMI Calculator - Weight
View card_title.dart
import 'package:flutter/material.dart';
const TextStyle _titleStyle = TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w500,
color: Color.fromRGBO(14, 24, 35, 1.0),
);
const TextStyle _subtitleStyle = TextStyle(
fontSize: 8.0,
View setValidationInOfficeJs.ts
public async setValidation(source: Excel.Range, target: Excel.Range) {
Excel.run(function (context) {
return context.sync().then(() => {
target.dataValidation.rule = {
list: {
inCellDropDown: true,
source: source.values.toString(),
}
};
return context.sync();
@MarcinusX
MarcinusX / officeCustomProperties.md
Created Jul 13, 2018
Explanation on sharing custom properties between Office 2013 and Office Online
View officeCustomProperties.md

Office VSTO + jsAPI custom properties manual

Explanation

So far in VSTO we were saving properties separately in every Worksheet. JavaScript API for Office doesn't have such function (as of 13/07/2018). Instead we can save those properties in Workbook's documentProperties which are accessable both in VSTO and JS.

Note: CP means CustomProperties (too long to write every time)

JS (actually TS):

Docs

Loading

There is a bug with loading CP, so in order to load them we have to ensure that the list is not empty:

@MarcinusX
MarcinusX / infinite_listview.dart
Created Apr 16, 2018
This is source code for a blog post.
View infinite_listview.dart
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@MarcinusX
MarcinusX / Sliver AppBar
Created Mar 30, 2018
Sliver AppBar case study created for post on www.marcinszalek.pl
View Sliver AppBar
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Sliver Fab Example',
theme: new ThemeData(