mirror of
https://github.com/smmarty/friflex_flutter_starter.git
synced 2025-12-22 17:40:45 +00:00
feat
This commit is contained in:
@@ -2,7 +2,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:friflex_starter/app/app_context_ext.dart';
|
||||
import 'package:friflex_starter/app/theme/app_colors_scheme.dart';
|
||||
import 'package:friflex_starter/app/ui_kit/app_box.dart';
|
||||
|
||||
/// {@template app_snackbar}
|
||||
@@ -140,8 +139,7 @@ class AppSnackBar extends StatefulWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _AppSnackBarState extends State<AppSnackBar>
|
||||
with SingleTickerProviderStateMixin {
|
||||
class _AppSnackBarState extends State<AppSnackBar> with SingleTickerProviderStateMixin {
|
||||
late AnimationController _animationController;
|
||||
late Animation<double> _slideAnimation;
|
||||
Timer? _dismissTimer;
|
||||
@@ -176,10 +174,10 @@ class _AppSnackBarState extends State<AppSnackBar>
|
||||
// Конечная позиция снекбара - 15 пикселей ниже верхнего отступа
|
||||
final endPosition = topPadding + 15;
|
||||
// Создание анимации с использованием Tween
|
||||
_slideAnimation = Tween<double>(begin: startPosition, end: endPosition)
|
||||
.animate(
|
||||
CurvedAnimation(parent: _animationController, curve: Curves.easeOut),
|
||||
);
|
||||
_slideAnimation = Tween<double>(
|
||||
begin: startPosition,
|
||||
end: endPosition,
|
||||
).animate(CurvedAnimation(parent: _animationController, curve: Curves.easeOut));
|
||||
|
||||
_animationController.forward();
|
||||
}
|
||||
@@ -233,10 +231,7 @@ class _AppSnackBarState extends State<AppSnackBar>
|
||||
color: _getBackgroundColor(widget.type),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 12,
|
||||
horizontal: 16,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
_Icon(type: widget.type),
|
||||
@@ -289,11 +284,7 @@ class _Icon extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return switch (type) {
|
||||
TypeSnackBar.success => Icon(
|
||||
Icons.check_circle,
|
||||
color: Colors.white,
|
||||
size: 32,
|
||||
),
|
||||
TypeSnackBar.success => Icon(Icons.check_circle, color: Colors.white, size: 32),
|
||||
TypeSnackBar.error => Icon(Icons.error, color: Colors.white, size: 32),
|
||||
TypeSnackBar.info => Icon(Icons.info, color: Colors.white, size: 32),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user