Skip to content

Commit

Permalink
feat: use nord theme
Browse files Browse the repository at this point in the history
  • Loading branch information
blockbasti committed May 12, 2022
1 parent 5eb9f1f commit 998f625
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 29 deletions.
Binary file modified android/app/src/main/res/drawable-night-v21/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-night/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-v21/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion android/app/src/main/res/values-night-v31/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowSplashScreenBackground">#303030</item>
<item name="android:windowSplashScreenBackground">#2E3440</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowSplashScreenBackground">#FFFFFF</item>
<item name="android:windowSplashScreenBackground">#D8DEE9</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">true</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
Expand Down
26 changes: 4 additions & 22 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_nord_theme/flutter_nord_theme.dart';
import 'package:flutter_phoenix/flutter_phoenix.dart';
import 'package:pref/pref.dart';
import 'package:prefs/prefs.dart';
Expand Down Expand Up @@ -56,35 +57,16 @@ class JAWTApp extends StatelessWidget {
return MaterialApp(
title: 'Just Another Workout Timer',
themeMode: _brightness,
theme: ThemeData(
theme: NordTheme.light().copyWith(
useMaterial3: true,
brightness: Brightness.light,
colorSchemeSeed: Colors.blue,
toggleableActiveColor: Colors.blue[800],
cardTheme: CardTheme(
cardTheme: const CardTheme(
elevation: 4,
shape: RoundedRectangleBorder(
side: const BorderSide(color: Colors.black12, width: 1),
borderRadius: BorderRadius.circular(4),
),
)),
darkTheme: ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
colorSchemeSeed: Colors.blue,
toggleableActiveColor: Colors.blueAccent[100],
cardTheme: CardTheme(
elevation: 4,
shape: RoundedRectangleBorder(
side: const BorderSide(color: Colors.black12, width: 1),
borderRadius: BorderRadius.circular(4),
),
)),
darkTheme: NordTheme.dark().copyWith(useMaterial3: true, cardTheme: const CardTheme(elevation: 4)),
home: const HomePage(),
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
Expand Down
3 changes: 2 additions & 1 deletion lib/workout_builder.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_nord_theme/flutter_nord_theme.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:uuid/uuid.dart';

Expand Down Expand Up @@ -236,7 +237,7 @@ class BuilderPageState extends State<BuilderPage> {
index: exIndex,
key: Key(_workout.sets[setIndex].exercises[exIndex].id),
child: Card(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).brightness == Brightness.dark ? NordColors.polarNight.darkest : NordColors.snowStorm.lightest,
child: Row(
key: Key(_workout.sets[setIndex].exercises[exIndex].id),
children: [
Expand Down
3 changes: 1 addition & 2 deletions lib/workout_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class WorkoutPageState extends State<WorkoutPage> {

void _timerStop() {
setState(() {
_timer!.cancel();
_timer?.cancel();
});
}

Expand Down Expand Up @@ -346,7 +346,6 @@ class WorkoutPageState extends State<WorkoutPage> {
title: Text(_workout.title),
),
bottomNavigationBar: BottomAppBar(
//shape: const AutomaticNotchedShape(ContinuousRectangleBorder(), CircleBorder()),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.6"
flutter_nord_theme:
dependency: "direct main"
description:
name: flutter_nord_theme
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
flutter_oss_licenses:
dependency: "direct dev"
description:
Expand Down
5 changes: 3 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies:
flutter_localizations:
sdk: flutter
uuid: 3.0.6
flutter_nord_theme: 2.1.0

dev_dependencies:
flutter_launcher_icons: 0.9.2
Expand All @@ -52,8 +53,8 @@ flutter_intl:
enabled: true

flutter_native_splash:
color: "#FFFFFF"
color_dark: "#303030"
color: "#D8DEE9"
color_dark: "#2E3440"
image: "assets/ic_launcher.png"
fullscreen: true
android_gravity: center
Expand Down

0 comments on commit 998f625

Please sign in to comment.