From 0620440e249474ad99f3a0706b1944fafbcd5b55 Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Thu, 3 Oct 2024 12:38:41 +0300 Subject: [PATCH 1/5] WIP: add tfloading.json to be animated --- app/assets/tfloading.json | 1 + app/lib/widgets/home_logo.dart | 24 ++++++++++++++++++------ app/pubspec.lock | 34 +++++++++++++++++++++++++++------- app/pubspec.yaml | 1 + 4 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 app/assets/tfloading.json diff --git a/app/assets/tfloading.json b/app/assets/tfloading.json new file mode 100644 index 000000000..e147139ef --- /dev/null +++ b/app/assets/tfloading.json @@ -0,0 +1 @@ +{"v":"5.12.2","fr":50,"ip":0,"op":70,"w":255,"h":232,"nm":"Comp 2","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":0,"k":127,"ix":3},"y":{"a":1,"k":[{"t":0,"s":[103],"h":1},{"t":17.5,"s":[26],"h":1},{"t":35,"s":[-56],"h":1},{"t":52.5,"s":[-139],"h":1},{"t":70,"s":[98],"h":1}],"ix":4}},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[306,260],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0.571102965112,0.710587026559,0.827450980392,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[3,260],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"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":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":70,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"logoTF_icon-0١ Outlines 2","tt":3,"tp":1,"sr":1,"ks":{"o":{"a":0,"k":100,"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":0,"k":[100,100],"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 1","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":0,"k":[100,100],"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 1","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":0,"k":[100,100],"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.101960785687,0.631372570992,0.560784339905,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/widgets/home_logo.dart b/app/lib/widgets/home_logo.dart index 9135161e5..df76902a2 100644 --- a/app/lib/widgets/home_logo.dart +++ b/app/lib/widgets/home_logo.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; +import 'package:lottie/lottie.dart'; class HomeLogoWidget extends StatelessWidget { const HomeLogoWidget({super.key}); @@ -10,12 +10,24 @@ 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: Container(color: Colors.transparent,child: Lottie.asset( + 'assets/tfloading.json', + repeat: true, + animate: true, + options: LottieOptions(enableMergePaths: true), +),) + ), + + + // 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, width: MediaQuery.of(context).size.width * 0.6, diff --git a/app/pubspec.lock b/app/pubspec.lock index 1531e0374..96d658426 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: @@ -476,9 +484,11 @@ packages: gridproxy_client: dependency: "direct main" description: - path: "../../../codescalers/tfgrid-sdk-dart/packages/gridproxy_client" - relative: true - source: path + path: "packages/gridproxy_client" + ref: tfchain_graphql_hotfix + resolved-ref: "314f46728e43cb86f430cda6ba756d4be3fb6e07" + url: "https://github.com/codescalers/tfgrid-sdk-dart" + source: git version: "1.0.0" hashlib: dependency: transitive @@ -608,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: @@ -1330,9 +1348,11 @@ packages: tfchain_client: dependency: "direct main" description: - path: "../../../codescalers/tfgrid-sdk-dart/packages/tfchain_client" - relative: true - source: path + path: "packages/tfchain_client" + ref: tfchain_graphql_hotfix + resolved-ref: "314f46728e43cb86f430cda6ba756d4be3fb6e07" + url: "https://github.com/codescalers/tfgrid-sdk-dart" + source: git version: "0.1.0" timing: dependency: transitive @@ -1640,4 +1660,4 @@ packages: version: "1.1.4+10" sdks: dart: ">=3.2.3 <4.0.0" - flutter: ">=3.16.0" + flutter: ">=3.16.6" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index ad6d23cb6..95106f91e 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: From 71c361197c74c90dacb2c7cdb7fcd40ea5454da2 Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Mon, 7 Oct 2024 13:37:28 +0300 Subject: [PATCH 2/5] Add animated logo in main screen && remove loading spinner --- app/assets/tfloading.json | 202 ++++++++++++++++++++++- app/lib/screens/main_screen.dart | 12 +- app/lib/screens/registered_screen.dart | 2 +- app/lib/screens/splash_screen.dart | 2 +- app/lib/screens/unregistered_screen.dart | 2 +- 5 files changed, 205 insertions(+), 15 deletions(-) diff --git a/app/assets/tfloading.json b/app/assets/tfloading.json index e147139ef..ef67bff37 100644 --- a/app/assets/tfloading.json +++ b/app/assets/tfloading.json @@ -1 +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":1,"ty":4,"nm":"Shape Layer 1","td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":0,"k":127,"ix":3},"y":{"a":1,"k":[{"t":0,"s":[103],"h":1},{"t":17.5,"s":[26],"h":1},{"t":35,"s":[-56],"h":1},{"t":52.5,"s":[-139],"h":1},{"t":70,"s":[98],"h":1}],"ix":4}},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[306,260],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0.571102965112,0.710587026559,0.827450980392,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[3,260],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"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":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":70,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"logoTF_icon-0١ Outlines 2","tt":3,"tp":1,"sr":1,"ks":{"o":{"a":0,"k":100,"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":0,"k":[100,100],"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 1","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":0,"k":[100,100],"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 1","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":0,"k":[100,100],"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.101960785687,0.631372570992,0.560784339905,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 +{ + "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( From 6185bf0066182696a1ba1705d004e901e204160e Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Mon, 7 Oct 2024 14:04:53 +0300 Subject: [PATCH 3/5] add animate flag --- app/lib/widgets/home_logo.dart | 49 ++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/app/lib/widgets/home_logo.dart b/app/lib/widgets/home_logo.dart index df76902a2..6d060bdd8 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) { @@ -11,23 +13,36 @@ class HomeLogoWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Center( - - child: Container(color: Colors.transparent,child: Lottie.asset( - 'assets/tfloading.json', - repeat: true, - animate: true, - options: LottieOptions(enableMergePaths: true), -),) - + child: animate + ? Column(children: [ + SizedBox( + height: 50, + width: 50, + child: Lottie.asset( + 'assets/tfloading.json', + repeat: true, + animate: true, + ), + ), + 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), - // ), + ],) + + : 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, width: MediaQuery.of(context).size.width * 0.6, @@ -38,7 +53,7 @@ class HomeLogoWidget extends StatelessWidget { ), Text( 'ThreeFold Connect App', - style: Theme.of(context).textTheme.titleLarge!.copyWith( + style: Theme.of(context).textTheme.headlineSmall!.copyWith( color: Theme.of(context).colorScheme.primary, fontWeight: FontWeight.bold), ), From 319081d6b332afeba9f8d31ab168b4425a4b4655 Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Mon, 7 Oct 2024 14:11:59 +0300 Subject: [PATCH 4/5] use height and width in Lottie and remove sizedBox --- app/lib/widgets/home_logo.dart | 43 ++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/app/lib/widgets/home_logo.dart b/app/lib/widgets/home_logo.dart index 6d060bdd8..1dbb69e6c 100644 --- a/app/lib/widgets/home_logo.dart +++ b/app/lib/widgets/home_logo.dart @@ -14,26 +14,29 @@ class HomeLogoWidget extends StatelessWidget { children: [ Center( child: animate - ? Column(children: [ - SizedBox( - height: 50, - width: 50, - child: Lottie.asset( - 'assets/tfloading.json', - repeat: true, - animate: true, - ), - ), - const SizedBox(height: 10,), - Text( - 'THREEFOLD', - style: Theme.of(context).textTheme.headlineSmall!.copyWith( - color: Theme.of(context).colorScheme.onBackground, - fontWeight: FontWeight.bold), - ), - - ],) - + ? 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, From 5475f63e86f52c34c92908e8c8c038133e6855a6 Mon Sep 17 00:00:00 2001 From: AlaaElattar Date: Mon, 7 Oct 2024 14:14:56 +0300 Subject: [PATCH 5/5] revert style of ThreeFold Connect App text --- app/lib/widgets/home_logo.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/widgets/home_logo.dart b/app/lib/widgets/home_logo.dart index 1dbb69e6c..435f328b7 100644 --- a/app/lib/widgets/home_logo.dart +++ b/app/lib/widgets/home_logo.dart @@ -56,7 +56,7 @@ class HomeLogoWidget extends StatelessWidget { ), Text( 'ThreeFold Connect App', - style: Theme.of(context).textTheme.headlineSmall!.copyWith( + style: Theme.of(context).textTheme.titleLarge!.copyWith( color: Theme.of(context).colorScheme.primary, fontWeight: FontWeight.bold), ),