Skip to content

Commit

Permalink
➕ Add google_fonts
Browse files Browse the repository at this point in the history
Add warning if select tajwid kdn option, now defaulted to no tajwid
  • Loading branch information
iqfareez committed Dec 23, 2024
1 parent 7edfa6e commit 90a598c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import 'database/mydb.dart';
import 'utils/runtime_font_loader.dart';
Expand Down Expand Up @@ -56,6 +57,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
textTheme: GoogleFonts.spaceGroteskTextTheme(),
),
home: const HomePage(),
);
Expand Down
2 changes: 2 additions & 0 deletions lib/views/components/preview_control_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class _PreviewControlCardState extends State<PreviewControlCard> {
.map((previewType) => DropdownMenuItem(
value: previewType,
child: Text(previewType.label),
// TODO: Remove this after adding page preview feature
enabled: previewType == PreviewType.justText,
))
.toList(),
onChanged: (value) {
Expand Down
20 changes: 17 additions & 3 deletions lib/views/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> {
late Future<List<SurahItem>> _surahListFuture;

TajwidOptions _selectedTajwidOption = TajwidOptions.tajwidKdn;
// TODO: Default to Tajwid KDN after the fonts is ready
TajwidOptions _selectedTajwidOption = TajwidOptions.noTajwid;

// Set default to surah al fatihah
int fromSurah = 1;
Expand Down Expand Up @@ -98,8 +99,13 @@ class _HomePageState extends State<HomePage> {
),
);
},
child: Text('Quran Computer Publication',
style: Theme.of(context).textTheme.titleLarge),
child: const Text(
'Quran Computer Publication',
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.w600,
),
),
),
),
const Gap(24),
Expand Down Expand Up @@ -148,6 +154,14 @@ class _HomePageState extends State<HomePage> {
)
],
),
// TODO: Remove this warning after the fonts is ready
if (_selectedTajwidOption == TajwidOptions.tajwidKdn)
const Text(
'Warning: Tajwid font is experimental and in early stage of development. You might encounter missing glyphs.',
style: TextStyle(
color: Colors.deepOrange,
),
),
],
),
),
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
url: "https://pub.dev"
source: hosted
version: "6.2.1"
graphs:
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 @@ -36,6 +36,7 @@ dependencies:
drift_flutter: ^0.2.1
drift: ^2.21.0
gap: ^3.0.1
google_fonts: ^6.2.1
package_info_plus: ^8.1.1
path_provider: ^2.1.5
path: ^1.9.0
Expand Down

0 comments on commit 90a598c

Please sign in to comment.