File tree Expand file tree Collapse file tree 9 files changed +31
-15
lines changed Expand file tree Collapse file tree 9 files changed +31
-15
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ import 'package:flutter/material.dart';
2
2
import 'package:flutter_template/injection/dependencies.dart' ;
3
3
import 'package:flutter_template/presentation/app.dart' ;
4
4
import 'package:flutter_template/presentation/app_flavor.dart' ;
5
+ import 'package:flutter_template/presentation/common/assets_cache_manager.dart' ;
5
6
6
7
// ignore: avoid_void_async
7
8
void mainCommon (AppFlavor flavor) async {
8
9
WidgetsFlutterBinding .ensureInitialized ();
9
10
await DependencyManager .inject (flavor);
11
+ await AssetsCachingManager .cacheAnimationsRoot ();
10
12
runApp (const App ());
11
13
}
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
3
3
/// Defines color palette for the application.
4
4
///
5
5
/// Consider using the color name that is mentioned in Figma.
6
- sealed class AppColorPalette {
6
+ abstract interface class AppColorPalette {
7
7
const AppColorPalette ._();
8
8
9
9
static const alpha = Colors .transparent;
Original file line number Diff line number Diff line change 1
- sealed class AppFonts {
1
+ import 'package:flutter_template/gen/fonts.gen.dart' ;
2
+
3
+ abstract interface class AppFonts {
2
4
AppFonts ._();
3
5
4
- static const roboto = 'Roboto' ;
6
+ static const roboto = FontFamily .roboto ;
5
7
6
8
static String get activeFontFamily => roboto;
7
9
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
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' ;
4
3
import 'package:theme_tailor_annotation/theme_tailor_annotation.dart' ;
5
4
6
5
part 'app_text_styles.tailor.dart' ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
2
2
import 'package:flutter_template/presentation/extensions/color_extensions.dart' ;
3
3
import 'package:flutter_template/presentation/resources/resources.dart' ;
4
4
5
- sealed class AppTheme {
5
+ abstract interface class AppTheme {
6
6
const AppTheme ._();
7
7
8
8
static ThemeData fromBrightness (Brightness brightness) {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
4
4
///
5
5
/// This class contains non-sensitive information and is designed to maintain consistency
6
6
/// across the app's UI elements.
7
- sealed class AppUiConstants {
7
+ abstract interface class AppUiConstants {
8
8
AppUiConstants ._();
9
9
10
10
// Animations
Original file line number Diff line number Diff line change 1
1
export 'package:flutter_template/presentation/resources/app_colors.dart' ;
2
2
export 'package:flutter_template/presentation/resources/app_fonts.dart' ;
3
- export 'package:flutter_template/presentation/resources/app_icons.dart' ;
4
3
export 'package:flutter_template/presentation/resources/app_images.dart' ;
5
4
export 'package:flutter_template/presentation/resources/app_text_styles.dart' ;
6
5
export 'package:flutter_template/presentation/resources/app_theme.dart' ;
You can’t perform that action at this time.
0 commit comments