Skip to content

create splash page #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable-hdpi/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable-mdpi/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-v21/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions android/app/src/main/res/drawable-v21/launch_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>
21 changes: 21 additions & 0 deletions android/app/src/main/res/values-night-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#0a0a0e</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.

This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
4 changes: 4 additions & 0 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand Down
21 changes: 21 additions & 0 deletions android/app/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#0a0a0e</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.

This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
Binary file added assets/image/bank/bank_investment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/bank/bank_kakao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/bank/bank_shinhan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/bank/bank_toss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/benefit/benefit_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/benefit/benefit_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/benefit/benefit_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/benefit/benefit_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/benefit/benefit_05.png
Binary file added assets/image/benefit/benefit_06.png
Binary file added assets/image/credit_card/credit_cards.png
Binary file added assets/image/icon/map_point.png
Binary file added assets/image/icon/notification.png
Binary file added assets/image/icon/plus.png
Binary file added assets/image/icon/setting.png
Binary file added assets/image/icon/stock_calendar.png
Binary file added assets/image/icon/stock_search.png
Binary file added assets/image/icon/stock_settings.png
Binary file added assets/image/icon/toss.png
Binary file added assets/image/illustration/bulb.png
Binary file added assets/image/illustration/car.png
Binary file added assets/image/illustration/credit_score.png
Binary file added assets/image/notification/notification_idea.png
Binary file added assets/image/notification/notification_luck.png
Binary file added assets/image/notification/notification_stock.png
Binary file added assets/image/notification/notification_toss.png
Binary file added assets/image/notification/notification_walk.png
Binary file added assets/image/splash/android12.png
Binary file added assets/image/splash/splash.png
Binary file added assets/image/stock/interest_stock_01.png
Binary file added assets/image/stock/interest_stock_02.png
Binary file added assets/image/stock/interest_stock_03.png
Binary file added assets/image/stock/interest_stock_04.png
Binary file added assets/image/stock/interest_stock_05.png
Binary file added assets/image/stock/interest_stock_06.png
Binary file added assets/image/stock/interest_stock_07.png
Binary file added assets/image/stock/interest_stock_08.png
Binary file added assets/image/stock/interest_stock_09.png
Binary file added assets/image/stock/interest_stock_10.png
Binary file added assets/image/stock/interest_stock_11.png
Binary file added assets/image/stock/stock_01.png
Binary file added assets/image/stock/stock_02.png
Binary file added assets/image/stock/stock_03.png
Binary file added assets/image/stock/stock_04.png
Binary file added assets/image/stock/stock_05.png
Binary file added assets/image/stock/stock_06.png
Binary file added assets/image/stock/stock_heart_off.png
Binary file added assets/image/stock/stock_heart_on.png
Binary file added assets/image/stock/stock_korea.png
Binary file added assets/image/stock/stock_usa.png
8 changes: 4 additions & 4 deletions flutter_native_splash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ flutter_native_splash:
# of your splash screen to a solid color. Use background_image to set the background of your
# splash screen to a png image. This is useful for gradients. The image will be stretch to the
# size of the app. Only one parameter can be used, color and background_image cannot both be set.
color: "#ffffff"
color: "#0a0a0a"
#background_image: "assets/background.png"

# Optional parameters are listed below. To enable a parameter, uncomment the line by removing
# the leading # character.

# The image parameter allows you to specify an image used in the splash screen. It must be a
# png file and should be sized for 4x pixel density.
#image: assets/splash.png
image: assets/image/splash/splash.png

# The branding property allows you to specify an image used as branding in the splash screen.
# It must be a png file. It is supported for Android, iOS and the Web. For Android 12,
Expand Down Expand Up @@ -50,10 +50,10 @@ flutter_native_splash:
# 640 pixels in diameter.
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
# 768 pixels in diameter.
#image: assets/android12splash.png
image: assets/image/splash/android12.png

# Splash screen background color.
#color: "#42a5f5"
color: "#0a0a0e"

# App icon background color.
#icon_background_color: "#111111"
Expand Down
Binary file modified ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
Binary file modified ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]
2 changes: 1 addition & 1 deletion ios/Runner/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
<image name="LaunchImage" width="768" height="768"/>
<image name="LaunchBackground" width="1" height="1"/>
</resources>
</document>
3 changes: 3 additions & 0 deletions lib/common/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export 'widget/w_height_and_width.dart';
export 'widget/w_line.dart';
export 'widget/w_tap.dart';

export 'theme/color/abs_theme_colors.dart';
export 'theme/shadows/abs_theme_shadows.dart';

const defaultFontStyle = GoogleFonts.ptSerif;

void voidFunction() {}
3 changes: 0 additions & 3 deletions lib/common/constants.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
export 'theme/color/abs_theme_colors.dart';
export 'theme/shadows/abs_theme_shadows.dart';

const basePath = 'assets/image';
6 changes: 6 additions & 0 deletions lib/common/theme/color/abs_theme_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ abstract class AbstractThemeColors {
Color get snackbarBgColor => AppColors.mediumBlue;

Color get blueButtonBackground => AppColors.darkBlue;

Color get appBarBackground => const Color.fromARGB(255, 16, 16, 18);

Color get buttonBackground => const Color.fromARGB(255, 48, 48, 48);

Color get roundedLayoutBackground => const Color.fromARGB(255, 24, 24, 24);
}
28 changes: 28 additions & 0 deletions lib/common/widget/w_big_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:fast_app_base/common/common.dart';
import 'package:fast_app_base/common/widget/w_arrow.dart';
import 'package:fast_app_base/common/widget/w_rounded_container.dart';
import 'package:fast_app_base/screen/main/tab/home/banks_dummy.dart';
import 'package:flutter/material.dart';

