mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-24 16:30:40 +00:00
Compare commits
6 commits
8cf5d38c37
...
1b508ca894
Author | SHA1 | Date | |
---|---|---|---|
|
1b508ca894 | ||
|
60323f4856 | ||
|
cb6880da49 | ||
|
d6fa69400a | ||
|
a2b4c88256 | ||
|
d09542cede |
3 changed files with 35 additions and 10 deletions
|
@ -47,7 +47,7 @@
|
||||||
"film": "Film",
|
"film": "Film",
|
||||||
"filmPush": "Film (push)",
|
"filmPush": "Film (push)",
|
||||||
"filmPull": "Film (pull)",
|
"filmPull": "Film (pull)",
|
||||||
"filmReciprocityHint": "Applies correction for shutter speeds grater than 1 second",
|
"filmReciprocityHint": "Applies correction for shutter speeds greater than 1 second",
|
||||||
"equipmentProfileName": "Equipment profile name",
|
"equipmentProfileName": "Equipment profile name",
|
||||||
"equipmentProfileNameHint": "Praktica MTL5B",
|
"equipmentProfileNameHint": "Praktica MTL5B",
|
||||||
"equipmentProfileAllValues": "All",
|
"equipmentProfileAllValues": "All",
|
||||||
|
|
|
@ -191,7 +191,6 @@ class AnimatedDialogState extends State<AnimatedDialog> with SingleTickerProvide
|
||||||
onDismiss: close,
|
onDismiss: close,
|
||||||
builder: widget.closedChild != null && widget.openedChild != null
|
builder: widget.closedChild != null && widget.openedChild != null
|
||||||
? (_) => _AnimatedSwitcher(
|
? (_) => _AnimatedSwitcher(
|
||||||
sizeAnimation: _sizeAnimation,
|
|
||||||
closedOpacityAnimation: _closedOpacityAnimation,
|
closedOpacityAnimation: _closedOpacityAnimation,
|
||||||
openedOpacityAnimation: _openedOpacityAnimation,
|
openedOpacityAnimation: _openedOpacityAnimation,
|
||||||
closedSize: _sizeTween.begin!,
|
closedSize: _sizeTween.begin!,
|
||||||
|
@ -291,7 +290,6 @@ class _AnimatedOverlay extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AnimatedSwitcher extends StatelessWidget {
|
class _AnimatedSwitcher extends StatelessWidget {
|
||||||
final Animation<Size?> sizeAnimation;
|
|
||||||
final Animation<double> closedOpacityAnimation;
|
final Animation<double> closedOpacityAnimation;
|
||||||
final Animation<double> openedOpacityAnimation;
|
final Animation<double> openedOpacityAnimation;
|
||||||
final Size closedSize;
|
final Size closedSize;
|
||||||
|
@ -300,7 +298,6 @@ class _AnimatedSwitcher extends StatelessWidget {
|
||||||
final Widget openedChild;
|
final Widget openedChild;
|
||||||
|
|
||||||
const _AnimatedSwitcher({
|
const _AnimatedSwitcher({
|
||||||
required this.sizeAnimation,
|
|
||||||
required this.closedOpacityAnimation,
|
required this.closedOpacityAnimation,
|
||||||
required this.openedOpacityAnimation,
|
required this.openedOpacityAnimation,
|
||||||
required this.closedSize,
|
required this.closedSize,
|
||||||
|
@ -316,17 +313,21 @@ class _AnimatedSwitcher extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
Opacity(
|
Opacity(
|
||||||
opacity: closedOpacityAnimation.value,
|
opacity: closedOpacityAnimation.value,
|
||||||
child: Transform.scale(
|
child: FittedBox(
|
||||||
scale: sizeAnimation.value!.width / closedSize.width,
|
child: SizedBox.fromSize(
|
||||||
child: SizedBox(
|
size: closedSize,
|
||||||
width: closedSize.width,
|
|
||||||
child: closedChild,
|
child: closedChild,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Opacity(
|
Opacity(
|
||||||
opacity: openedOpacityAnimation.value,
|
opacity: openedOpacityAnimation.value,
|
||||||
child: openedChild,
|
child: FittedBox(
|
||||||
|
child: SizedBox.fromSize(
|
||||||
|
size: openedSize,
|
||||||
|
child: openedChild,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
24
test/utils/ev_from_bytes_test.dart
Normal file
24
test/utils/ev_from_bytes_test.dart
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:lightmeter/utils/ev_from_bytes.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
group('evFromImage', () {
|
||||||
|
test(
|
||||||
|
'camera_stub_image.jpg',
|
||||||
|
() {
|
||||||
|
final bytes = File('assets/camera_stub_image.jpg').readAsBytesSync();
|
||||||
|
expectLater(evFromImage(bytes), completion(8.25230310752341));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
test(
|
||||||
|
'no EXIF',
|
||||||
|
() {
|
||||||
|
final bytes = File('assets/launcher_icon_dev_512.png').readAsBytesSync();
|
||||||
|
expectLater(evFromImage(bytes), completion(null));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in a new issue