Skip to content

Instantly share code, notes, and snippets.

View slightfoot's full-sized avatar
💙
Fluttering

Simon Lightfoot slightfoot

💙
Fluttering
View GitHub Profile
@slightfoot
slightfoot / utils.dart
Created February 21, 2018 11:53
FadeRoute
class FadeRoute<T> extends MaterialPageRoute<T> {
final bool fadeInitialRoute;
FadeRoute({ builder, settings, maintainState, fullscreenDialog, this.fadeInitialRoute = true})
: super(builder: builder, settings: settings, maintainState: maintainState, fullscreenDialog: fullscreenDialog);
@override
bool get opaque => false;
@override
@slightfoot
slightfoot / main_using_fontsize.dart
Last active February 10, 2024 05:02 — forked from branflake2267/main.dart
Flutter - Flutter - Auto Scaling the Text Size
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@slightfoot
slightfoot / myapp.dart
Last active April 24, 2018 15:09 — forked from mtellect/myapp.dart
For @mtellect on Flutter Gitter chat.
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
const List<TabItem> TabItems = const <TabItem>[
const TabItem(title: 'Home', icon: Icons.home),
const TabItem(title: 'Gallery', icon: Icons.image),
const TabItem(title: 'Settings', icon: Icons.settings)
];
class MyApp extends StatefulWidget {
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
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(
@slightfoot
slightfoot / main.dart
Last active March 11, 2024 22:12 — forked from rapPayne/main.dart
Flutter responsive scrolling
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@slightfoot
slightfoot / humpday_2024-06-12_1.dart
Last active June 12, 2024 21:29 — forked from austinstoker/main.dart
Force Intrinsics - by Simon Lightfoot - Humpday Q&A :: 12th June 2024 #Flutter #Dart - https://www.youtube.com/watch?v=QBmqKvw_0s8
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) {
@slightfoot
slightfoot / main.dart
Last active October 23, 2024 18:30 — forked from dumazy/main.dart
Updating PopScope based on inner Navigator
// 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:
@slightfoot
slightfoot / main.dart
Last active November 6, 2024 19:42 — forked from JohanScheepers/main.dart
SecretPage page tap - solved by Simon Lightfoot on #HumpdayQandA - 6th November 2024 :: https://www.youtube.com/watch?v=txmWGhgPKuU
// 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';
@slightfoot
slightfoot / main.dart
Last active November 6, 2024 19:52 — forked from mg3994/main.dart
Fade animation for newly added text chunks - solved by Simon Lightfoot on #HumpdayQandA - 6th November 2024 :: https://www.youtube.com/watch?v=txmWGhgPKuU
/// 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.
///