feat: add rive loading animation in profile page

This commit is contained in:
mso7nueh
2024-09-30 13:40:32 +03:00
parent 860036c35f
commit 3225ff9a01
5 changed files with 17 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ class ProfileCubit extends Cubit<ProfileState> {
_currentPeriod = period;
try {
final profile = await profileRepository.getMyProfile();
await Future.delayed(Duration(seconds: 1));
emit(ProfileState.loaded(
profile: profile,
profileDetails: await profileRepository.getMyProfileDetails(),

View File

@@ -14,6 +14,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:rive/rive.dart';
import 'package:share_plus/share_plus.dart';
class ProfileScreen extends StatefulWidget {
@@ -287,7 +288,18 @@ class _ProfileScreenState extends State<ProfileScreen> {
return Scaffold(
appBar: AppBar(),
body: Center(
child: CircularProgressIndicator(),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: 32,
width: 32,
child: RiveAnimation.asset(
'assets/rive_animations/loading.riv',
),
),
],
)
),
);
}