From c1b79921c31a2901d0f49461ca3ed3c7b6d50dc6 Mon Sep 17 00:00:00 2001 From: faiyyazs Date: Thu, 23 Feb 2023 19:15:27 +0530 Subject: [PATCH 1/2] Add Project specific Base application State based on State Management --- app/lib/base/app_base_page.dart | 8 ++++++++ app/lib/feature/splash/splash_page.dart | 8 ++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 app/lib/base/app_base_page.dart diff --git a/app/lib/base/app_base_page.dart b/app/lib/base/app_base_page.dart new file mode 100644 index 0000000..c45fc0c --- /dev/null +++ b/app/lib/base/app_base_page.dart @@ -0,0 +1,8 @@ +import 'package:statemanagement_riverpod/statemanagement_riverpod.dart'; + +/// Project specific Base application State based on State Management +/// Define project related common behaviour or code here if any. +abstract class AppBasePageState> extends BaseStatefulPage { + +} diff --git a/app/lib/feature/splash/splash_page.dart b/app/lib/feature/splash/splash_page.dart index f7440f0..1700631 100644 --- a/app/lib/feature/splash/splash_page.dart +++ b/app/lib/feature/splash/splash_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:statemanagement_riverpod/statemanagement_riverpod.dart'; +import '../../base/app_base_page.dart'; import '../../di/states/viewmodels.dart'; import 'splash_page_model.dart'; import 'splash_page_view.dart'; @@ -13,7 +14,7 @@ class SplashPage extends BasePage { SplashPageState createState() => SplashPageState(); } -class SplashPageState extends BaseStatefulPage { +class SplashPageState extends AppBasePageState { @override ProviderBase provideBase() { return splashViewModelProvider; @@ -25,11 +26,6 @@ class SplashPageState extends BaseStatefulPage { model.exceptionHandlerBinder.bind(context, super.stateObserver); } - @override - bool extendBodyBehindAppBar() { - return true; - } - @override Widget buildView(BuildContext context, SplashViewModel model) { return SplashPageView(provideBase()); From ffb7ebbfb93c78911b7166f80be61ea0fa07c1c3 Mon Sep 17 00:00:00 2001 From: faiyyazs Date: Thu, 23 Feb 2023 19:18:23 +0530 Subject: [PATCH 2/2] Updated build script for local build creation --- app/scripts/build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/scripts/build.sh b/app/scripts/build.sh index c65643d..65de6bf 100755 --- a/app/scripts/build.sh +++ b/app/scripts/build.sh @@ -1,6 +1,7 @@ #!/bin/sh ENTRYPOINT="" +CURRENT_WORKSPACE="" PLIST_LOCATION=$RUNNER_TEMP/options.plist case $2 in @@ -9,11 +10,18 @@ case $2 in prod) ENTRYPOINT="entrypoints/main_prod.dart";; esac -FLAGS="$1 --flavor $2 -t $GITHUB_WORKSPACE/app/lib/$ENTRYPOINT $3 $4 $5" +if [[ -z "${GITHUB_WORKSPACE}" ]]; then + CURRENT_WORKSPACE="lib" +else + CURRENT_WORKSPACE="$GITHUB_WORKSPACE/app/lib" +fi + +FLAGS="$1 --flavor $2 -t $CURRENT_WORKSPACE/$ENTRYPOINT $3 $4 $5" echo "Requested Flavour: $2" -echo "Setting entrypoint: $GITHUB_WORKSPACE/app/lib/$ENTRYPOINT" +echo "Setting entrypoint: $CURRENT_WORKSPACE/$ENTRYPOINT" echo "Building $1 .......... " echo "" + if [ $1 == ipa ] then sed -i '' "s#.*entrypoints/main.*#import 'package:app/$ENTRYPOINT' as entrypoint;#" lib/main.dart