Fix connection info ui
This commit is contained in:
40
lib/core/widget/shimmer_skeleton.dart
Normal file
40
lib/core/widget/shimmer_skeleton.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:hiddify/core/widget/skeleton_widget.dart';
|
||||
|
||||
class ShimmerSkeleton extends StatelessWidget {
|
||||
const ShimmerSkeleton({
|
||||
this.width,
|
||||
this.height,
|
||||
this.widthFactor,
|
||||
this.heightFactor,
|
||||
this.color,
|
||||
this.duration = const Duration(seconds: 1),
|
||||
super.key,
|
||||
});
|
||||
|
||||
final double? width;
|
||||
final double? height;
|
||||
final double? widthFactor;
|
||||
final double? heightFactor;
|
||||
final Color? color;
|
||||
final Duration duration;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Skeleton(
|
||||
width: width,
|
||||
height: height,
|
||||
widthFactor: widthFactor,
|
||||
heightFactor: heightFactor,
|
||||
)
|
||||
.animate(
|
||||
onPlay: (controller) => controller.loop(),
|
||||
)
|
||||
.shimmer(
|
||||
duration: duration,
|
||||
angle: 45,
|
||||
color: color ?? Theme.of(context).colorScheme.secondary,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user