passo_mobile_app/lib/screens/sos/components/sos_received.dart

133 lines
4.5 KiB
Dart
Raw Permalink Normal View History

2023-04-11 06:08:10 +00:00
import 'package:animate_do/animate_do.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_svg/svg.dart';
import 'package:unit2/theme-data.dart/btn-style.dart';
import 'package:unit2/utils/text_container.dart';
import '../../../theme-data.dart/colors.dart';
import '../../../utils/global.dart';
class SOSreceived extends StatelessWidget {
2023-04-13 08:45:19 +00:00
final Function() onpressed;
2024-07-11 01:27:35 +00:00
const SOSreceived({super.key, required this.onpressed});
2023-04-11 06:08:10 +00:00
@override
Widget build(BuildContext context) {
2024-07-11 01:27:35 +00:00
return Container(
padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 35),
height: screenHeight,
child: Stack(
children: [
Positioned(
bottom: 0,
child: SizedBox(
width: screenWidth,
height: screenHeight / 2,
child: Opacity(
opacity: .2,
child: Image.asset(
"assets/pngs/emergency.png",
fit: BoxFit.cover,
2023-04-11 06:08:10 +00:00
),
),
2024-07-11 01:27:35 +00:00
)),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: blockSizeVertical * 6,
),
Bounce(
from: 20,
infinite: true,
delay: const Duration(milliseconds: 800),
child: Stack(
alignment: AlignmentDirectional.topCenter,
children: [
Container(
margin: const EdgeInsets.only(top: 20),
child: CircleAvatar(
radius: blockSizeVertical * 8,
backgroundColor: second,
child: Container(
margin: const EdgeInsets.only(top: 25),
child: SvgPicture.asset(
'assets/svgs/sos.svg',
height: blockSizeHorizontal * 17,
color: Colors.white,
allowDrawingOutsideViewBox: true,
alignment: Alignment.bottomCenter,
2023-04-11 06:08:10 +00:00
),
),
),
2024-07-11 01:27:35 +00:00
),
Positioned(
top: blockSizeVertical * 3,
child: const SpinKitPulse(
color: primary,
size: 120,
),
),
],
),
),
const SizedBox(height: 16),
SlideInUp(
from: 50,
child: AutoSizeText(
sosReceived,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.displayMedium!.copyWith(
fontSize: 40,
color: third,
fontWeight: FontWeight.w500,
2023-04-11 06:08:10 +00:00
),
),
2024-07-11 01:27:35 +00:00
),
const SizedBox(
height: 8,
),
SlideInUp(
from: 50,
child: Container(
padding: const EdgeInsets.all(15),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(15))),
2023-04-11 06:08:10 +00:00
child: AutoSizeText(
2024-07-11 01:27:35 +00:00
sOSReceivedMessage,
2023-04-11 06:08:10 +00:00
textAlign: TextAlign.center,
2024-07-11 01:27:35 +00:00
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 16,
color: Colors.black87,
2023-04-11 06:08:10 +00:00
),
),
),
2024-07-11 01:27:35 +00:00
),
const SizedBox(
height: 40,
),
Expanded(child: Container()),
SlideInUp(
child: SizedBox(
height: 50,
width: 200,
child: TextButton(
style: mainBtnStyle(second, Colors.transparent, second),
onPressed: onpressed,
child: const Text(cancelRequest,
style: TextStyle(
color: Colors.white,
)),
2023-04-11 06:08:10 +00:00
),
),
2024-07-11 01:27:35 +00:00
)
],
),
],
),
2023-04-11 06:08:10 +00:00
);
}
}