diff --git a/app/assets/tfloading.json b/app/assets/tfloading.json new file mode 100644 index 000000000..ef67bff37 --- /dev/null +++ b/app/assets/tfloading.json @@ -0,0 +1,201 @@ +{ + "v": "5.12.2", + "fr": 50, + "ip": 0, + "op": 70, + "w": 255, + "h": 232, + "nm": "Comp 2", + "ddd": 0, + "assets": [], + "layers": [ + { + "ddd": 0, + "ind": 2, + "ty": 4, + "nm": "logoTF_icon Outlines", + "tt": 3, + "tp": 1, + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { "t": 0, "s": [100], "h": 1 }, + { "t": 80, "s": [0], "h": 1 } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { "a": 0, "k": [127, 116, 0], "ix": 2, "l": 2 }, + "a": { "a": 0, "k": [76.5, 77, 0], "ix": 1, "l": 2 }, + "s": { "a": 0, "k": [191.883, 191.883, 100], "ix": 6, "l": 2 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [[8.4, 0], [0, 0], [0, 0], [0, 0], [0, 0]], + "o": [[0, 0], [0, 0], [0, 0], [0, 0], [0.1, 8.401]], + "v": [[50, 14.9], [-65.3, 14.9], [-65.3, -14.9], [65.2, -14.9], [65.2, -0.4]], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [76.5, 120.4], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { "t": 0, "s": [0, 0], "h": 1 }, + { "t": 20, "s": [100, 100], "h": 1 } + ], + "ix": 3 + }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [[0, 0], [0, 0], [0, 0], [0, 0]], + "o": [[0, 0], [0, 0], [0, 0], [0, 0]], + "v": [[46.15, 14.85], [-46.15, 14.85], [-46.15, -14.85], [46.15, -14.85]], + "c": true + }, + "ix": 2 + }, + "nm": "Path 2", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [95.65, 76.95], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { "t": 20, "s": [0, 0], "h": 1 }, + { "t": 40, "s": [100, 100], "h": 1 } + ], + "ix": 3 + }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 2", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [[8.4, 0], [0, 0], [0, 0], [0, 0], [0, 0]], + "o": [[0, 0], [0, 0], [0, 0], [0, 0], [0.1, -8.4]], + "v": [[50, -14.9], [-65.3, -14.9], [-65.3, 14.9], [65.2, 14.9], [65.2, 0.2]], + "c": true + }, + "ix": 2 + }, + "nm": "Path 3", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [76.5, 33.6], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { "t": 40, "s": [0, 0], "h": 1 }, + { "t": 60, "s": [100, 100], "h": 1 } + ], + "ix": 3 + }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 3", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 3, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "fl", + "c": { "a": 0, "k": [0.102, 0.631, 0.561, 1], "ix": 4 }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + } + ], + "ip": 0, + "op": 70, + "st": 0, + "ct": 1, + "bm": 0 + } + ], + "markers": [], + "props": {} + } + \ No newline at end of file diff --git a/app/lib/screens/main_screen.dart b/app/lib/screens/main_screen.dart index 40a370517..fb09d846d 100644 --- a/app/lib/screens/main_screen.dart +++ b/app/lib/screens/main_screen.dart @@ -65,7 +65,7 @@ class _AppState extends State { children: [ const Hero( tag: 'logo', - child: HomeLogoWidget(), + child: HomeLogoWidget(animate: true,), ), const SizedBox(height: 50), Container( @@ -84,16 +84,6 @@ class _AppState extends State { const SizedBox( height: 40, ), - Visibility( - visible: errorMessage == null, - child: Transform.scale( - scale: 0.5, - child: CircularProgressIndicator( - color: Theme.of(context).colorScheme.primary, - ), - ), - ), - const SizedBox(height: 20), Visibility( maintainSize: true, maintainAnimation: true, diff --git a/app/lib/screens/registered_screen.dart b/app/lib/screens/registered_screen.dart index d76162e1a..245f76962 100644 --- a/app/lib/screens/registered_screen.dart +++ b/app/lib/screens/registered_screen.dart @@ -43,7 +43,7 @@ class _RegisteredScreenState extends State ), const Hero( tag: 'logo', - child: HomeLogoWidget(), + child: HomeLogoWidget(animate: false,), ), ], ), diff --git a/app/lib/screens/splash_screen.dart b/app/lib/screens/splash_screen.dart index 4f560ed34..954db18e2 100644 --- a/app/lib/screens/splash_screen.dart +++ b/app/lib/screens/splash_screen.dart @@ -43,7 +43,7 @@ class _SplashScreenState extends State body: Center( child: Hero( tag: 'logo', - child: HomeLogoWidget(), + child: HomeLogoWidget(animate: true,), ), ), ); diff --git a/app/lib/screens/unregistered_screen.dart b/app/lib/screens/unregistered_screen.dart index 6f318b391..78bfbef79 100644 --- a/app/lib/screens/unregistered_screen.dart +++ b/app/lib/screens/unregistered_screen.dart @@ -79,7 +79,7 @@ class _UnregisteredScreenState extends State children: [ const Hero( tag: 'logo', - child: HomeLogoWidget(), + child: HomeLogoWidget(animate: false,), ), const SizedBox(height: 150), SizedBox( diff --git a/app/lib/widgets/home_logo.dart b/app/lib/widgets/home_logo.dart index 9135161e5..435f328b7 100644 --- a/app/lib/widgets/home_logo.dart +++ b/app/lib/widgets/home_logo.dart @@ -1,8 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:lottie/lottie.dart'; class HomeLogoWidget extends StatelessWidget { - const HomeLogoWidget({super.key}); + final bool animate; + const HomeLogoWidget({super.key, required this.animate}); @override Widget build(BuildContext context) { @@ -10,11 +12,39 @@ class HomeLogoWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - SvgPicture.asset( - 'assets/TF_logo.svg', - alignment: Alignment.center, - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, BlendMode.srcIn), + Center( + child: animate + ? Column( + children: [ + Lottie.asset( + 'assets/tfloading.json', + repeat: true, + animate: true, + width: 50, + height: 50, + ), + const SizedBox( + height: 10, + ), + Text( + 'THREEFOLD', + style: Theme.of(context) + .textTheme + .headlineSmall! + .copyWith( + color: Theme.of(context).colorScheme.onBackground, + fontWeight: FontWeight.bold), + ), + ], + ) + : SvgPicture.asset( + 'assets/TF_logo.svg', + alignment: Alignment.center, + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.onBackground, + BlendMode.srcIn, + ), + ), ), SizedBox( height: MediaQuery.of(context).size.height * 0.04, diff --git a/app/pubspec.lock b/app/pubspec.lock index 065b09681..18ea86fb8 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -25,6 +25,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.4.1" + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" args: dependency: transitive description: @@ -610,6 +618,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + lottie: + dependency: "direct main" + description: + name: lottie + sha256: "6a24ade5d3d918c306bb1c21a6b9a04aab0489d51a2582522eea820b4093b62b" + url: "https://pub.dev" + source: hosted + version: "3.1.2" matcher: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 7660e029e..8ca35dbbd 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -65,6 +65,7 @@ dependencies: qr_flutter: ^4.1.0 screen_brightness: ^1.0.1 validators: ^3.0.0 + lottie: ^3.1.2 dev_dependencies: flutter_test: