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

Merge branch '43-remove-swipe-pages' into 'master'

Resolve "Remove swipe pages"

Closes #43

See merge request !43
parents d0dc9bf7 1ab6e151
No related branches found
No related tags found
1 merge request!43Resolve "Remove swipe pages"
Pipeline #5683 passed
...@@ -37,7 +37,7 @@ if (keystorePropertiesFile.exists()) { ...@@ -37,7 +37,7 @@ if (keystorePropertiesFile.exists()) {
} }
android { android {
compileSdkVersion 33 compileSdkVersion 34
namespace "org.benoitharrault.minehunter" namespace "org.benoitharrault.minehunter"
defaultConfig { defaultConfig {
......
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.1.18 app.versionName=0.1.19
app.versionCode=39 app.versionCode=40
Remove "swipe" to navigate between pages.
Suppression du "glisser" pour naviguer entre les pages.
...@@ -39,11 +39,9 @@ final ColorScheme lightColorScheme = ColorScheme.light( ...@@ -39,11 +39,9 @@ final ColorScheme lightColorScheme = ColorScheme.light(
secondary: primarySwatch.shade500, secondary: primarySwatch.shade500,
onSecondary: Colors.white, onSecondary: Colors.white,
error: errorColor, error: errorColor,
background: textSwatch.shade200,
onBackground: textSwatch.shade500,
onSurface: textSwatch.shade500, onSurface: textSwatch.shade500,
surface: textSwatch.shade50, surface: textSwatch.shade50,
surfaceVariant: Colors.white, surfaceContainerHighest: Colors.white,
shadow: textSwatch.shade900.withOpacity(.1), shadow: textSwatch.shade900.withOpacity(.1),
); );
...@@ -52,11 +50,9 @@ final ColorScheme darkColorScheme = ColorScheme.dark( ...@@ -52,11 +50,9 @@ final ColorScheme darkColorScheme = ColorScheme.dark(
secondary: primarySwatch.shade500, secondary: primarySwatch.shade500,
onSecondary: Colors.white, onSecondary: Colors.white,
error: errorColor, error: errorColor,
background: const Color(0xFF171724),
onBackground: textSwatch.shade400,
onSurface: textSwatch.shade300, onSurface: textSwatch.shade300,
surface: const Color(0xFF262630), surface: const Color(0xFF262630),
surfaceVariant: const Color(0xFF282832), surfaceContainerHighest: const Color(0xFF282832),
shadow: textSwatch.shade900.withOpacity(.2), shadow: textSwatch.shade900.withOpacity(.2),
); );
......
...@@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; ...@@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart'; import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:overlay_support/overlay_support.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -55,8 +54,7 @@ class MyApp extends StatelessWidget { ...@@ -55,8 +54,7 @@ class MyApp extends StatelessWidget {
create: (BuildContext context) => Data(), create: (BuildContext context) => Data(),
child: Consumer<Data>( child: Consumer<Data>(
builder: (context, data, child) { builder: (context, data, child) {
return OverlaySupport( return MaterialApp(
child: MaterialApp(
title: 'Minehunter', title: 'Minehunter',
home: const SkeletonScreen(), home: const SkeletonScreen(),
...@@ -70,7 +68,6 @@ class MyApp extends StatelessWidget { ...@@ -70,7 +68,6 @@ class MyApp extends StatelessWidget {
supportedLocales: context.supportedLocales, supportedLocales: context.supportedLocales,
locale: context.locale, locale: context.locale,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
),
); );
}, },
), ),
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_swipe/flutter_swipe.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:minehunter/config/menu.dart'; import 'package:minehunter/config/menu.dart';
...@@ -24,26 +23,20 @@ class _SkeletonScreenState extends State<SkeletonScreen> { ...@@ -24,26 +23,20 @@ class _SkeletonScreenState extends State<SkeletonScreen> {
return Scaffold( return Scaffold(
extendBodyBehindAppBar: false, extendBodyBehindAppBar: false,
appBar: StandardAppBar(myProvider: myProvider), appBar: StandardAppBar(myProvider: myProvider),
body: Swiper( body: BlocBuilder<BottomNavCubit, int>(
itemCount: Menu.itemsCount, builder: (BuildContext context, int pageIndex) {
itemBuilder: (BuildContext context, int index) { return Padding(
return Menu.getPageWidget(index); padding: const EdgeInsets.only(
}, top: 8,
pagination: SwiperPagination( left: 2,
margin: const EdgeInsets.all(0), right: 2,
builder: SwiperCustomPagination(
builder: (BuildContext context, SwiperPluginConfig config) {
return BottomNavBar(swipeController: config.controller);
},
), ),
), child: Menu.getPageWidget(pageIndex),
onIndexChanged: (newPageIndex) { );
BlocProvider.of<BottomNavCubit>(context).updateIndex(newPageIndex);
}, },
outer: true,
loop: false,
), ),
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: Theme.of(context).colorScheme.surface,
bottomNavigationBar: const BottomNavBar(),
); );
} }
} }
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:overlay_support/overlay_support.dart';
import 'package:minehunter/provider/data.dart'; import 'package:minehunter/provider/data.dart';
import 'package:minehunter/ui/widgets/header_app.dart'; import 'package:minehunter/ui/widgets/header_app.dart';
...@@ -17,12 +15,12 @@ class StandardAppBar extends StatelessWidget implements PreferredSizeWidget { ...@@ -17,12 +15,12 @@ class StandardAppBar extends StatelessWidget implements PreferredSizeWidget {
if (myProvider.gameIsRunning) { if (myProvider.gameIsRunning) {
menuActions.add(TextButton( menuActions.add(TextButton(
onPressed: null,
onLongPress: () => GameUtils.quitGame(myProvider),
child: const Image( child: const Image(
image: AssetImage('assets/icons/button_back.png'), image: AssetImage('assets/icons/button_back.png'),
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
onPressed: () => toast(tr('long_press_to_quit')),
onLongPress: () => GameUtils.quitGame(myProvider),
)); ));
} }
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_swipe/flutter_swipe.dart';
import 'package:minehunter/config/menu.dart'; import 'package:minehunter/config/menu.dart';
import 'package:minehunter/cubit/bottom_nav_cubit.dart'; import 'package:minehunter/cubit/bottom_nav_cubit.dart';
class BottomNavBar extends StatelessWidget { class BottomNavBar extends StatelessWidget {
const BottomNavBar({super.key, required this.swipeController}); const BottomNavBar({super.key});
final SwiperController swipeController;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -16,7 +13,7 @@ class BottomNavBar extends StatelessWidget { ...@@ -16,7 +13,7 @@ class BottomNavBar extends StatelessWidget {
margin: const EdgeInsets.all(0), margin: const EdgeInsets.all(0),
elevation: 4, elevation: 4,
shadowColor: Theme.of(context).colorScheme.shadow, shadowColor: Theme.of(context).colorScheme.shadow,
color: Theme.of(context).colorScheme.surfaceVariant, color: Theme.of(context).colorScheme.surfaceContainerHighest,
shape: const ContinuousRectangleBorder(), shape: const ContinuousRectangleBorder(),
child: BlocBuilder<BottomNavCubit, int>( child: BlocBuilder<BottomNavCubit, int>(
builder: (BuildContext context, int state) { builder: (BuildContext context, int state) {
...@@ -24,7 +21,6 @@ class BottomNavBar extends StatelessWidget { ...@@ -24,7 +21,6 @@ class BottomNavBar extends StatelessWidget {
currentIndex: state, currentIndex: state,
onTap: (int index) { onTap: (int index) {
context.read<BottomNavCubit>().updateIndex(index); context.read<BottomNavCubit>().updateIndex(index);
swipeController.move(index);
}, },
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
elevation: 0, elevation: 0,
......
...@@ -5,10 +5,10 @@ packages: ...@@ -5,10 +5,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: args name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.2" version: "2.5.0"
async: async:
dependency: transitive dependency: transitive
description: description:
...@@ -21,10 +21,10 @@ packages: ...@@ -21,10 +21,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: bloc name: bloc
sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "8.1.3" version: "8.1.4"
characters: characters:
dependency: transitive dependency: transitive
description: description:
...@@ -61,10 +61,10 @@ packages: ...@@ -61,10 +61,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: easy_localization name: easy_localization
sha256: c145aeb6584aedc7c862ab8c737c3277788f47488bfdf9bae0fe112bd0a4789c sha256: fa59bcdbbb911a764aa6acf96bbb6fa7a5cf8234354fc45ec1a43a0349ef0201
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.5" version: "3.0.7"
easy_logger: easy_logger:
dependency: transitive dependency: transitive
description: description:
...@@ -106,31 +106,23 @@ packages: ...@@ -106,31 +106,23 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_bloc name: flutter_bloc
sha256: "87325da1ac757fcc4813e6b34ed5dd61169973871fdf181d6c2109dd6935ece1" sha256: f0ecf6e6eb955193ca60af2d5ca39565a86b8a142452c5b24d96fb477428f4d2
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "8.1.4" version: "8.1.5"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "4.0.0"
flutter_localizations: flutter_localizations:
dependency: transitive dependency: transitive
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_swipe:
dependency: "direct main"
description:
name: flutter_swipe
sha256: dc6541bac3a0545ce15a3fa15913f6250532062960bf6b0ad4562d02f14a8545
url: "https://pub.dev"
source: hosted
version: "1.0.1"
flutter_web_plugins: flutter_web_plugins:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -148,10 +140,10 @@ packages: ...@@ -148,10 +140,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: http name: http
sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
...@@ -164,26 +156,26 @@ packages: ...@@ -164,26 +156,26 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: hydrated_bloc name: hydrated_bloc
sha256: "00a2099680162e74b5a836b8a7f446e478520a9cae9f6032e028ad8129f4432d" sha256: af35b357739fe41728df10bec03aad422cdc725a1e702e03af9d2a41ea05160c
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.1.4" version: "9.1.5"
intl: intl:
dependency: transitive dependency: transitive
description: description:
name: intl name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.18.1" version: "0.19.0"
lints: lints:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.0" version: "4.0.0"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
...@@ -196,10 +188,10 @@ packages: ...@@ -196,10 +188,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.0" version: "1.12.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:
...@@ -208,30 +200,22 @@ packages: ...@@ -208,30 +200,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
overlay_support:
dependency: "direct main"
description:
name: overlay_support
sha256: fc39389bfd94e6985e1e13b2a88a125fc4027608485d2d4e2847afe1b2bb339c
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_info_plus: package_info_plus:
dependency: "direct main" dependency: "direct main"
description: description:
name: package_info_plus name: package_info_plus
sha256: "88bc797f44a94814f2213db1c9bd5badebafdfb8290ca9f78d4b9ee2a3db4d79" sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.0.1" version: "8.0.0"
package_info_plus_platform_interface: package_info_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_platform_interface name: package_info_plus_platform_interface
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.1" version: "3.0.0"
path: path:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -244,26 +228,26 @@ packages: ...@@ -244,26 +228,26 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: path_provider name: path_provider
sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.2" version: "2.1.3"
path_provider_android: path_provider_android:
dependency: transitive dependency: transitive
description: description:
name: path_provider_android name: path_provider_android
sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.2" version: "2.2.4"
path_provider_foundation: path_provider_foundation:
dependency: transitive dependency: transitive
description: description:
name: path_provider_foundation name: path_provider_foundation
sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.2" version: "2.4.0"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
...@@ -316,26 +300,26 @@ packages: ...@@ -316,26 +300,26 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: shared_preferences name: shared_preferences
sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.2" version: "2.2.3"
shared_preferences_android: shared_preferences_android:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_android name: shared_preferences_android
sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.1" version: "2.2.2"
shared_preferences_foundation: shared_preferences_foundation:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_foundation name: shared_preferences_foundation
sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c" sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.5" version: "2.4.0"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
...@@ -356,10 +340,10 @@ packages: ...@@ -356,10 +340,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_web name: shared_preferences_web
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.2" version: "2.3.0"
shared_preferences_windows: shared_preferences_windows:
dependency: transitive dependency: transitive
description: description:
...@@ -433,18 +417,18 @@ packages: ...@@ -433,18 +417,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05" sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.4.2" version: "0.5.1"
win32: win32:
dependency: transitive dependency: transitive
description: description:
name: win32 name: win32
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.2.0" version: "5.5.1"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
...@@ -454,5 +438,5 @@ packages: ...@@ -454,5 +438,5 @@ packages:
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
sdks: sdks:
dart: ">=3.3.0-279.1.beta <4.0.0" dart: ">=3.4.0 <4.0.0"
flutter: ">=3.16.0" flutter: ">=3.19.0"
...@@ -2,7 +2,7 @@ name: minehunter ...@@ -2,7 +2,7 @@ name: minehunter
description: A minehunter game application. description: A minehunter game application.
publish_to: 'none' publish_to: 'none'
version: 0.1.18+39 version: 0.1.19+40
environment: environment:
sdk: '^3.0.0' sdk: '^3.0.0'
...@@ -14,19 +14,17 @@ dependencies: ...@@ -14,19 +14,17 @@ dependencies:
easy_localization: ^3.0.1 easy_localization: ^3.0.1
equatable: ^2.0.5 equatable: ^2.0.5
flutter_bloc: ^8.1.1 flutter_bloc: ^8.1.1
flutter_swipe: ^1.0.1
hive: ^2.2.3 hive: ^2.2.3
hydrated_bloc: ^9.0.0 hydrated_bloc: ^9.0.0
overlay_support: ^2.1.0
provider: ^6.0.5 provider: ^6.0.5
shared_preferences: ^2.2.1 shared_preferences: ^2.2.1
package_info_plus: ^5.0.1 package_info_plus: ^8.0.0
path: ^1.9.0 path: ^1.9.0
path_provider: ^2.0.11 path_provider: ^2.0.11
unicons: ^2.1.1 unicons: ^2.1.1
dev_dependencies: dev_dependencies:
flutter_lints: ^3.0.1 flutter_lints: ^4.0.0
flutter: flutter:
uses-material-design: true uses-material-design: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment