You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
3.3 KiB
Dart
117 lines
3.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
class SwipeSuccessView extends StatelessWidget {
|
|
static const routeName = '/swipe_success_view';
|
|
const SwipeSuccessView({Key key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment:CrossAxisAlignment.center,
|
|
children: [
|
|
'swipe_success'.toSvgAsset(),
|
|
17.height,
|
|
context.translation.successful.heading4(context).custom(color: AppColor.neutral80),
|
|
8.height,
|
|
context.translation.youHaveSuccessfullyMarkedYourAttendance.bodyText2(context).custom(color: AppColor.white20),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
class CircularAnimationWithProgressIndicator extends StatefulWidget {
|
|
Widget child;
|
|
CircularAnimationWithProgressIndicator({Key key, this.child}) : super(key: key);
|
|
@override
|
|
_CircularAnimationWithProgressIndicatorState createState() =>
|
|
_CircularAnimationWithProgressIndicatorState();
|
|
}
|
|
|
|
class _CircularAnimationWithProgressIndicatorState
|
|
extends State<CircularAnimationWithProgressIndicator>
|
|
with SingleTickerProviderStateMixin {
|
|
AnimationController _controller;
|
|
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
|
|
// Animation controller for progress indicator
|
|
_controller = AnimationController(
|
|
vsync: this,
|
|
duration: const Duration(seconds: 40), // Duration of one full rotation
|
|
)..repeat(); // Repeat animation continuously
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_controller.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
// Animated CircularProgressIndicator
|
|
AnimatedBuilder(
|
|
animation: _controller,
|
|
builder: (context, child) {
|
|
return Transform.rotate(
|
|
angle: _controller.value * 2 * 3.1416, // Full rotation
|
|
child: child,
|
|
);
|
|
},
|
|
child: SizedBox(
|
|
width: 100.toScreenHeight,
|
|
height: 100.toScreenWidth,
|
|
child: const CircularProgressIndicator(
|
|
strokeWidth: 3.0,
|
|
backgroundColor: AppColor.primary30,
|
|
|
|
value: null, // Infinite animation
|
|
),
|
|
),
|
|
),
|
|
|
|
// Static container in the center
|
|
widget.child?? const SizedBox(),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
// ClipOval(
|
|
// child: Container(
|
|
// color: Colors.grey.withOpacity(0.2),
|
|
// padding: const EdgeInsets.all(10),
|
|
// child: ClipOval(
|
|
// child: Container(
|
|
// color: AppColor.white.withOpacity(0.2),
|
|
// padding: const EdgeInsets.all(10),
|
|
// child: ClipOval(
|
|
// child: Container(
|
|
// color: AppColor.white,
|
|
// child: 'success_swipe'.toSvgAsset().paddingAll(50),
|
|
// ),
|
|
// ).paddingAll(20),
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// )
|