class BigButton extends StatelessWidget {
final String text;
final VoidCallback onTap;

const BigButton(this.text, {super.key, required this.onTap});

@override
Widget build(BuildContext context) {
return Tap(
onTap: onTap,
child: RoundedContainer(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
text.text.white.size(20).bold.make(),
const Arrow(),
],
),
),
);
}
}
6 changes: 6 additions & 0 deletions lib/common/widget/w_height_and_width.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import 'package:flutter/material.dart';

const width10 = Width(10);
const width5 = Width(5);

const height10 = Height(10);
const height5 = Height(5);

class Height extends StatelessWidget {
final double height;

Expand Down
27 changes: 27 additions & 0 deletions lib/common/widget/w_rounded_container.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:fast_app_base/common/common.dart';
import 'package:flutter/material.dart';

class RoundedContainer extends StatelessWidget {
final Widget child;
final EdgeInsets padding;
final double radius;
final Color? backgroundColor;

const RoundedContainer(
{required this.child,
super.key,
this.radius = 20,
this.backgroundColor,
this.padding = const EdgeInsets.symmetric(horizontal: 20, vertical: 15)});

@override
Widget build(BuildContext context) {
return Container(
padding: padding,
decoration: BoxDecoration(
color: backgroundColor ?? context.appColors.roundedLayoutBackground,
borderRadius: BorderRadius.circular(radius)),
child: child,
);
}
}
4 changes: 3 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';

import 'app.dart';
import 'common/data/preference/app_preferences.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
final bindings = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: bindings);
await EasyLocalization.ensureInitialized();
await AppPreferences.init();

Expand Down
39 changes: 31 additions & 8 deletions lib/screen/main/s_main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:after_layout/after_layout.dart';
import 'package:fast_app_base/screen/main/tab/tab_item.dart';
import 'package:fast_app_base/screen/main/tab/tab_navigator.dart';
import 'package:flutter/material.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';

import '../../common/common.dart';
import 'w_menu_drawer.dart';
Expand All @@ -12,19 +14,36 @@ class MainScreen extends StatefulWidget {
State<MainScreen> createState() => MainScreenState();
}

class MainScreenState extends State<MainScreen> with SingleTickerProviderStateMixin {
class MainScreenState extends State<MainScreen>
with SingleTickerProviderStateMixin, AfterLayoutMixin {
TabItem _currentTab = TabItem.home;
final tabs = [TabItem.home, TabItem.favorite];
final tabs = [
TabItem.home,
TabItem.benefit,
TabItem.ttosspay,
TabItem.stock,
TabItem.all
];
final List<GlobalKey<NavigatorState>> navigatorKeys = [];

int get _currentIndex => tabs.indexOf(_currentTab);

GlobalKey<NavigatorState> get _currentTabNavigationKey => navigatorKeys[_currentIndex];
GlobalKey<NavigatorState> get _currentTabNavigationKey =>
navigatorKeys[_currentIndex];

bool get extendBody => true;

static double get bottomNavigationBarBorderRadius => 30.0;

static const double bottomNavigatorHeight = 50;

@override
FutureOr<void> afterFirstLayout(BuildContext context) {
delay(() {
FlutterNativeSplash.remove();
}, 1500.milliseconds);
}

@override
void initState() {
super.initState();
Expand All @@ -41,7 +60,8 @@ class MainScreenState extends State<MainScreen> with SingleTickerProviderStateMi
drawer: const MenuDrawer(),
body: Container(
color: context.appColors.seedColor.getMaterialColorValues[200],
padding: EdgeInsets.only(bottom: extendBody ? 60 - bottomNavigationBarBorderRadius : 0),
padding: EdgeInsets.only(
bottom: extendBody ? 60 - bottomNavigationBarBorderRadius : 0),
child: SafeArea(
bottom: !extendBody,
child: pages,
Expand All @@ -53,7 +73,8 @@ class MainScreenState extends State<MainScreen> with SingleTickerProviderStateMi
}

bool get isRootPage =>
_currentTab == TabItem.home && _currentTabNavigationKey.currentState?.canPop() == false;
_currentTab == TabItem.home &&
_currentTabNavigationKey.currentState?.canPop() == false;

IndexedStack get pages => IndexedStack(
index: _currentIndex,
Expand Down Expand Up @@ -123,13 +144,15 @@ class MainScreenState extends State<MainScreen> with SingleTickerProviderStateMi
});
}

BottomNavigationBarItem bottomItem(
bool activate, IconData iconData, IconData inActivateIconData, String label) {
BottomNavigationBarItem bottomItem(bool activate, IconData iconData,
IconData inActivateIconData, String label) {
return BottomNavigationBarItem(
icon: Icon(
key: ValueKey(label),
activate ? iconData : inActivateIconData,
color: activate ? context.appColors.iconButton : context.appColors.iconButtonInactivate,
color: activate
? context.appColors.iconButton
: context.appColors.iconButtonInactivate,
),
label: label);
}
Expand Down
Loading