Skip to content
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

Develop #6

Merged
merged 6 commits into from
May 20, 2024
Merged
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
Binary file added assets/images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 16 additions & 12 deletions lib/features/core/structural/core_scaffold.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:rabenkorb/features/core/display/loading_overlay.dart';
import 'package:rabenkorb/shared/widgets/display/background_image.dart';

class CoreScaffold extends StatelessWidget {
final String? titleText;
Expand Down Expand Up @@ -28,18 +29,21 @@ class CoreScaffold extends StatelessWidget {
return LoadingOverlay(
child: GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
key: scaffoldKey,
// backgroundColor: Colors.transparent,
appBar: appBar,
body: body != null
? SafeArea(
child: body!,
)
: null,
drawer: drawer,
bottomNavigationBar: bottomNavigationBar,
floatingActionButton: floatingActionButton,
child: BackgroundImage(
image: "assets/images/background.png",
child: Scaffold(
key: scaffoldKey,
backgroundColor: Colors.transparent,
appBar: appBar,
body: body != null
? SafeArea(
child: body!,
)
: null,
drawer: drawer,
bottomNavigationBar: bottomNavigationBar,
floatingActionButton: floatingActionButton,
),
),
),
);
Expand Down
9 changes: 6 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:rabenkorb/di/di_setup.dart';
import 'package:rabenkorb/features/core/error/error_handler.dart';
import 'package:rabenkorb/routing/router_config.dart';
import 'package:rabenkorb/services/state/intl_state_service.dart';
import 'package:rabenkorb/themes/core_theme.dart';
import 'package:watch_it/watch_it.dart';

import 'generated/l10n.dart';
Expand Down Expand Up @@ -33,9 +34,11 @@ class MainApp extends StatelessWidget with WatchItMixin {
],
supportedLocales: S.delegate.supportedLocales,
locale: locale.data,
theme: ThemeData(
useMaterial3: true,
),
theme: const MaterialTheme(TextTheme()).light(),
darkTheme: const MaterialTheme(TextTheme()).dark(),
highContrastTheme: const MaterialTheme(TextTheme()).lightHighContrast(),
highContrastDarkTheme: const MaterialTheme(TextTheme()).darkHighContrast(),
themeMode: ThemeMode.light,
routerConfig: routerConfig,
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/services/core/version_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:rabenkorb/services/core/environment_service.dart';
import 'package:watch_it/watch_it.dart';

class VersionService {
static const String _styleVersion = "0";
static const String _styleVersion = "2";
static const String _debugSuffix = ".db-0";

late String _packageVersion;
Expand Down
23 changes: 23 additions & 0 deletions lib/shared/widgets/display/background_image.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';

class BackgroundImage extends StatelessWidget {
final Widget child;
final String image;

const BackgroundImage({super.key, required this.child, required this.image});

@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.background,
image: DecorationImage(
image: AssetImage(image),
fit: BoxFit.cover,
opacity: 0.2,
),
),
child: child,
);
}
}
Loading
Loading