From 0de0fe7723f3405628562cf7b6559da732ba3709 Mon Sep 17 00:00:00 2001 From: dab246 Date: Fri, 6 May 2022 18:05:52 +0700 Subject: [PATCH] TF-474 Remove class do not used --- ...tachments_place_holder_loading_widget.dart | 120 ------------------ ...l_content_place_holder_loading_widget.dart | 94 -------------- 2 files changed, 214 deletions(-) delete mode 100644 lib/features/email/presentation/widgets/attachments_place_holder_loading_widget.dart delete mode 100644 lib/features/email/presentation/widgets/email_content_place_holder_loading_widget.dart diff --git a/lib/features/email/presentation/widgets/attachments_place_holder_loading_widget.dart b/lib/features/email/presentation/widgets/attachments_place_holder_loading_widget.dart deleted file mode 100644 index 7736b6e31..000000000 --- a/lib/features/email/presentation/widgets/attachments_place_holder_loading_widget.dart +++ /dev/null @@ -1,120 +0,0 @@ - -import 'package:core/core.dart'; -import 'package:flutter/material.dart'; - -const List _defaultColors = [Color.fromRGBO(0, 0, 0, 0.1), Color(0x44CCCCCC), Color.fromRGBO(0, 0, 0, 0.1)]; - -Decoration _radiusBoxDecoration({ - required Animation animation, - bool hasCustomColors = false, - AlignmentGeometry beginAlign = Alignment.topLeft, - AlignmentGeometry endAlign = Alignment.bottomRight, - List colors = _defaultColors, - double radius = 10.0 -}) { - return BoxDecoration( - borderRadius: BorderRadius.circular(radius), - shape: BoxShape.rectangle, - gradient: LinearGradient( - begin: beginAlign, - end: endAlign, - colors: hasCustomColors - ? colors.map((color) { - return color; - }).toList() - : [ - const Color.fromRGBO(0, 0, 0, 0.1), - const Color(0x32E5E5E5), - const Color.fromRGBO(0, 0, 0, 0.1), - ], - stops: [animation.value - 2, animation.value, animation.value + 1])); -} - -class AttachmentsPlaceHolderLoading extends StatefulWidget { - - final ResponsiveUtils responsiveUtils; - - const AttachmentsPlaceHolderLoading({ - Key? key, - required this.responsiveUtils, - }) : super(key: key); - - @override - State createState() => _AttachmentsPlaceHolderLoadingState(); -} - -class _AttachmentsPlaceHolderLoadingState extends State with SingleTickerProviderStateMixin { - late AnimationController _animationController; - late Animation _animation; - - @override - void initState() { - super.initState(); - _animationController = AnimationController(duration: const Duration(seconds: 1), vsync: this)..repeat(); - _animation = Tween(begin: -2, end: 2) - .animate(CurvedAnimation(curve: Curves.easeInOutSine, parent: _animationController)); - } - - @override - void dispose() { - _animationController.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return AnimatedBuilder( - animation: _animation, - builder: (BuildContext context, Widget? child) { - return Container( - margin: const EdgeInsets.only(top: 20), - padding: EdgeInsets.zero, - color: Colors.transparent, - child: Row(children: [ - _placeHolderAttachment(context), - if (widget.responsiveUtils.isDesktop(context)) - const SizedBox(width: 16), - if (widget.responsiveUtils.isDesktop(context)) - _placeHolderAttachment(context), - ]), - ); - }, - ); - } - - Widget _placeHolderAttachment(BuildContext context) { - double width = MediaQuery.of(context).size.width; - final percentAttachment = widget.responsiveUtils.isScreenWithShortestSide(context) - ? 0.4 - : widget.responsiveUtils.isTablet(context) ? 0.22 : 0.14; - return Container( - height: 55, - width: width * percentAttachment, - margin: EdgeInsets.zero, - padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16), - decoration: _radiusBoxDecoration(animation: _animation), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 24, - width: 24, - decoration: _radiusBoxDecoration(animation: _animation, radius: 12)), - const SizedBox(width: 8), - Expanded(child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 5, - decoration: _radiusBoxDecoration(animation: _animation)), - const SizedBox(height: 10), - Container( - height: 5, - decoration: _radiusBoxDecoration(animation: _animation)) - ], - )) - ] - ) - ); - } -} \ No newline at end of file diff --git a/lib/features/email/presentation/widgets/email_content_place_holder_loading_widget.dart b/lib/features/email/presentation/widgets/email_content_place_holder_loading_widget.dart deleted file mode 100644 index c2ae441d6..000000000 --- a/lib/features/email/presentation/widgets/email_content_place_holder_loading_widget.dart +++ /dev/null @@ -1,94 +0,0 @@ - -import 'package:core/core.dart'; -import 'package:flutter/material.dart'; - -const List _defaultColors = [Color.fromRGBO(0, 0, 0, 0.1), Color(0x44CCCCCC), Color.fromRGBO(0, 0, 0, 0.1)]; - -Decoration _radiusBoxDecoration({ - required Animation animation, - bool hasCustomColors = false, - AlignmentGeometry beginAlign = Alignment.topLeft, - AlignmentGeometry endAlign = Alignment.bottomRight, - List colors = _defaultColors, - double radius = 10.0 -}) { - return BoxDecoration( - borderRadius: BorderRadius.circular(radius), - shape: BoxShape.rectangle, - gradient: LinearGradient( - begin: beginAlign, - end: endAlign, - colors: hasCustomColors - ? colors.map((color) { - return color; - }).toList() - : [ - const Color.fromRGBO(0, 0, 0, 0.1), - const Color(0x32E5E5E5), - const Color.fromRGBO(0, 0, 0, 0.1), - ], - stops: [animation.value - 2, animation.value, animation.value + 1])); -} - -class EmailContentPlaceHolderLoading extends StatefulWidget { - - final ResponsiveUtils responsiveUtils; - - const EmailContentPlaceHolderLoading({ - Key? key, - required this.responsiveUtils, - }) : super(key: key); - - @override - State createState() => _EmailContentPlaceHolderLoadingState(); -} - -class _EmailContentPlaceHolderLoadingState extends State with SingleTickerProviderStateMixin { - late AnimationController _animationController; - late Animation _animation; - - @override - void initState() { - super.initState(); - _animationController = AnimationController(duration: const Duration(seconds: 1), vsync: this)..repeat(); - _animation = Tween(begin: -2, end: 2) - .animate(CurvedAnimation(curve: Curves.easeInOutSine, parent: _animationController)); - } - - @override - void dispose() { - _animationController.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return AnimatedBuilder( - animation: _animation, - builder: (BuildContext context, Widget? child) { - return Container( - margin: const EdgeInsets.only(top: 16), - padding: EdgeInsets.zero, - color: Colors.transparent, - child: Column( - children: [ - Container( - margin: const EdgeInsets.only(right: 64), - height: 10, - decoration: _radiusBoxDecoration(animation: _animation, radius: 5)), - const SizedBox(height: 16), - Container( - height: 10, - decoration: _radiusBoxDecoration(animation: _animation, radius: 5)), - const SizedBox(height: 16), - Container( - margin: const EdgeInsets.only(right: 128), - height: 10, - decoration: _radiusBoxDecoration(animation: _animation, radius: 5)), - ], - ), - ); - }, - ); - } -} \ No newline at end of file