2023-04-21 21:03:42 +03:00
|
|
|
import 'package:cake_wallet/entities/qr_view_data.dart';
|
2023-08-17 12:28:31 -03:00
|
|
|
import 'package:cake_wallet/src/widgets/gradient_background.dart';
|
2022-06-23 11:25:00 +02:00
|
|
|
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
2023-08-17 12:28:31 -03:00
|
|
|
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
|
2022-06-23 11:25:00 +02:00
|
|
|
|
|
|
|
class FullscreenQRPage extends BasePage {
|
2023-04-21 21:03:42 +03:00
|
|
|
FullscreenQRPage({required this.qrViewData});
|
2022-06-23 11:25:00 +02:00
|
|
|
|
2023-04-21 21:03:42 +03:00
|
|
|
final QrViewData qrViewData;
|
2022-06-23 11:25:00 +02:00
|
|
|
|
|
|
|
@override
|
2023-08-17 12:28:31 -03:00
|
|
|
bool get gradientBackground => true;
|
2022-06-23 11:25:00 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool get resizeToAvoidBottomInset => false;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget leading(BuildContext context) {
|
|
|
|
final _backButton = Icon(
|
|
|
|
Icons.arrow_back_ios,
|
2023-08-17 12:28:31 -03:00
|
|
|
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
|
2022-06-23 11:25:00 +02:00
|
|
|
size: 16,
|
|
|
|
);
|
|
|
|
|
|
|
|
return SizedBox(
|
|
|
|
height: 37,
|
|
|
|
width: 37,
|
|
|
|
child: ButtonTheme(
|
|
|
|
minWidth: double.minPositive,
|
2022-10-12 13:09:57 -04:00
|
|
|
child: TextButton(
|
|
|
|
// FIX-ME: Style
|
|
|
|
//highlightColor: Colors.transparent,
|
|
|
|
//splashColor: Colors.transparent,
|
|
|
|
//padding: EdgeInsets.all(0),
|
2022-06-23 11:25:00 +02:00
|
|
|
onPressed: () => onClose(context),
|
|
|
|
child: _backButton,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2023-08-17 12:28:31 -03:00
|
|
|
Widget Function(BuildContext, Widget) get rootWrapper =>
|
|
|
|
(BuildContext context, Widget scaffold) =>
|
|
|
|
GradientBackground(scaffold: scaffold);
|
2022-06-23 11:25:00 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget body(BuildContext context) {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: MediaQuery.of(context).size.width * 0.05),
|
|
|
|
child: Hero(
|
2023-04-21 21:03:42 +03:00
|
|
|
tag: Key(qrViewData.heroTag ?? qrViewData.data),
|
2022-06-23 11:25:00 +02:00
|
|
|
child: Center(
|
|
|
|
child: AspectRatio(
|
|
|
|
aspectRatio: 1.0,
|
|
|
|
child: Container(
|
2023-01-31 17:31:42 +02:00
|
|
|
padding: EdgeInsets.all(10),
|
2022-06-23 11:25:00 +02:00
|
|
|
decoration: BoxDecoration(
|
2023-05-24 20:19:51 -03:00
|
|
|
border: Border.all(
|
|
|
|
width: 3,
|
2023-08-17 12:28:31 -03:00
|
|
|
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
|
2023-05-08 23:30:14 +03:00
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(width: 3, color: Colors.white)),
|
|
|
|
child: QrImage(data: qrViewData.data, version: qrViewData.version)),
|
2022-06-23 11:25:00 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|