Skip to content

Commit cd31a66

Browse files
authored
refactor: Updated class modifiers, added Lottie animations, and reorganized pubspec dependencies (#159)
1 parent b12a540 commit cd31a66

File tree

11 files changed

+65
-59
lines changed

11 files changed

+65
-59
lines changed

assets/animations/audio_wave.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"nm":"コンポ 1","ddd":0,"h":600,"w":600,"meta":{"g":"@lottiefiles/toolkit-js 0.33.2"},"layers":[{"ty":4,"nm":"シェイプレイヤー 5","sr":1,"st":0,"op":150.000006109625,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[300,300,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"シェイプ 1","ix":1,"cix":2,"np":4,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"パス 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[226,-236],[226,242]]},"ix":2}},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"パスのトリミング 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[80],"t":0},{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[70],"t":5},{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[90],"t":11},{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[60],"t":17},{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[85],"t":25},{"s":[80],"t":30.0000012219251}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[20],"t":0},{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[30],"t":5},{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[10],"t":11},{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[40],"t":17},{"o":{"x":0.48,"y":0.04},"i":{"x":0.52,"y":0.96},"s":[15],"t":25},{"s":[20],"t":30.0000012219251}],"ix":1},"m":2},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"線 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":40,"ix":5},"c":{"a":0,"k":[0.2784,0.5922,1],"ix":3}},{"ty":"fl","bm":0,"hd":true,"mn":"ADBE Vector Graphic - Fill","nm":"塗り 1","c":{"a":0,"k":[1,0,0],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"シェイプレイヤー 4","sr":1,"st":0,"op":150.000006109625,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[300,300,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"シェイプ 1","ix":1,"cix":2,"np":4,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"パス 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[114,-236],[114,242]]},"ix":2}},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"パスのトリミング 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.42,"y":0},"i":{"x":0.58,"y":1},"s":[60],"t":0},{"o":{"x":0.42,"y":0},"i":{"x":0.58,"y":1},"s":[80],"t":7},{"o":{"x":0.42,"y":0},"i":{"x":0.58,"y":1},"s":[60],"t":14},{"o":{"x":0.42,"y":0},"i":{"x":0.58,"y":1},"s":[100],"t":22},{"s":[60],"t":30.0000012219251}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.42,"y":0},"i":{"x":0.58,"y":1},"s":[40],"t":0},{"o":{"x":0.42,"y":0},"i":{"x":0.58,"y":1},"s":[20],"t":7},{"o":{"x":0.42,"y":0},"i":{"x":0.58,"y":1},"s":[40],"t":14},{"o":{"x":0.42,"y":0},"i":{"x":0.58,"y":1},"s":[0],"t":22},{"s":[40],"t":30.0000012219251}],"ix":1},"m":2},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"線 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":40,"ix":5},"c":{"a":0,"k":[0.2784,0.5922,1],"ix":3}},{"ty":"fl","bm":0,"hd":true,"mn":"ADBE Vector Graphic - Fill","nm":"塗り 1","c":{"a":0,"k":[1,0,0],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"シェイプレイヤー 3","sr":1,"st":0,"op":150.000006109625,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[300,300,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"シェイプ 1","ix":1,"cix":2,"np":4,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"パス 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-2,-236],[-2,242]]},"ix":2}},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"パスのトリミング 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.84,"y":0},"i":{"x":0.16,"y":1},"s":[90],"t":0},{"o":{"x":0.84,"y":0},"i":{"x":0.16,"y":1},"s":[65],"t":8},{"o":{"x":0.84,"y":0},"i":{"x":0.16,"y":1},"s":[75],"t":15},{"o":{"x":0.84,"y":0},"i":{"x":0.16,"y":1},"s":[60],"t":21},{"s":[90],"t":30.0000012219251}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.84,"y":0},"i":{"x":0.16,"y":1},"s":[10],"t":0},{"o":{"x":0.84,"y":0},"i":{"x":0.16,"y":1},"s":[35],"t":8},{"o":{"x":0.84,"y":0},"i":{"x":0.16,"y":1},"s":[25],"t":15},{"o":{"x":0.84,"y":0},"i":{"x":0.16,"y":1},"s":[40],"t":21},{"s":[10],"t":30.0000012219251}],"ix":1},"m":2},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"線 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":40,"ix":5},"c":{"a":0,"k":[0.2784,0.5922,1],"ix":3}},{"ty":"fl","bm":0,"hd":true,"mn":"ADBE Vector Graphic - Fill","nm":"塗り 1","c":{"a":0,"k":[1,0,0],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"シェイプレイヤー 2","sr":1,"st":0,"op":150.000006109625,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[300,300,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"シェイプ 1","ix":1,"cix":2,"np":5,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"パス 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-114,-236],[-114,242]]},"ix":2}},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"パスのトリミング 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[60],"t":0},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[85],"t":8},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[70],"t":15},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[90],"t":22},{"s":[60],"t":30.0000012219251}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[40],"t":0},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[15],"t":8},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[30],"t":15},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[10],"t":22},{"s":[40],"t":30.0000012219251}],"ix":1},"m":2},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"線 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":40,"ix":5},"c":{"a":0,"k":[0.2784,0.5922,1],"ix":3}},{"ty":"fl","bm":0,"hd":true,"mn":"ADBE Vector Graphic - Fill","nm":"塗り 1","c":{"a":0,"k":[1,0,0],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"パス 2","ix":5,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[114,-236],[114,242]]},"ix":2}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"シェイプレイヤー 1","sr":1,"st":0,"op":150.000006109625,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[300,300,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"シェイプ 1","ix":1,"cix":2,"np":5,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"パス 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-226,-236],[-226,242]]},"ix":2}},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"パスのトリミング 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[80],"t":0},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[60],"t":8},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[90],"t":15},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[65],"t":22},{"s":[80],"t":30.0000012219251}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[20],"t":0},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[40],"t":8},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[10],"t":15},{"o":{"x":0.4,"y":0.8},"i":{"x":0.74,"y":1},"s":[35],"t":22},{"s":[20],"t":30.0000012219251}],"ix":1},"m":2},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"線 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":40,"ix":5},"c":{"a":0,"k":[0.2784,0.5922,1],"ix":3}},{"ty":"fl","bm":0,"hd":true,"mn":"ADBE Vector Graphic - Fill","nm":"塗り 1","c":{"a":0,"k":[1,0,0],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"パス 2","ix":5,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[226,-236],[226,242]]},"ix":2}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5}],"v":"5.2.1","fr":30,"op":30,"ip":0,"assets":[]}

