Skip to content

Commit

Permalink
use assets_gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Leptopoda committed Oct 15, 2022
1 parent b28fba9 commit ac508c7
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 8 deletions.
36 changes: 36 additions & 0 deletions lib/assets.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/schedule/ui/dailyschedule/daily_schedule_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:dhbwstudentapp/assets.dart';
import 'package:dhbwstudentapp/common/i18n/localizations.dart';
import 'package:dhbwstudentapp/common/ui/text_styles.dart';
import 'package:dhbwstudentapp/schedule/ui/dailyschedule/widgets/current_time_indicator_widget.dart';
Expand Down Expand Up @@ -73,7 +74,7 @@ class _DailySchedulePageState extends State<DailySchedulePage> {
padding: const EdgeInsets.fromLTRB(32, 64, 32, 32),
child: Opacity(
opacity: 0.9,
child: Image.asset("assets/empty_state.png"),
child: Image.asset(Assets.assets_empty_state_png),
),
)
],
Expand Down
5 changes: 3 additions & 2 deletions lib/schedule/ui/widgets/schedule_empty_state.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:dhbwstudentapp/assets.dart';
import 'package:dhbwstudentapp/common/i18n/localizations.dart';
import 'package:dhbwstudentapp/schedule/ui/widgets/select_source_dialog.dart';
import 'package:dhbwstudentapp/ui/banner_widget.dart';
Expand All @@ -6,8 +7,8 @@ import 'package:kiwi/kiwi.dart';

class ScheduleEmptyState extends StatelessWidget {
final Map<Brightness, String> image = {
Brightness.dark: "assets/schedule_empty_state_dark.png",
Brightness.light: "assets/schedule_empty_state.png",
Brightness.dark: Assets.assets_schedule_empty_state_dark_png,
Brightness.light: Assets.assets_schedule_empty_state_png,
};

@override
Expand Down
9 changes: 5 additions & 4 deletions lib/ui/onboarding/widgets/onboarding_page_background.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:dhbwstudentapp/assets.dart';
import 'package:dhbwstudentapp/common/math/math.dart';
import 'package:dhbwstudentapp/common/ui/colors.dart';
import 'package:dhbwstudentapp/common/util/platform_util.dart';
Expand All @@ -11,13 +12,13 @@ class OnboardingPageBackground extends StatelessWidget {
final Animation<double> bottomBackground;

final Map<Brightness, String> foreground = {
Brightness.light: "assets/onboarding_bottom_foreground.png",
Brightness.dark: "assets/onboarding_bottom_foreground_dark.png",
Brightness.light: Assets.assets_onboarding_bottom_foreground_png,
Brightness.dark: Assets.assets_onboarding_bottom_foreground_dark_png,
};

final Map<Brightness, String> background = {
Brightness.light: "assets/onboarding_bottom_background.png",
Brightness.dark: "assets/onboarding_bottom_background_dark.png",
Brightness.light: Assets.assets_onboarding_bottom_background_png,
Brightness.dark: Assets.assets_onboarding_bottom_background_dark_png,
};

OnboardingPageBackground({Key? key, required this.controller})
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/settings/settings_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:dhbwstudentapp/assets.dart';
import 'package:dhbwstudentapp/common/application_constants.dart';
import 'package:dhbwstudentapp/common/background/task_callback.dart';
import 'package:dhbwstudentapp/common/background/work_scheduler_service.dart';
Expand Down Expand Up @@ -95,7 +96,7 @@ class _SettingsPageState extends State<SettingsPage> {
showAboutDialog(
context: context,
applicationIcon: Image.asset(
"assets/app_icon.png",
Assets.assets_app_icon_png,
width: 75,
),
applicationLegalese: L.of(context).applicationLegalese,
Expand Down
14 changes: 14 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
ansicolor:
dependency: transitive
description:
name: ansicolor
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
app_group_directory:
dependency: "direct main"
description:
Expand All @@ -43,6 +50,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0"
assets_gen:
dependency: "direct dev"
description:
name: assets_gen
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
async:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ dependencies:
workmanager: ^0.5.0

dev_dependencies:
assets_gen: ^1.2.0
build_runner: ^2.3.0
copy_with_extension_gen: ^4.0.0
flutter_test:
Expand Down

0 comments on commit ac508c7

Please sign in to comment.