Skip to content
Snippets Groups Projects
Commit f069c618 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Normalize app architecture

parent 64606b97
No related branches found
No related tags found
1 merge request!8Resolve "Normalize game architecture"
Pipeline #5733 passed
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:stopmotion/ui/widgets/app_titles.dart';
import 'package:stopmotion/ui/widgets/settings_form.dart';
import 'package:unicons/unicons.dart';
import 'package:stopmotion/ui/settings/settings_form.dart';
import 'package:stopmotion/ui/helpers/app_titles.dart';
class ScreenSettings extends StatelessWidget {
const ScreenSettings({super.key});
static Icon navBarIcon = const Icon(UniconsLine.setting);
static String navBarText = 'bottom_nav_settings';
@override
Widget build(BuildContext context) {
return Material(
color: Theme.of(context).colorScheme.background,
child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 4),
physics: const BouncingScrollPhysics(),
return const Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
const SizedBox(height: 8),
AppTitle1(text: tr('settings_title')),
const SettingsForm(),
SizedBox(height: 8),
AppTitle(text: 'settings_title'),
SizedBox(height: 8),
SettingsForm(),
],
),
);
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:unicons/unicons.dart';
import 'package:stopmotion/config/default_settings.dart';
import 'package:stopmotion/cubit/settings_cubit.dart';
import 'package:stopmotion/ui/widgets/app_titles.dart';
import 'package:stopmotion/ui/settings/theme_card.dart';
class SettingsForm extends StatefulWidget {
const SettingsForm({super.key});
......@@ -14,68 +12,52 @@ class SettingsForm extends StatefulWidget {
}
class _SettingsFormState extends State<SettingsForm> {
int dummyValue = DefaultSettings.defaultDummyValue;
List<bool> _selectedDummyValue = [];
@override
void didChangeDependencies() {
SettingsCubit settings = BlocProvider.of<SettingsCubit>(context);
dummyValue = settings.getDummyValue();
_selectedDummyValue =
DefaultSettings.allowedDummyValues.map((e) => (e == dummyValue)).toList();
super.didChangeDependencies();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
void saveSettings() {
BlocProvider.of<SettingsCubit>(context).setValues(
dummyValue: dummyValue,
);
void didChangeDependencies() {
super.didChangeDependencies();
}
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
const SizedBox(height: 8),
AppTitle2(text: tr('settings_title_global')),
// Dummy value
// Light/dark theme
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
const Text('settings_label_theme').tr(),
const Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text('settings_label_dummy_value').tr(),
ToggleButtons(
onPressed: (int index) {
setState(() {
dummyValue = DefaultSettings.allowedDummyValues[index];
for (int i = 0; i < _selectedDummyValue.length; i++) {
_selectedDummyValue[i] = i == index;
}
});
saveSettings();
},
borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
isSelected: _selectedDummyValue,
children:
DefaultSettings.allowedDummyValues.map((e) => Text(e.toString())).toList(),
ThemeCard(
mode: ThemeMode.system,
icon: UniconsLine.cog,
),
ThemeCard(
mode: ThemeMode.light,
icon: UniconsLine.sun,
),
ThemeCard(
mode: ThemeMode.dark,
icon: UniconsLine.moon,
)
],
),
],
),
const SizedBox(height: 16),
],
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:stopmotion/cubit/theme_cubit.dart';
class ThemeCard extends StatelessWidget {
const ThemeCard({
super.key,
required this.mode,
required this.icon,
});
final IconData icon;
final ThemeMode mode;
@override
Widget build(BuildContext context) {
return BlocBuilder<ThemeCubit, ThemeModeState>(
builder: (BuildContext context, ThemeModeState state) {
return Card(
elevation: 2,
shadowColor: Theme.of(context).colorScheme.shadow,
color: state.themeMode == mode
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.surface,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
margin: const EdgeInsets.all(5),
child: InkWell(
onTap: () => BlocProvider.of<ThemeCubit>(context).getTheme(
ThemeModeState(themeMode: mode),
),
borderRadius: const BorderRadius.all(Radius.circular(12)),
child: Icon(
icon,
size: 32,
color: state.themeMode != mode
? Theme.of(context).colorScheme.primary
: Colors.white,
),
),
);
},
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:stopmotion/cubit/bottom_nav_cubit.dart';
import 'package:stopmotion/ui/screens/camera.dart';
import 'package:stopmotion/ui/screens/home.dart';
import 'package:stopmotion/ui/screens/settings.dart';
import 'package:stopmotion/ui/widgets/app_bar.dart';
import 'package:stopmotion/ui/widgets/bottom_nav_bar.dart';
import 'package:stopmotion/config/screen.dart';
import 'package:stopmotion/cubit/nav_cubit_screens.dart';
import 'package:stopmotion/ui/nav/global_app_bar.dart';
import 'package:stopmotion/ui/nav/bottom_nav_bar.dart';
class SkeletonScreen extends StatefulWidget {
class SkeletonScreen extends StatelessWidget {
const SkeletonScreen({super.key});
@override
State<SkeletonScreen> createState() => _SkeletonScreenState();
}
class _SkeletonScreenState extends State<SkeletonScreen> {
@override
Widget build(BuildContext context) {
List<Widget> pageNavigation = <Widget>[
const ScreenHome(),
const ScreenCamera(),
const ScreenSettings(),
];
return BlocBuilder<NavCubitScreen, int>(
builder: (BuildContext context, int screenIndex) {
return Scaffold(
appBar: const StandardAppBar(),
appBar: const GlobalAppBar(),
extendBodyBehindAppBar: false,
body: BlocBuilder<BottomNavCubit, int>(
builder: (BuildContext context, int state) {
return AnimatedSwitcher(
duration: const Duration(milliseconds: 300),
child: pageNavigation.elementAt(state),
body: Material(
color: Theme.of(context).colorScheme.surface,
child: Padding(
padding: const EdgeInsets.only(
top: 8,
left: 2,
right: 2,
),
child: Screen.getWidget(screenIndex),
),
),
backgroundColor: Theme.of(context).colorScheme.surface,
bottomNavigationBar:
Screen.displayBottomNavBar(screenIndex) ? const BottomNavBar() : null,
);
},
),
backgroundColor: Theme.of(context).colorScheme.background,
bottomNavigationBar: const BottomNavBar(),
);
}
}
import 'package:flutter/material.dart';
import 'package:stopmotion/ui/widgets/app_titles.dart';
class StandardAppBar extends StatelessWidget implements PreferredSizeWidget {
const StandardAppBar({super.key});
@override
Widget build(BuildContext context) {
return AppBar(
title: const AppTitle(text: 'app_name'),
actions: const [],
);
}
@override
Size get preferredSize => const Size.fromHeight(50);
}
......@@ -5,42 +5,50 @@ packages:
dependency: transitive
description:
name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
url: "https://pub.dev"
source: hosted
version: "2.4.2"
version: "2.5.0"
async:
dependency: transitive
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.11.0"
bloc:
dependency: transitive
description:
name: bloc
sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e
sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e"
url: "https://pub.dev"
source: hosted
version: "8.1.3"
version: "8.1.4"
camera:
dependency: "direct main"
description:
name: camera
sha256: "9499cbc2e51d8eb0beadc158b288380037618ce4e30c9acbc4fae1ac3ecb5797"
sha256: "2170a943dcb67be2af2c6bcda8775e74b41d4c02d6a4eb10bdc832ee185c4eea"
url: "https://pub.dev"
source: hosted
version: "0.10.5+9"
camera_android:
version: "0.11.0+1"
camera_android_camerax:
dependency: transitive
description:
name: camera_android
sha256: "351429510121d179b9aac5a2e8cb525c3cd6c39f4d709c5f72dfb21726e52371"
name: camera_android_camerax
sha256: "7abb0faddbf103c59365e805ad9a30ab4d602b2eb7a8de469697945fd4a69daa"
url: "https://pub.dev"
source: hosted
version: "0.10.8+16"
version: "0.6.5+6"
camera_avfoundation:
dependency: transitive
description:
name: camera_avfoundation
sha256: "7d0763dfcbf060f56aa254a68c103210280bee9e97bbe4fdef23e257a4f70ab9"
sha256: "7d021e8cd30d9b71b8b92b4ad669e80af432d722d18d6aac338572754a786c15"
url: "https://pub.dev"
source: hosted
version: "0.9.14"
version: "0.9.16"
camera_platform_interface:
dependency: transitive
description:
......@@ -53,10 +61,10 @@ packages:
dependency: transitive
description:
name: camera_web
sha256: f18ccfb33b2a7c49a52ad5aa3f07330b7422faaecbdfd9b9fe8e51182f6ad67d
sha256: "9e9aba2fbab77ce2472924196ff8ac4dd8f9126c4f9a3096171cd1d870d6b26c"
url: "https://pub.dev"
source: hosted
version: "0.3.2+4"
version: "0.3.3"
characters:
dependency: transitive
description:
......@@ -101,10 +109,10 @@ packages:
dependency: "direct main"
description:
name: easy_localization
sha256: c145aeb6584aedc7c862ab8c737c3277788f47488bfdf9bae0fe112bd0a4789c
sha256: fa59bcdbbb911a764aa6acf96bbb6fa7a5cf8234354fc45ec1a43a0349ef0201
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.7"
easy_logger:
dependency: transitive
description:
......@@ -146,18 +154,18 @@ packages:
dependency: "direct main"
description:
name: flutter_bloc
sha256: "87325da1ac757fcc4813e6b34ed5dd61169973871fdf181d6c2109dd6935ece1"
sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a
url: "https://pub.dev"
source: hosted
version: "8.1.4"
version: "8.1.6"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "4.0.0"
flutter_localizations:
dependency: transitive
description: flutter
......@@ -167,10 +175,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
sha256: c6b0b4c05c458e1c01ad9bcc14041dd7b1f6783d487be4386f793f47a8a4d03e
url: "https://pub.dev"
source: hosted
version: "2.0.17"
version: "2.0.20"
flutter_web_plugins:
dependency: transitive
description: flutter
......@@ -184,30 +192,46 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.3"
http:
dependency: transitive
description:
name: http
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
hydrated_bloc:
dependency: "direct main"
description:
name: hydrated_bloc
sha256: "00a2099680162e74b5a836b8a7f446e478520a9cae9f6032e028ad8129f4432d"
sha256: af35b357739fe41728df10bec03aad422cdc725a1e702e03af9d2a41ea05160c
url: "https://pub.dev"
source: hosted
version: "9.1.4"
version: "9.1.5"
intl:
dependency: transitive
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.18.1"
version: "0.19.0"
lints:
dependency: transitive
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "4.0.0"
material_color_utilities:
dependency: transitive
description:
......@@ -220,10 +244,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.12.0"
nested:
dependency: transitive
description:
......@@ -232,6 +256,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0
url: "https://pub.dev"
source: hosted
version: "8.0.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e
url: "https://pub.dev"
source: hosted
version: "3.0.0"
path:
dependency: "direct main"
description:
......@@ -244,26 +284,26 @@ packages:
dependency: "direct main"
description:
name: path_provider
sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b
sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.3"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668"
sha256: bca87b0165ffd7cdb9cad8edd22d18d2201e886d9a9f19b4fb3452ea7df3a72a
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.2.6"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f"
sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.4.0"
path_provider_linux:
dependency: transitive
description:
......@@ -292,10 +332,10 @@ packages:
dependency: transitive
description:
name: platform
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
url: "https://pub.dev"
source: hosted
version: "3.1.4"
version: "3.1.5"
plugin_platform_interface:
dependency: transitive
description:
......@@ -316,26 +356,26 @@ packages:
dependency: transitive
description:
name: shared_preferences
sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.2.3"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06"
sha256: "93d0ec9dd902d85f326068e6a899487d1f65ffcd5798721a95330b26c8131577"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
version: "2.2.3"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c"
sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7"
url: "https://pub.dev"
source: hosted
version: "2.3.5"
version: "2.4.0"
shared_preferences_linux:
dependency: transitive
description:
......@@ -373,6 +413,14 @@ packages:
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
stream_transform:
dependency: transitive
description:
......@@ -381,6 +429,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
synchronized:
dependency: transitive
description:
......@@ -389,6 +445,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.0+1"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted
version: "1.2.1"
typed_data:
dependency: transitive
description:
......@@ -401,10 +465,10 @@ packages:
dependency: "direct main"
description:
name: unicons
sha256: dbfcf93ff4d4ea19b324113857e358e4882115ab85db04417a4ba1c72b17a670
sha256: "1cca7462df18ff191b7e41b52f747d08854916531d1d7ab7cec0552095995206"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
vector_math:
dependency: transitive
description:
......@@ -417,18 +481,18 @@ packages:
dependency: transitive
description:
name: web
sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad"
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.5.1"
win32:
dependency: transitive
description:
name: win32
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
url: "https://pub.dev"
source: hosted
version: "5.2.0"
version: "5.5.1"
xdg_directories:
dependency: transitive
description:
......@@ -438,5 +502,5 @@ packages:
source: hosted
version: "1.0.4"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.22.0"
name: stopmotion
description: stop motion assistant
publish_to: 'none'
publish_to: "none"
version: 0.0.7+7
version: 0.0.8+8
environment:
sdk: '^3.0.0'
sdk: "^3.0.0"
dependencies:
flutter:
sdk: flutter
camera: ^0.10.5+8
# base
easy_localization: ^3.0.1
equatable: ^2.0.5
flutter_bloc: ^8.1.1
hive: ^2.2.3
hydrated_bloc: ^9.0.0
path: ^1.8.3
path_provider: ^2.1.1
package_info_plus: ^8.0.0
path_provider: ^2.0.11
unicons: ^2.1.1
# specific
camera: ^0.11.0+1
path: ^1.8.3
dev_dependencies:
flutter_lints: ^3.0.1
flutter_lints: ^4.0.0
flutter:
uses-material-design: false
uses-material-design: true
assets:
- assets/translations/
......@@ -41,3 +45,4 @@ flutter:
weight: 400
- asset: assets/fonts/Nunito-Light.ttf
weight: 300
......@@ -6,7 +6,7 @@ command -v scour >/dev/null 2>&1 || { echo >&2 "I require scour but it's not ins
command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not installed. Aborting."; exit 1; }
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BASE_DIR="$(dirname "${CURRENT_DIR}")"
BASE_DIR="$(dirname "$(dirname "${CURRENT_DIR}")")"
SOURCE_ICON="${CURRENT_DIR}/icon.svg"
SOURCE_FASTLANE="${CURRENT_DIR}/featureGraphic.svg"
......
File moved
File moved
#! /bin/bash
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
${CURRENT_DIR}/app/build_application_resources.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment