mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Flutter 3.29 beta (#2571)
This commit is contained in:
@@ -63,8 +63,10 @@ class FragmentShadedState extends State<FragmentShaded>
|
||||
parent: _dampenController,
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
_dampenAnimation =
|
||||
Tween<double>(begin: 1.0, end: 0.0).animate(_dampenCurve);
|
||||
_dampenAnimation = Tween<double>(
|
||||
begin: 1.0,
|
||||
end: 0.0,
|
||||
).animate(_dampenCurve);
|
||||
initializeFragmentProgramsAndBuilder();
|
||||
}
|
||||
|
||||
@@ -76,8 +78,11 @@ class FragmentShadedState extends State<FragmentShaded>
|
||||
}
|
||||
|
||||
setState(() {
|
||||
builder = AnimatingSamplerBuilder(_controller, _dampenAnimation,
|
||||
FragmentShaded._programCache[widget.shader]!.fragmentShader());
|
||||
builder = AnimatingSamplerBuilder(
|
||||
_controller,
|
||||
_dampenAnimation,
|
||||
FragmentShaded._programCache[widget.shader]!.fragmentShader(),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -92,17 +97,11 @@ class FragmentShadedState extends State<FragmentShaded>
|
||||
Widget build(BuildContext context) {
|
||||
if (null == FragmentShaded._programCache[widget.shader]) {
|
||||
setState(() {});
|
||||
return const SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
);
|
||||
return const SizedBox(width: 0, height: 0);
|
||||
}
|
||||
return Transform.scale(
|
||||
scale: 0.5,
|
||||
child: ShaderSamplerBuilder(
|
||||
builder,
|
||||
child: widget.child,
|
||||
),
|
||||
child: ShaderSamplerBuilder(builder, child: widget.child),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -113,7 +112,10 @@ class FragmentShadedState extends State<FragmentShaded>
|
||||
|
||||
class AnimatingSamplerBuilder extends SamplerBuilder {
|
||||
AnimatingSamplerBuilder(
|
||||
this.animation, this.dampenAnimation, this.fragmentShader) {
|
||||
this.animation,
|
||||
this.dampenAnimation,
|
||||
this.fragmentShader,
|
||||
) {
|
||||
animation.addListener(notifyListeners);
|
||||
dampenAnimation.addListener(notifyListeners);
|
||||
}
|
||||
@@ -152,11 +154,7 @@ class ShaderSamplerBuilder extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RepaintBoundary(
|
||||
child: _ShaderSamplerImpl(
|
||||
builder,
|
||||
child: child,
|
||||
));
|
||||
return RepaintBoundary(child: _ShaderSamplerImpl(builder, child: child));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +173,9 @@ class _ShaderSamplerImpl extends SingleChildRenderObjectWidget {
|
||||
|
||||
@override
|
||||
void updateRenderObject(
|
||||
BuildContext context, covariant RenderObject renderObject) {
|
||||
BuildContext context,
|
||||
covariant RenderObject renderObject,
|
||||
) {
|
||||
(renderObject as _RenderShaderSamplerBuilderWidget)
|
||||
..devicePixelRatio = MediaQuery.of(context).devicePixelRatio
|
||||
..builder = builder;
|
||||
@@ -189,8 +189,8 @@ class _RenderShaderSamplerBuilderWidget extends RenderProxyBox {
|
||||
_RenderShaderSamplerBuilderWidget({
|
||||
required double devicePixelRatio,
|
||||
required SamplerBuilder builder,
|
||||
}) : _devicePixelRatio = devicePixelRatio,
|
||||
_builder = builder;
|
||||
}) : _devicePixelRatio = devicePixelRatio,
|
||||
_builder = builder;
|
||||
|
||||
/// The device pixel ratio used to create the child image.
|
||||
double get devicePixelRatio => _devicePixelRatio;
|
||||
@@ -250,16 +250,20 @@ class _RenderShaderSamplerBuilderWidget extends RenderProxyBox {
|
||||
// children from this layer.
|
||||
ui.Image? _paintAndDetachToImage() {
|
||||
final OffsetLayer offsetLayer = OffsetLayer();
|
||||
final PaintingContext context =
|
||||
PaintingContext(offsetLayer, Offset.zero & size);
|
||||
final PaintingContext context = PaintingContext(
|
||||
offsetLayer,
|
||||
Offset.zero & size,
|
||||
);
|
||||
super.paint(context, Offset.zero);
|
||||
// This ignore is here because this method is protected by the `PaintingContext`. Adding a new
|
||||
// method that performs the work of `_paintAndDetachToImage` would avoid the need for this, but
|
||||
// that would conflict with our goals of minimizing painting context.
|
||||
// ignore: invalid_use_of_protected_member
|
||||
context.stopRecordingIfNeeded();
|
||||
final ui.Image image = offsetLayer.toImageSync(Offset.zero & size,
|
||||
pixelRatio: devicePixelRatio);
|
||||
final ui.Image image = offsetLayer.toImageSync(
|
||||
Offset.zero & size,
|
||||
pixelRatio: devicePixelRatio,
|
||||
);
|
||||
offsetLayer.dispose();
|
||||
return image;
|
||||
}
|
||||
|
||||
@@ -73,16 +73,16 @@ class _LightboxedPanelState extends State<LightboxedPanel> {
|
||||
return [
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
TextButton(
|
||||
onPressed: handleDismiss,
|
||||
style: ButtonStyles.style(),
|
||||
child: Text(
|
||||
'OK',
|
||||
style: TextStyles.bodyStyle()
|
||||
.copyWith(color: Colors.white, height: 1.2),
|
||||
style: TextStyles.bodyStyle().copyWith(
|
||||
color: Colors.white,
|
||||
height: 1.2,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -111,10 +111,11 @@ class _LightboxedPanelState extends State<LightboxedPanel> {
|
||||
),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(30, 0, 0, 0),
|
||||
offset: Offset.zero,
|
||||
blurRadius: 4.0,
|
||||
spreadRadius: 2.0),
|
||||
color: Color.fromARGB(30, 0, 0, 0),
|
||||
offset: Offset.zero,
|
||||
blurRadius: 4.0,
|
||||
spreadRadius: 2.0,
|
||||
),
|
||||
],
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||
),
|
||||
@@ -123,7 +124,8 @@ class _LightboxedPanelState extends State<LightboxedPanel> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: widget.content +
|
||||
children:
|
||||
widget.content +
|
||||
(widget.buildButton ? buttonComponents() : []),
|
||||
),
|
||||
),
|
||||
@@ -133,9 +135,6 @@ class _LightboxedPanelState extends State<LightboxedPanel> {
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
);
|
||||
return const SizedBox(width: 0, height: 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,17 +55,14 @@ class RotatorPuzzleState extends State<RotatorPuzzle>
|
||||
);
|
||||
late final CurvedAnimation animationCurve = CurvedAnimation(
|
||||
parent: animationController,
|
||||
curve: const Interval(
|
||||
0.2,
|
||||
0.45,
|
||||
curve: Curves.easeOut,
|
||||
),
|
||||
curve: const Interval(0.2, 0.45, curve: Curves.easeOut),
|
||||
);
|
||||
late Animation<double> opacAnimation =
|
||||
Tween<double>(begin: 0.4, end: 1.0).animate(animationCurve)
|
||||
..addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
late Animation<double> opacAnimation = Tween<double>(
|
||||
begin: 0.4,
|
||||
end: 1.0,
|
||||
).animate(animationCurve)..addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
|
||||
List<GlobalKey<RotatorPuzzleTileState>> tileKeys = [];
|
||||
GlobalKey<FragmentShadedState> shadedWidgetStackHackStateKey = GlobalKey();
|
||||
@@ -129,14 +126,16 @@ class RotatorPuzzleState extends State<RotatorPuzzle>
|
||||
}
|
||||
if (status == AnimationStatus.completed) {
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: FragmentShaded.dampenDuration + 250),
|
||||
() {
|
||||
widget.pageConfig.pageController.nextPage(
|
||||
duration:
|
||||
const Duration(milliseconds: PagesFlow.pageScrollDuration),
|
||||
curve: Curves.easeOut,
|
||||
);
|
||||
});
|
||||
const Duration(milliseconds: FragmentShaded.dampenDuration + 250),
|
||||
() {
|
||||
widget.pageConfig.pageController.nextPage(
|
||||
duration: const Duration(
|
||||
milliseconds: PagesFlow.pageScrollDuration,
|
||||
),
|
||||
curve: Curves.easeOut,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
animationController.forward();
|
||||
@@ -201,7 +200,8 @@ class RotatorPuzzleState extends State<RotatorPuzzle>
|
||||
child: Opacity(
|
||||
opacity: opacAnimation.value,
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
children:
|
||||
<Widget>[
|
||||
Positioned(
|
||||
left: -9999,
|
||||
top: -9999,
|
||||
@@ -287,9 +287,7 @@ class RotatorPuzzleTileState extends State<RotatorPuzzleTile>
|
||||
Duration touchedOpacDur = const Duration(milliseconds: 50);
|
||||
late final AnimationController animationController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(
|
||||
milliseconds: 100,
|
||||
),
|
||||
duration: const Duration(milliseconds: 100),
|
||||
);
|
||||
late final CurvedAnimation animationCurve = CurvedAnimation(
|
||||
parent: animationController,
|
||||
@@ -317,9 +315,12 @@ class RotatorPuzzleTileState extends State<RotatorPuzzleTile>
|
||||
}
|
||||
});
|
||||
// end hack ------------------------------
|
||||
List<double> coords =
|
||||
widget.parentState.tileCoords(row: widget.row, col: widget.col);
|
||||
double zeroPoint = widget.parentState.widget.pageConfig.puzzleSize * .5 -
|
||||
List<double> coords = widget.parentState.tileCoords(
|
||||
row: widget.row,
|
||||
col: widget.col,
|
||||
);
|
||||
double zeroPoint =
|
||||
widget.parentState.widget.pageConfig.puzzleSize * .5 -
|
||||
widget.parentState.tileSize() * 0.5;
|
||||
|
||||
return Stack(
|
||||
@@ -386,7 +387,8 @@ class RotatorPuzzleTileState extends State<RotatorPuzzleTile>
|
||||
},
|
||||
child: DecoratedBox(
|
||||
decoration: const BoxDecoration(
|
||||
color: Color.fromARGB(120, 0, 0, 0)),
|
||||
color: Color.fromARGB(120, 0, 0, 0),
|
||||
),
|
||||
child: SizedBox(
|
||||
width: widget.parentState.tileSize(),
|
||||
height: widget.parentState.tileSize(),
|
||||
@@ -420,10 +422,9 @@ class RotatorPuzzleTileState extends State<RotatorPuzzleTile>
|
||||
animation = Tween<double>(
|
||||
begin: oldStatus * pi * 0.5,
|
||||
end: currentStatus() * pi * 0.5,
|
||||
).animate(animationController)
|
||||
..addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
).animate(animationController)..addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
animationController.reset();
|
||||
animationController.forward();
|
||||
}
|
||||
|
||||
@@ -19,9 +19,7 @@ import '../components/components.dart';
|
||||
// an enumeration of variable font axes at https://fonts.google.com/variablefonts
|
||||
|
||||
class WonkyAnimPalette {
|
||||
const WonkyAnimPalette({
|
||||
Key? key,
|
||||
});
|
||||
const WonkyAnimPalette({Key? key});
|
||||
static const Curve defaultCurve = Curves.easeInOut;
|
||||
|
||||
// basic (settings unrelated to variable font)
|
||||
|
||||
@@ -35,18 +35,29 @@ class WonkyCharState extends State<WonkyChar>
|
||||
final List<String> _fvAxes = [];
|
||||
// default curve and animations in case user sets nothing for them
|
||||
late final defaultCurve = CurvedAnimation(
|
||||
parent: _animController,
|
||||
curve: const Interval(0, 1, curve: Curves.linear));
|
||||
late Animation _scaleAnimation =
|
||||
Tween<double>(begin: 1, end: 1).animate(defaultCurve);
|
||||
late Animation _offsetXAnimation =
|
||||
Tween<double>(begin: 0, end: 0).animate(defaultCurve);
|
||||
late Animation _offsetYAnimation =
|
||||
Tween<double>(begin: 0, end: 0).animate(defaultCurve);
|
||||
late Animation _rotationAnimation =
|
||||
Tween<double>(begin: 0, end: 0).animate(defaultCurve);
|
||||
late Animation _colorAnimation =
|
||||
ColorTween(begin: Colors.black, end: Colors.black).animate(defaultCurve);
|
||||
parent: _animController,
|
||||
curve: const Interval(0, 1, curve: Curves.linear),
|
||||
);
|
||||
late Animation _scaleAnimation = Tween<double>(
|
||||
begin: 1,
|
||||
end: 1,
|
||||
).animate(defaultCurve);
|
||||
late Animation _offsetXAnimation = Tween<double>(
|
||||
begin: 0,
|
||||
end: 0,
|
||||
).animate(defaultCurve);
|
||||
late Animation _offsetYAnimation = Tween<double>(
|
||||
begin: 0,
|
||||
end: 0,
|
||||
).animate(defaultCurve);
|
||||
late Animation _rotationAnimation = Tween<double>(
|
||||
begin: 0,
|
||||
end: 0,
|
||||
).animate(defaultCurve);
|
||||
late Animation _colorAnimation = ColorTween(
|
||||
begin: Colors.black,
|
||||
end: Colors.black,
|
||||
).animate(defaultCurve);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -80,15 +91,22 @@ class WonkyCharState extends State<WonkyChar>
|
||||
Widget build(BuildContext context) {
|
||||
List<ui.FontVariation> fontVariations = [];
|
||||
for (int i = 0; i < _fvAxes.length; i++) {
|
||||
fontVariations
|
||||
.add(ui.FontVariation(_fvAxes[i], _fvAnimations[i].value as double));
|
||||
fontVariations.add(
|
||||
ui.FontVariation(_fvAxes[i], _fvAnimations[i].value as double),
|
||||
);
|
||||
}
|
||||
return Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: Matrix4.translationValues(_offsetXAnimation.value as double,
|
||||
_offsetYAnimation.value as double, 0)
|
||||
..scale(_scaleAnimation.value)
|
||||
..rotateZ(widget.baseRotation + (_rotationAnimation.value as double)),
|
||||
transform:
|
||||
Matrix4.translationValues(
|
||||
_offsetXAnimation.value as double,
|
||||
_offsetYAnimation.value as double,
|
||||
0,
|
||||
)
|
||||
..scale(_scaleAnimation.value)
|
||||
..rotateZ(
|
||||
widget.baseRotation + (_rotationAnimation.value as double),
|
||||
),
|
||||
child: IgnorePointer(
|
||||
child: Text(
|
||||
widget.text,
|
||||
@@ -117,14 +135,14 @@ class WonkyCharState extends State<WonkyChar>
|
||||
late Animation animation;
|
||||
if (s.property == 'color') {
|
||||
animation = ColorTween(
|
||||
begin: s.fromTo.fromValue() as Color?,
|
||||
end: s.fromTo.toValue() as Color?)
|
||||
.animate(curve);
|
||||
begin: s.fromTo.fromValue() as Color?,
|
||||
end: s.fromTo.toValue() as Color?,
|
||||
).animate(curve);
|
||||
} else {
|
||||
animation = Tween<double>(
|
||||
begin: s.fromTo.fromValue() as double,
|
||||
end: s.fromTo.toValue() as double)
|
||||
.animate(curve);
|
||||
begin: s.fromTo.fromValue() as double,
|
||||
end: s.fromTo.toValue() as double,
|
||||
).animate(curve);
|
||||
}
|
||||
if (s.type == 'fv') {
|
||||
_fvAxes.add(s.property);
|
||||
@@ -155,7 +173,8 @@ class WonkyCharState extends State<WonkyChar>
|
||||
{
|
||||
if (kDebugMode) {
|
||||
print(
|
||||
'**ERROR** unrecognized property to animate: ${s.property}');
|
||||
'**ERROR** unrecognized property to animate: ${s.property}',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,8 @@ class TypePuzzle extends StatelessWidget {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'Type Jam',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.grey,
|
||||
),
|
||||
home: const Scaffold(
|
||||
appBar: null,
|
||||
body: PagesFlow(),
|
||||
),
|
||||
theme: ThemeData(primarySwatch: Colors.grey),
|
||||
home: const Scaffold(appBar: null, body: PagesFlow()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,7 @@ import '../page_content/pages_flow.dart';
|
||||
import '../styles.dart';
|
||||
|
||||
class PageAscenderDescender extends SinglePage {
|
||||
const PageAscenderDescender({
|
||||
super.key,
|
||||
required super.pageConfig,
|
||||
});
|
||||
const PageAscenderDescender({super.key, required super.pageConfig});
|
||||
@override
|
||||
State<SinglePage> createState() => _PageAscenderDescenderState();
|
||||
}
|
||||
@@ -82,10 +79,7 @@ class _PageAscenderDescenderState extends SinglePageState {
|
||||
to: PageConfig.baseWeight,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
WonkyAnimPalette.descenderDepth(
|
||||
from: -500,
|
||||
to: -138,
|
||||
)
|
||||
WonkyAnimPalette.descenderDepth(from: -500, to: -138),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -126,10 +120,7 @@ class _PageAscenderDescenderState extends SinglePageState {
|
||||
from: PageConfig.baseWeight,
|
||||
to: PageConfig.baseWeight,
|
||||
),
|
||||
WonkyAnimPalette.ascenderHt(
|
||||
from: 600,
|
||||
to: 980,
|
||||
),
|
||||
WonkyAnimPalette.ascenderHt(from: 600, to: 980),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -184,10 +175,7 @@ class _PageAscenderDescenderState extends SinglePageState {
|
||||
from: PageConfig.baseWeight,
|
||||
to: PageConfig.baseWeight,
|
||||
),
|
||||
WonkyAnimPalette.descenderDepth(
|
||||
from: -200,
|
||||
to: -500,
|
||||
)
|
||||
WonkyAnimPalette.descenderDepth(from: -200, to: -500),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -204,10 +192,11 @@ class _PageAscenderDescenderState extends SinglePageState {
|
||||
shaderDuration: 2000,
|
||||
tileShadedString: 'fyd',
|
||||
tileShadedStringPadding: EdgeInsets.only(
|
||||
top: 0.233 * widget.pageConfig.puzzleSize,
|
||||
bottom: 0,
|
||||
left: 0.465 * widget.pageConfig.puzzleSize,
|
||||
right: 0.465 * widget.pageConfig.puzzleSize),
|
||||
top: 0.233 * widget.pageConfig.puzzleSize,
|
||||
bottom: 0,
|
||||
left: 0.465 * widget.pageConfig.puzzleSize,
|
||||
right: 0.465 * widget.pageConfig.puzzleSize,
|
||||
),
|
||||
tileShadedStringSize: 1.86 * widget.pageConfig.puzzleSize,
|
||||
tileScaleModifier: 2.7,
|
||||
tileShadedStringAnimDuration: 2000,
|
||||
|
||||
@@ -8,10 +8,7 @@ import '../page_content/pages_flow.dart';
|
||||
import '../styles.dart';
|
||||
|
||||
class PageNarrativePost extends NarrativePage {
|
||||
const PageNarrativePost({
|
||||
super.key,
|
||||
required super.pageConfig,
|
||||
});
|
||||
const PageNarrativePost({super.key, required super.pageConfig});
|
||||
|
||||
@override
|
||||
State<NarrativePage> createState() => _PageNarrativePostState();
|
||||
@@ -32,12 +29,8 @@ class _PageNarrativePostState extends NarrativePageState {
|
||||
style: TextStyles.bodyStyle(),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
const Image(
|
||||
image: AssetImage('assets/images/specimen-1.png'),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Image(image: AssetImage('assets/images/specimen-1.png')),
|
||||
Text(
|
||||
'As a reward, please enjoy the FontCo wallpapers on the next screen. Congratulations!',
|
||||
style: TextStyles.bodyStyle(),
|
||||
|
||||
@@ -8,10 +8,7 @@ import '../page_content/pages_flow.dart';
|
||||
import '../styles.dart';
|
||||
|
||||
class PageNarrativePre extends NarrativePage {
|
||||
const PageNarrativePre({
|
||||
super.key,
|
||||
required super.pageConfig,
|
||||
});
|
||||
const PageNarrativePre({super.key, required super.pageConfig});
|
||||
|
||||
@override
|
||||
State<NarrativePage> createState() => _PageNarrativePreState();
|
||||
@@ -32,12 +29,8 @@ class _PageNarrativePreState extends NarrativePageState {
|
||||
style: TextStyles.bodyStyle(),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
const Image(
|
||||
image: AssetImage('assets/images/specimen-1.png'),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Image(image: AssetImage('assets/images/specimen-1.png')),
|
||||
],
|
||||
),
|
||||
LightboxedPanel(
|
||||
@@ -58,18 +51,14 @@ class _PageNarrativePreState extends NarrativePageState {
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Transform.scale(
|
||||
scaleX: -1,
|
||||
child: const Image(
|
||||
image: AssetImage('assets/images/specimen-1-glitch.png'),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 56,
|
||||
),
|
||||
const SizedBox(height: 56),
|
||||
],
|
||||
),
|
||||
LightboxedPanel(
|
||||
@@ -93,9 +82,7 @@ class _PageNarrativePreState extends NarrativePageState {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Transform.scale(
|
||||
scaleX: -1,
|
||||
child: Transform.translate(
|
||||
@@ -105,9 +92,7 @@ class _PageNarrativePreState extends NarrativePageState {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 56,
|
||||
),
|
||||
const SizedBox(height: 56),
|
||||
],
|
||||
),
|
||||
LightboxedPanel(
|
||||
@@ -128,18 +113,14 @@ class _PageNarrativePreState extends NarrativePageState {
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Transform.scale(
|
||||
scaleX: -1,
|
||||
child: const Image(
|
||||
image: AssetImage('assets/images/specimen-1-glitch.png'),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 56,
|
||||
),
|
||||
const SizedBox(height: 56),
|
||||
],
|
||||
),
|
||||
LightboxedPanel(
|
||||
@@ -153,12 +134,8 @@ class _PageNarrativePreState extends NarrativePageState {
|
||||
style: TextStyles.bodyStyle(),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
const Image(
|
||||
image: AssetImage('assets/images/specimen-2.png'),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Image(image: AssetImage('assets/images/specimen-2.png')),
|
||||
],
|
||||
),
|
||||
];
|
||||
|
||||
@@ -11,10 +11,7 @@ import '../page_content/pages_flow.dart';
|
||||
import '../styles.dart';
|
||||
|
||||
class PageOpticalSize extends SinglePage {
|
||||
const PageOpticalSize({
|
||||
super.key,
|
||||
required super.pageConfig,
|
||||
});
|
||||
const PageOpticalSize({super.key, required super.pageConfig});
|
||||
|
||||
@override
|
||||
State<SinglePage> createState() => _PageOpticalSizeState();
|
||||
@@ -60,10 +57,7 @@ class _PageOpticalSizeState extends SinglePageState {
|
||||
to: PageConfig.baseWeight,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
WonkyAnimPalette.opticalSize(
|
||||
from: 70,
|
||||
to: 144,
|
||||
)
|
||||
WonkyAnimPalette.opticalSize(from: 70, to: 144),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -81,10 +75,7 @@ class _PageOpticalSizeState extends SinglePageState {
|
||||
to: PageConfig.baseWeight,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
WonkyAnimPalette.opticalSize(
|
||||
from: 78,
|
||||
to: 8,
|
||||
),
|
||||
WonkyAnimPalette.opticalSize(from: 78, to: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -95,12 +86,7 @@ class _PageOpticalSizeState extends SinglePageState {
|
||||
text: 'r',
|
||||
size: widget.pageConfig.wonkyCharSmallSize,
|
||||
baseRotation: -0.15 * pi,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.opticalSize(
|
||||
from: 32,
|
||||
to: 106,
|
||||
)
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.opticalSize(from: 32, to: 106)],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -111,12 +97,7 @@ class _PageOpticalSizeState extends SinglePageState {
|
||||
size: widget.pageConfig.wonkyCharLargeSize,
|
||||
baseRotation: -0.15 * pi,
|
||||
animDurationMillis: 5000,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.opticalSize(
|
||||
from: 70,
|
||||
to: 144,
|
||||
)
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.opticalSize(from: 70, to: 144)],
|
||||
),
|
||||
),
|
||||
// lower half --------------------------------------
|
||||
@@ -127,12 +108,7 @@ class _PageOpticalSizeState extends SinglePageState {
|
||||
text: 'i',
|
||||
size: widget.pageConfig.wonkyCharLargeSize,
|
||||
baseRotation: -0.04 * pi,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.opticalSize(
|
||||
from: 40,
|
||||
to: 8,
|
||||
),
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.opticalSize(from: 40, to: 8)],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -142,12 +118,7 @@ class _PageOpticalSizeState extends SinglePageState {
|
||||
text: 'Z',
|
||||
size: widget.pageConfig.wonkyCharSmallSize,
|
||||
baseRotation: -0.15 * pi,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.opticalSize(
|
||||
from: 8,
|
||||
to: 60,
|
||||
),
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.opticalSize(from: 8, to: 60)],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -159,14 +130,8 @@ class _PageOpticalSizeState extends SinglePageState {
|
||||
baseRotation: 0.15 * pi,
|
||||
animDurationMillis: 12000,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.opticalSize(
|
||||
from: 80,
|
||||
to: 20,
|
||||
),
|
||||
WonkyAnimPalette.rotation(
|
||||
from: -0.01 * pi,
|
||||
to: 0.01 * pi,
|
||||
),
|
||||
WonkyAnimPalette.opticalSize(from: 80, to: 20),
|
||||
WonkyAnimPalette.rotation(from: -0.01 * pi, to: 0.01 * pi),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -182,15 +147,16 @@ class _PageOpticalSizeState extends SinglePageState {
|
||||
shader: Shader.wavy,
|
||||
shaderDuration: 5000,
|
||||
tileShadedString: 'Z',
|
||||
tileShadedStringPadding:
|
||||
EdgeInsets.only(bottom: 0.349 * widget.pageConfig.puzzleSize),
|
||||
tileShadedStringPadding: EdgeInsets.only(
|
||||
bottom: 0.349 * widget.pageConfig.puzzleSize,
|
||||
),
|
||||
tileScaleModifier: 2.6,
|
||||
tileShadedStringSize: 2.79 * widget.pageConfig.puzzleSize,
|
||||
tileShadedStringAnimDuration: 3000,
|
||||
tileShadedStringAnimSettings: [
|
||||
WonkyAnimPalette.weight(from: 1000, to: 1000),
|
||||
WonkyAnimPalette.width(from: 125, to: 125),
|
||||
WonkyAnimPalette.opticalSize(from: 8, to: 144)
|
||||
WonkyAnimPalette.opticalSize(from: 8, to: 144),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,10 +11,7 @@ import '../page_content/pages_flow.dart';
|
||||
import '../styles.dart';
|
||||
|
||||
class PageWeight extends SinglePage {
|
||||
const PageWeight({
|
||||
super.key,
|
||||
required super.pageConfig,
|
||||
});
|
||||
const PageWeight({super.key, required super.pageConfig});
|
||||
|
||||
@override
|
||||
State<SinglePage> createState() => _PageWeightState();
|
||||
@@ -88,12 +85,7 @@ class _PageWeightState extends SinglePageState {
|
||||
size: widget.pageConfig.wonkyCharLargeSize,
|
||||
baseRotation: -0.15 * pi,
|
||||
animDurationMillis: 5000,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.weight(
|
||||
from: 200,
|
||||
to: 500,
|
||||
),
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.weight(from: 200, to: 500)],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -103,12 +95,7 @@ class _PageWeightState extends SinglePageState {
|
||||
text: '*',
|
||||
size: widget.pageConfig.wonkyCharSmallSize,
|
||||
baseRotation: -0.15 * pi,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.weight(
|
||||
from: 100,
|
||||
to: 400,
|
||||
),
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.weight(from: 100, to: 400)],
|
||||
),
|
||||
),
|
||||
// lower half --------------------------------------
|
||||
@@ -120,12 +107,7 @@ class _PageWeightState extends SinglePageState {
|
||||
size: widget.pageConfig.wonkyCharLargeSize,
|
||||
baseRotation: -0.15 * pi,
|
||||
animDurationMillis: 7000,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.weight(
|
||||
from: 1000,
|
||||
to: 700,
|
||||
),
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.weight(from: 1000, to: 700)],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -136,12 +118,7 @@ class _PageWeightState extends SinglePageState {
|
||||
size: widget.pageConfig.wonkyCharSmallSize,
|
||||
baseRotation: -0.15 * pi,
|
||||
animDurationMillis: 4000,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.weight(
|
||||
from: 100,
|
||||
to: 200,
|
||||
),
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.weight(from: 100, to: 200)],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -152,12 +129,7 @@ class _PageWeightState extends SinglePageState {
|
||||
size: widget.pageConfig.wonkyCharLargeSize,
|
||||
baseRotation: -1.15 * pi,
|
||||
animDurationMillis: 2000,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.weight(
|
||||
from: 700,
|
||||
to: 900,
|
||||
),
|
||||
],
|
||||
animationSettings: [WonkyAnimPalette.weight(from: 700, to: 900)],
|
||||
),
|
||||
),
|
||||
];
|
||||
@@ -173,8 +145,9 @@ class _PageWeightState extends SinglePageState {
|
||||
shaderDuration: 3000,
|
||||
tileShadedString: 'W',
|
||||
tileShadedStringPadding: EdgeInsets.only(
|
||||
left: 0.698 * widget.pageConfig.puzzleSize,
|
||||
right: 0.698 * widget.pageConfig.puzzleSize),
|
||||
left: 0.698 * widget.pageConfig.puzzleSize,
|
||||
right: 0.698 * widget.pageConfig.puzzleSize,
|
||||
),
|
||||
tileShadedStringSize: 2.79 * widget.pageConfig.puzzleSize,
|
||||
tileScaleModifier: 2.4,
|
||||
tileShadedStringAnimDuration: 1000,
|
||||
|
||||
@@ -11,10 +11,7 @@ import '../page_content/pages_flow.dart';
|
||||
import '../styles.dart';
|
||||
|
||||
class PageWidth extends SinglePage {
|
||||
const PageWidth({
|
||||
super.key,
|
||||
required super.pageConfig,
|
||||
});
|
||||
const PageWidth({super.key, required super.pageConfig});
|
||||
@override
|
||||
State<SinglePage> createState() => _PageWidthState();
|
||||
}
|
||||
@@ -56,10 +53,7 @@ class _PageWidthState extends SinglePageState {
|
||||
from: PageConfig.baseWeight,
|
||||
to: PageConfig.baseWeight,
|
||||
),
|
||||
WonkyAnimPalette.width(
|
||||
from: 120,
|
||||
to: 125,
|
||||
)
|
||||
WonkyAnimPalette.width(from: 120, to: 125),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -77,19 +71,9 @@ class _PageWidthState extends SinglePageState {
|
||||
to: PageConfig.baseWeight,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
WonkyAnimPalette.width(
|
||||
from: 70,
|
||||
to: 50,
|
||||
),
|
||||
WonkyAnimPalette.offsetY(
|
||||
from: -6,
|
||||
to: 2,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
WonkyAnimPalette.rotation(
|
||||
from: -0.04 * pi,
|
||||
to: 0.005 * pi,
|
||||
),
|
||||
WonkyAnimPalette.width(from: 70, to: 50),
|
||||
WonkyAnimPalette.offsetY(from: -6, to: 2, curve: Curves.easeInOut),
|
||||
WonkyAnimPalette.rotation(from: -0.04 * pi, to: 0.005 * pi),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -102,10 +86,7 @@ class _PageWidthState extends SinglePageState {
|
||||
baseRotation: 0.15 * pi,
|
||||
animDurationMillis: 3200,
|
||||
animationSettings: [
|
||||
WonkyAnimPalette.width(
|
||||
from: 120,
|
||||
to: 125,
|
||||
),
|
||||
WonkyAnimPalette.width(from: 120, to: 125),
|
||||
WonkyAnimPalette.weight(
|
||||
from: PageConfig.baseWeight,
|
||||
to: PageConfig.baseWeight,
|
||||
@@ -128,10 +109,7 @@ class _PageWidthState extends SinglePageState {
|
||||
from: PageConfig.baseWeight,
|
||||
to: PageConfig.baseWeight,
|
||||
),
|
||||
WonkyAnimPalette.width(
|
||||
from: 75,
|
||||
to: 50,
|
||||
),
|
||||
WonkyAnimPalette.width(from: 75, to: 50),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -147,10 +125,7 @@ class _PageWidthState extends SinglePageState {
|
||||
from: PageConfig.baseWeight,
|
||||
to: PageConfig.baseWeight,
|
||||
),
|
||||
WonkyAnimPalette.width(
|
||||
from: 90,
|
||||
to: 115,
|
||||
)
|
||||
WonkyAnimPalette.width(from: 90, to: 115),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -167,12 +142,7 @@ class _PageWidthState extends SinglePageState {
|
||||
from: PageConfig.baseWeight,
|
||||
to: PageConfig.baseWeight,
|
||||
),
|
||||
WonkyAnimPalette.width(
|
||||
from: 125,
|
||||
to: 90,
|
||||
startAt: 0.3,
|
||||
endAt: 0.7,
|
||||
),
|
||||
WonkyAnimPalette.width(from: 125, to: 90, startAt: 0.3, endAt: 0.7),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -188,10 +158,7 @@ class _PageWidthState extends SinglePageState {
|
||||
from: PageConfig.baseWeight,
|
||||
to: PageConfig.baseWeight,
|
||||
),
|
||||
WonkyAnimPalette.width(
|
||||
from: 110,
|
||||
to: 60,
|
||||
)
|
||||
WonkyAnimPalette.width(from: 110, to: 60),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -208,8 +175,9 @@ class _PageWidthState extends SinglePageState {
|
||||
shaderDuration: 2000,
|
||||
tileShadedString: 'S',
|
||||
tileShadedStringPadding: EdgeInsets.only(
|
||||
left: 0.349 * widget.pageConfig.puzzleSize,
|
||||
right: 0.349 * widget.pageConfig.puzzleSize),
|
||||
left: 0.349 * widget.pageConfig.puzzleSize,
|
||||
right: 0.349 * widget.pageConfig.puzzleSize,
|
||||
),
|
||||
tileShadedStringSize: 3.256 * widget.pageConfig.puzzleSize,
|
||||
tileScaleModifier: 2.34,
|
||||
tileShadedStringAnimDuration: 2000,
|
||||
|
||||
@@ -47,24 +47,12 @@ class _PagesFlowState extends State<PagesFlow> {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
scrollDirection: Axis.vertical,
|
||||
children: [
|
||||
PageNarrativePre(
|
||||
pageConfig: pageConfig,
|
||||
),
|
||||
PageWeight(
|
||||
pageConfig: pageConfig,
|
||||
),
|
||||
PageAscenderDescender(
|
||||
pageConfig: pageConfig,
|
||||
),
|
||||
PageOpticalSize(
|
||||
pageConfig: pageConfig,
|
||||
),
|
||||
PageWidth(
|
||||
pageConfig: pageConfig,
|
||||
),
|
||||
PageNarrativePost(
|
||||
pageConfig: pageConfig,
|
||||
),
|
||||
PageNarrativePre(pageConfig: pageConfig),
|
||||
PageWeight(pageConfig: pageConfig),
|
||||
PageAscenderDescender(pageConfig: pageConfig),
|
||||
PageOpticalSize(pageConfig: pageConfig),
|
||||
PageWidth(pageConfig: pageConfig),
|
||||
PageNarrativePost(pageConfig: pageConfig),
|
||||
const WallpapersFlow(),
|
||||
],
|
||||
);
|
||||
@@ -94,10 +82,7 @@ class PageConfig {
|
||||
|
||||
class SinglePage extends StatefulWidget {
|
||||
final PageConfig pageConfig;
|
||||
const SinglePage({
|
||||
super.key,
|
||||
required this.pageConfig,
|
||||
});
|
||||
const SinglePage({super.key, required this.pageConfig});
|
||||
|
||||
@override
|
||||
State<SinglePage> createState() => SinglePageState();
|
||||
@@ -113,10 +98,7 @@ class SinglePageState extends State<SinglePage> with TickerProviderStateMixin {
|
||||
}
|
||||
|
||||
Widget createTopicIntro() {
|
||||
return LightboxedPanel(
|
||||
pageConfig: widget.pageConfig,
|
||||
content: const [],
|
||||
);
|
||||
return LightboxedPanel(pageConfig: widget.pageConfig, content: const []);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -125,9 +107,7 @@ class SinglePageState extends State<SinglePage> with TickerProviderStateMixin {
|
||||
c.add(createPuzzle());
|
||||
c += buildWonkyChars();
|
||||
c.add(createTopicIntro());
|
||||
return Stack(
|
||||
children: c,
|
||||
);
|
||||
return Stack(children: c);
|
||||
}
|
||||
|
||||
void puzzleDone() {}
|
||||
@@ -135,10 +115,7 @@ class SinglePageState extends State<SinglePage> with TickerProviderStateMixin {
|
||||
|
||||
class NarrativePage extends StatefulWidget {
|
||||
final PageConfig pageConfig;
|
||||
const NarrativePage({
|
||||
super.key,
|
||||
required this.pageConfig,
|
||||
});
|
||||
const NarrativePage({super.key, required this.pageConfig});
|
||||
|
||||
@override
|
||||
State<NarrativePage> createState() => NarrativePageState();
|
||||
@@ -154,8 +131,9 @@ class NarrativePageState extends State<NarrativePage>
|
||||
setState(() {
|
||||
if (panelIndex == panels.length - 1) {
|
||||
widget.pageConfig.pageController.nextPage(
|
||||
duration:
|
||||
const Duration(milliseconds: PagesFlow.pageScrollDuration),
|
||||
duration: const Duration(
|
||||
milliseconds: PagesFlow.pageScrollDuration,
|
||||
),
|
||||
curve: Curves.easeOut,
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -18,18 +18,18 @@ class _WallpapersFlowState extends State<WallpapersFlow> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
LicenseRegistry.addLicense(() => Stream<LicenseEntry>.value(
|
||||
LicenseEntryWithLineBreaks(
|
||||
<String>['roboto_font'],
|
||||
robotoLicense,
|
||||
),
|
||||
));
|
||||
LicenseRegistry.addLicense(() => Stream<LicenseEntry>.value(
|
||||
LicenseEntryWithLineBreaks(
|
||||
<String>['amstelvar_font'],
|
||||
amstelvarLicense,
|
||||
),
|
||||
));
|
||||
LicenseRegistry.addLicense(
|
||||
() => Stream<LicenseEntry>.value(
|
||||
LicenseEntryWithLineBreaks(<String>['roboto_font'], robotoLicense),
|
||||
),
|
||||
);
|
||||
LicenseRegistry.addLicense(
|
||||
() => Stream<LicenseEntry>.value(
|
||||
LicenseEntryWithLineBreaks(<String>[
|
||||
'amstelvar_font',
|
||||
], amstelvarLicense),
|
||||
),
|
||||
);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -45,9 +45,7 @@ class _WallpapersFlowState extends State<WallpapersFlow> {
|
||||
},
|
||||
children: const [
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black,
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.black),
|
||||
child: Center(
|
||||
child: Image(
|
||||
image: AssetImage('assets/images/wallpaper3.png'),
|
||||
@@ -56,9 +54,7 @@ class _WallpapersFlowState extends State<WallpapersFlow> {
|
||||
),
|
||||
),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black,
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.black),
|
||||
child: Center(
|
||||
child: Image(
|
||||
image: AssetImage('assets/images/wallpaper1.png'),
|
||||
@@ -67,9 +63,7 @@ class _WallpapersFlowState extends State<WallpapersFlow> {
|
||||
),
|
||||
),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black,
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.black),
|
||||
child: Center(
|
||||
child: Image(
|
||||
image: AssetImage('assets/images/wallpaper2.png'),
|
||||
@@ -107,9 +101,10 @@ class _WallpapersFlowState extends State<WallpapersFlow> {
|
||||
List<Widget> _buildScrollDots() {
|
||||
List<Widget> dots = [];
|
||||
for (int i = 0; i < numPages; i++) {
|
||||
Color dotColor = i == pageNum
|
||||
? const Color.fromARGB(255, 255, 255, 255)
|
||||
: const Color.fromARGB(255, 105, 105, 105);
|
||||
Color dotColor =
|
||||
i == pageNum
|
||||
? const Color.fromARGB(255, 255, 255, 255)
|
||||
: const Color.fromARGB(255, 105, 105, 105);
|
||||
Widget d = Container(
|
||||
width: 16,
|
||||
height: 16,
|
||||
|
||||
@@ -36,7 +36,8 @@ class ButtonStyles {
|
||||
}),
|
||||
shape: WidgetStateProperty.resolveWith<OutlinedBorder>((states) {
|
||||
return const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(18)));
|
||||
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||
);
|
||||
}),
|
||||
overlayColor: null,
|
||||
backgroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
|
||||
|
||||
@@ -4,7 +4,7 @@ publish_to: 'none'
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ^3.5.0
|
||||
sdk: ^3.7.0-0
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
||||
Reference in New Issue
Block a user