forked from eatvio/eatvio_app
feat: add rive loading animation in profile page
This commit is contained in:
@@ -26,7 +26,7 @@ if (flutterVersionName == null) {
|
||||
android {
|
||||
namespace = "com.eatvioapp.app"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
ndkVersion = "25.1.8937393"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
BIN
assets/rive_animations/loading.riv
Normal file
BIN
assets/rive_animations/loading.riv
Normal file
Binary file not shown.
@@ -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(),
|
||||
|
||||
@@ -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',
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ dependencies:
|
||||
file_picker: ^8.1.2
|
||||
audioplayers: ^6.1.0
|
||||
intl: ^0.19.0
|
||||
rive: ^0.13.14
|
||||
|
||||
dev_dependencies:
|
||||
build_runner: ^2.4.12
|
||||
@@ -64,6 +65,7 @@ flutter:
|
||||
- assets/images/
|
||||
- assets/audio/
|
||||
- assets/icons/
|
||||
- assets/rive_animations/
|
||||
|
||||
flutter_intl:
|
||||
enabled: true
|
||||
|
||||
Reference in New Issue
Block a user