Stumbled upon this, the code at the bottom compiles, but there is no output, when I was thinking it might output something like >> list 123, 456
Was looking for a shorthand to
final cb = callback;
if (cb != null) {
cb(['123','456']);
}
Stumbled upon this, the code at the bottom compiles, but there is no output, when I was thinking it might output something like >> list 123, 456
Was looking for a shorthand to
final cb = callback;
if (cb != null) {
cb(['123','456']);
}
// MIT License | |
// | |
// Copyright (c) 2025 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
// MIT License | |
// | |
// Copyright (c) 2024 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
/// 3D tile wip | |
/// Fixme: proper tap/hover area | |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
const MaterialApp( |
/// Reference (https://github.com/FilledStacks/markdown_fade_bounty/pull/6) | |
/// This widget, `FadeRevealMarkdownDifference`, is designed to display a series of markdown versions, | |
/// highlighting the differences between them. The issue being encountered is that the `previousText` is | |
/// currently showing a pulse animation, which is not required or expected behavior. The pulse effect | |
/// should only apply to the newly added portion of the text (`newText`). The goal is to have `previousText` | |
/// remain static while only the new changes (`newText`) fade in or animate. | |
/// | |
/// The expected behavior is for `previousText` to remain static and unanimated, and only `newText` | |
/// should be subject to the fade-in effect. | |
/// |
// Please solve this one. | |
// | |
// If I tap on any one of the eight areas app navigate to “PageTwo()” | |
// | |
// If I tap on four of the areas simultaneous | |
// (I use four fingers to tap with), I want to navigate the “SecretPage()“. | |
// | |
// Lets pick “One”, “Two”, “Five” and “Six” as the as the secrete tap areas. | |
import 'package:flutter/foundation.dart'; |
// MIT License | |
// | |
// Copyright (c) 2022 Fré Dumazy & Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() => runApp(const ExampleApp()); | |
class ExampleApp extends StatelessWidget { | |
const ExampleApp({super.key}); | |
@override | |
Widget build(BuildContext context) { |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
Scrollable( | |
axisDirection: AxisDirection.right, | |
controller: _pageController, | |
physics: const PageScrollPhysics(parent: ClampingScrollPhysics()), | |
viewportBuilder: (BuildContext context, ViewportOffset offset) { | |
return LayoutBuilder( | |
builder: (context, constraints) { | |
offset.applyViewportDimension(constraints.maxWidth); | |
offset.applyContentDimensions(0.0, constraints.maxWidth); | |
return AnimatedBuilder( |