lib/main_common.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_template/injection/dependencies.dart';
33
import 'package:flutter_template/presentation/app.dart';
44
import 'package:flutter_template/presentation/app_flavor.dart';
5+
import 'package:flutter_template/presentation/common/assets_cache_manager.dart';
56

67
// ignore: avoid_void_async
78
void mainCommon(AppFlavor flavor) async {
89
WidgetsFlutterBinding.ensureInitialized();
910
await DependencyManager.inject(flavor);
11+
await AssetsCachingManager.cacheAnimationsRoot();
1012
runApp(const App());
1113
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
abstract interface class AssetsCachingManager {
2+
/// Caches only the animations required at the initial app startup,
3+
/// specifically for the splash screen.
4+
///
5+
/// This method should be called before [runApp] to ensure that essential
6+
/// animations are loaded early, improving the user experience during
7+
/// the app's launch phase.
8+
///
9+
/// By caching only necessary animations, this method reduces memory usage
10+
/// and improves performance.
11+
///
12+
/// Typically invoked during app initialization to enhance startup efficiency.
13+
static Future<void> cacheAnimationsRoot() async {
14+
// Example:
15+
// try {
16+
// await AssetLottie(Assets.animations.splash.path).load();
17+
// } catch (e) {
18+
// // Nothing to do
19+
// }
20+
}
21+
}

lib/presentation/resources/app_color_palette.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
33
/// Defines color palette for the application.
44
///
55
/// Consider using the color name that is mentioned in Figma.
6-
sealed class AppColorPalette {
6+
abstract interface class AppColorPalette {
77
const AppColorPalette._();
88

99
static const alpha = Colors.transparent;
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
sealed class AppFonts {
1+
import 'package:flutter_template/gen/fonts.gen.dart';
2+
3+
abstract interface class AppFonts {
24
AppFonts._();
35

4-
static const roboto = 'Roboto';
6+
static const roboto = FontFamily.roboto;
57

68
static String get activeFontFamily => roboto;
79
}

lib/presentation/resources/app_icons.dart

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/presentation/resources/app_text_styles.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_template/presentation/resources/app_colors.dart';
3-
import 'package:flutter_template/presentation/resources/app_fonts.dart';
2+
import 'package:flutter_template/presentation/resources/resources.dart';
43
import 'package:theme_tailor_annotation/theme_tailor_annotation.dart';
54

65
part 'app_text_styles.tailor.dart';

lib/presentation/resources/app_theme.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_template/presentation/extensions/color_extensions.dart';
33
import 'package:flutter_template/presentation/resources/resources.dart';
44

5-
sealed class AppTheme {
5+
abstract interface class AppTheme {
66
const AppTheme._();
77

88
static ThemeData fromBrightness(Brightness brightness) {

lib/presentation/resources/app_ui_constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
44
///
55
/// This class contains non-sensitive information and is designed to maintain consistency
66
/// across the app's UI elements.
7-
sealed class AppUiConstants {
7+
abstract interface class AppUiConstants {
88
AppUiConstants._();
99

1010
// Animations
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export 'package:flutter_template/presentation/resources/app_colors.dart';
22
export 'package:flutter_template/presentation/resources/app_fonts.dart';
3-
export 'package:flutter_template/presentation/resources/app_icons.dart';
43
export 'package:flutter_template/presentation/resources/app_images.dart';
54
export 'package:flutter_template/presentation/resources/app_text_styles.dart';
65
export 'package:flutter_template/presentation/resources/app_theme.dart';

0 commit comments

Comments
 (0)