123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import 'package:fis_ui/define.dart';
- import 'package:fis_ui/values/icons.dart';
- import 'package:flutter/material.dart';
- import 'text_liquid_fill.dart';
- class LoadingWidget extends StatelessWidget implements FWidget {
- const LoadingWidget({
- Key? key,
- this.text,
- this.margin,
- this.backgroundColor = Colors.white,
- }) : super(key: key);
- final String? text;
- final EdgeInsetsGeometry? margin;
- final Color backgroundColor;
- @override
- Widget build(BuildContext context) {
- final child = TextLiquidFill(
- text: '',
- child: const Icon(FIcons.logo, size: 60),
- loadUntil: 1.0,
- waveColor: Theme.of(context).primaryColor,
- waveDuration: const Duration(milliseconds: 1500),
- loadDuration: const Duration(milliseconds: 1000),
- boxBackgroundColor: backgroundColor,
- boxWidth: 78.0,
- boxHeight: 78.0,
- loop: true,
- );
- final card = Card(
- color: backgroundColor,
- elevation: 0,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8),
- side: BorderSide(color: Colors.grey.shade400),
- ),
- child: Padding(
- padding: const EdgeInsets.only(left: 20, right: 32),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- child,
- if (text != null && text!.isNotEmpty) ...[
- const SizedBox(width: 8),
- Flexible(
- child: Text(
- text!,
- style: TextStyle(
- fontSize: 14,
- fontFamily:
- Theme.of(context).textTheme.displayLarge?.fontFamily,
- ),
- ),
- ),
- ]
- ],
- ),
- ),
- );
- if (margin == null) {
- return card;
- } else {
- return Container(
- child: card,
- margin: margin,
- );
- }
- }
- }
|