Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

add rive for ack screen

AmanRajSinghMouryab520418198fb
diff --git a/mobile/packages/legacy/assets/legacy_congratulations.riv b/mobile/packages/legacy/assets/legacy_congratulations.riv
new file mode 100644
index 0000000000..e578e0e733
Binary files /dev/null and b/mobile/packages/legacy/assets/legacy_congratulations.riv differ
diff --git a/mobile/packages/legacy/lib/pages/legacy_congratulations_page.dart b/mobile/packages/legacy/lib/pages/legacy_congratulations_page.dart
index 4e00e72c69..a2b45f1ef1 100644
--- a/mobile/packages/legacy/lib/pages/legacy_congratulations_page.dart
+++ b/mobile/packages/legacy/lib/pages/legacy_congratulations_page.dart
@@ -2,10 +2,37 @@ import "package:ente_components/ente_components.dart";
import "package:ente_strings/ente_strings.dart";
import "package:flutter/material.dart";
import "package:flutter/services.dart";
+import "package:rive/rive.dart" as rive;
-class LegacyCongratulationsPage extends StatelessWidget {
+class LegacyCongratulationsPage extends StatefulWidget {
const LegacyCongratulationsPage({super.key});
+ @override
+ State<LegacyCongratulationsPage> createState() =>
+ _LegacyCongratulationsPageState();
+}
+
+class _LegacyCongratulationsPageState extends State<LegacyCongratulationsPage> {
+ static const _illustrationWidth = 210.0;
+ static const _illustrationHeight = 202.0;
+
+ late final rive.FileLoader _animationLoader;
+
+ @override
+ void initState() {
+ super.initState();
+ _animationLoader = rive.FileLoader.fromAsset(
+ "packages/ente_legacy/assets/legacy_congratulations.riv",
+ riveFactory: rive.Factory.flutter,
+ );
+ }
+
+ @override
+ void dispose() {
+ _animationLoader.dispose();
+ super.dispose();
+ }
+
@override
Widget build(BuildContext context) {
final colors = context.componentColors;
@@ -26,10 +53,21 @@ class LegacyCongratulationsPage extends StatelessWidget {
child: Column(
children: [
const Spacer(flex: 2),
- Image.asset(
- "assets/legacy_kit_ducky.png",
- package: "ente_legacy",
- width: 210,
+ SizedBox(
+ width: _illustrationWidth,
+ height: _illustrationHeight,
+ child: rive.RiveWidgetBuilder(
+ fileLoader: _animationLoader,
+ builder: (context, state) {
+ if (state is rive.RiveLoaded) {
+ return rive.RiveWidget(
+ controller: state.controller,
+ fit: rive.Fit.contain,
+ );
+ }
+ return const SizedBox.expand();
+ },
+ ),
),
const SizedBox(height: 36),
Text(
diff --git a/mobile/packages/legacy/pubspec.yaml b/mobile/packages/legacy/pubspec.yaml
index 2293089715..746f1b96d9 100644
--- a/mobile/packages/legacy/pubspec.yaml
+++ b/mobile/packages/legacy/pubspec.yaml
@@ -45,6 +45,7 @@ dependencies:
password_strength: 0.2.0
pdf: 3.11.3
pointycastle: 3.9.1
+ rive: 0.14.0-dev.13
share_plus: 11.1.0
shared_preferences: 2.5.3
uuid: 4.5.3