quid_faciam_hodie/lib/widgets/today_photo_button.dart
2022-08-13 20:32:03 +02:00

50 lines
1.2 KiB
Dart

import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:share_location/constants/spacing.dart';
import 'package:share_location/enums.dart';
import 'package:share_location/screens/timeline_screen.dart';
import 'raw_memory_display.dart';
class TodayPhotoButton extends StatelessWidget {
final Uint8List? data;
final MemoryType? type;
const TodayPhotoButton({
Key? key,
this.data,
this.type,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.pushNamed(context, TimelineScreen.ID);
},
child: Container(
width: 45,
height: 45,
decoration: BoxDecoration(
border: Border.all(
color: Colors.white,
width: 2,
),
borderRadius: BorderRadius.circular(SMALL_SPACE),
color: Colors.grey,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(SMALL_SPACE),
child: (data == null || type == null)
? const SizedBox()
: RawMemoryDisplay(
data: data!,
type: type!,
),
),
),
);
}
}