Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 63c786f

Browse files
committed
UI patch for dark mode
1 parent a86b8dd commit 63c786f

File tree

6 files changed

+9
-29
lines changed

6 files changed

+9
-29
lines changed

README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,6 @@
3030
> Please note that this project's code is not meant for beginners! If you're just getting started with flutter I recommend you to explore some ToDo and basic setState apps and get yourself familiar with react eco-system becuase in this project intermediate and advance implementations are use which will confuse you and won't help much in terms of learning.
3131
3232
- `init.js` initialize default settings like styles, theme & API.
33-
- `UI.dart` provides constant for building responsive UI.
34-
- `blocs/` Intially I was going to implement Rest APIs but that seemed unnecessary & a lot of work So I'll probably remove `blocs/` in futrue.
35-
- `configs/AppDimensions.dart` this is the magical file. It provides the app with:
36-
- My custom size unit based on device's width, height & pixel density.
37-
- Responsive containers.
38-
- Padding multiplier unit (I learned it with experience instead of using 1,2,3px should use multiplier. it helps maintain constancy around the app).
39-
- `Widgets/Screen.dart` This widget is necessary when building a new screen.
40-
- configure theme & font style.
41-
- You can show popUps. `final screenKey = GlobalKey<ScreenState>();` & `this.screenKey.showPopUp(message: "your message");`
42-
- It also recieve a `belowBuilder` parameter which builds custom background (This enables us to build Parallax, Animated background & Any thing you could imagine in background). you can find an example in `Screens/Download/Download.dart`
43-
- Code structure is pretty much simple.
44-
- Don't import anything form ScreenA in ScreenB.
45-
- Don't import anthing from Screen/Widget in universal files.
46-
- Don't import anthing from ScreenA specific Widget in universal files.
47-
- Each Screen will have `Dimensions.dart` where you can write Screen's responsive logic.
48-
- I didn't use snake_case in naming convention just becuase I don't prefer it.
49-
- I use `this` for class's properties & methods I helps keep track of vriables & functions.
5033

5134

5235
## Show support
@@ -61,14 +44,6 @@
6144

6245
## Download
6346

64-
<div id="downloads">
65-
<a href="https://play.google.com/store/apps/details?id=com.onemdev.flutter_ui_challenges">
66-
<img src="https://raw.githubusercontent.com/hackerhgl/flutter-ui-designs/master/.github/assets/google-play.png" alt="Play Store badge" width="200" />
67-
</a>
68-
<a href="https://github.com/hackerhgl/flutter-ui-designs/releases/latest/download/app-release.apk">
69-
<img src="https://raw.githubusercontent.com/hackerhgl/flutter-ui-designs/master/.github/assets/android.png" alt="Android badge" width="200" />
70-
</a>
71-
</div>
7247

7348
## License
7449

app/contexts/Theme/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default function ThemeContextProvider({ children }) {
7474
<ThemeContext.Provider
7575
value={{
7676
...state,
77+
isDark,
7778
setTheme,
7879
setDefaultStatusBar,
7980
}}

app/screens/Settings/Player/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ export default function Player({ isActive, mp3, toggle, state, updateParent }) {
152152
minimumValue={0.0}
153153
maximumValue={state.player.duration}
154154
value={status.progress.asMilliseconds()}
155-
maximumTrackTintColor="#000000"
156155
minimumTrackTintColor={colors.primary}
156+
thumbTintColor={isDark ? colors.white : colors.black}
157+
maximumTrackTintColor={isDark ? colors.white : colors.black}
157158
style={styles.bodySlider}
158159
onSlidingStart={() => {
159160
runProgressBar(false);

app/screens/Settings/Player/styles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const styles = new DynamicStyleSheet({
5252
},
5353
playIcon: {
5454
fontSize: scaling(7),
55+
color: new DynamicValue(colors.dark, colors.white),
5556
},
5657
bodySlider: {
5758
flex: 1,

app/screens/Settings/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function SettingsScreen({ navigation }) {
2323
const [volume, setVolume] = useState(state.player.volume);
2424
const [activeTack, setTrack] = useState(-1);
2525
const styles = useDynamicStyleSheet(rawStyles);
26-
const { theme, setTheme } = useContext(ThemeContext);
26+
const { theme, setTheme, isDark } = useContext(ThemeContext);
2727

2828
useEffect(() => {
2929
state.player.volume = volume;
@@ -40,7 +40,6 @@ function SettingsScreen({ navigation }) {
4040
maximumValue={1}
4141
style={styles.volumeSlider}
4242
value={volume}
43-
maximumTrackTintColor="#000000"
4443
onSlidingStart={() => {
4544
if (!state.player.isPlaying) {
4645
forcePlay = true;
@@ -54,6 +53,8 @@ function SettingsScreen({ navigation }) {
5453
}
5554
}}
5655
minimumTrackTintColor={colors.primary}
56+
thumbTintColor={isDark ? colors.white : colors.black}
57+
maximumTrackTintColor={isDark ? colors.white : colors.black}
5758
onValueChange={(val) => {
5859
setVolume(val);
5960
}}

app/screens/Settings/styles.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const styles = new DynamicStyleSheet({
2323
},
2424
radioBase: {
2525
flexDirection: 'row',
26-
marginTop: scaling(3),
26+
marginVertical: scaling(1.5),
27+
paddingVertical: scaling(1),
2728
},
2829
radioLabel: {
2930
marginLeft: scaling(3),

0 commit comments

Comments
 (0)