Skip to content

Commit

Permalink
cleaning the library for 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Sivan22 committed Mar 21, 2024
1 parent 777f4ca commit 07d05b4
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 11,477 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ An open source project to bring the sefaria library to PC. The program is writte

## Credits

vy

![alt text](PBS.png)
Binary file modified app_preferences.hive
Binary file not shown.
71 changes: 42 additions & 29 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,54 @@ class FileExplorerApp extends StatelessWidget {
final ValueNotifier<bool> isDarkMode = ValueNotifier<bool>(
Settings.getValue<bool>('key-dark-mode') ?? false,
);
final ValueNotifier<Color> seedColor = ValueNotifier<Color>(
ConversionUtils.colorFromString(
Settings.getValue<String>('key-swatch-color') ?? ('#ff2c1b02')),
);

@override
Widget build(BuildContext context) {
return ValueListenableBuilder(
valueListenable: isDarkMode,
builder: (BuildContext context, dynamic value, Widget? child) {
return MaterialApp(
localizationsDelegates: const [
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: const [
Locale("he", "IL"), // OR Locale('ar', 'AE') OR Other RTL locales
],
locale: const Locale(
"he", "IL"), // OR Locale('ar', 'AE') OR Other RTL locales,
title: 'אוצריא',
theme: value
? ThemeData.dark(useMaterial3: true)
: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
fontFamily: 'candara',
colorScheme: ColorScheme.fromSeed(
seedColor: Color.fromARGB(255, 44, 27, 2)),
textTheme: const TextTheme(
bodyMedium:
TextStyle(fontSize: 18.0, fontFamily: 'candara'),
),
),
routes: {
'/settings': (context) => mySettingsScreen(isDarkMode),
},
home: MainWindowView(isDarkMode: isDarkMode),
);
return ValueListenableBuilder(
valueListenable: seedColor,
builder:
(BuildContext context, dynamic seedColor, Widget? child) {
return MaterialApp(
localizationsDelegates: const [
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: const [
Locale("he",
"IL"), // OR Locale('ar', 'AE') OR Other RTL locales
],
locale: const Locale("he",
"IL"), // OR Locale('ar', 'AE') OR Other RTL locales,
title: 'אוצריא',
theme: value
? ThemeData.dark(useMaterial3: true)
: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
fontFamily: 'candara',
colorScheme: ColorScheme.fromSeed(
seedColor: seedColor,
),
textTheme: const TextTheme(
bodyMedium: TextStyle(
fontSize: 18.0, fontFamily: 'candara'),
),
),
routes: {
'/settings': (context) => MySettingsScreen(
isDarkMode: isDarkMode, seedColor: this.seedColor),
},
home: MainWindowView(
isDarkMode: isDarkMode, seedColor: this.seedColor),
);
});
});
}
}
5 changes: 4 additions & 1 deletion lib/main_window_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import 'dart:isolate';

class MainWindowView extends StatefulWidget {
final ValueNotifier<bool> isDarkMode;
final ValueNotifier<Color> seedColor;

const MainWindowView({
required this.isDarkMode,
required this.seedColor,
Key? key,
}) : super(
key: key,
Expand Down Expand Up @@ -483,7 +485,8 @@ class MainWindowViewState extends State<MainWindowView>
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => mySettingsScreen(widget.isDarkMode)));
builder: (context) => MySettingsScreen(
isDarkMode: widget.isDarkMode, seedColor: widget.seedColor)));
setState(() {});
}

Expand Down
27 changes: 17 additions & 10 deletions lib/settings_screen.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import 'package:flutter/material.dart';
import 'package:flutter_settings_screen_ex/flutter_settings_screen_ex.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/services.dart';
import 'dart:io';

class mySettingsScreen extends StatelessWidget {
ValueNotifier<bool> isDarkMode;
class MySettingsScreen extends StatelessWidget {
final ValueNotifier<bool> isDarkMode;
final ValueNotifier<Color> seedColor;

mySettingsScreen(
this.isDarkMode,
);
const MySettingsScreen({
Key? key,
required this.isDarkMode,
required this.seedColor,
}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -69,19 +71,24 @@ class mySettingsScreen extends StatelessWidget {
leading: const Icon(Icons.nightlight_round_outlined),
onChange: (value) {
isDarkMode.value = value;
isDarkMode.notifyListeners();
},
),
SliderSettingsTile(
ColorPickerSettingsTile(
title: 'צבע בסיס',
leading: const Icon(Icons.color_lens),
settingKey: 'key-swatch-color',
onChange: (p0) {
seedColor.value = p0;
}),
const SliderSettingsTile(
title: 'גודל גופן התחלתי בספרים',
settingKey: 'key-font-size',
defaultValue: 30,
min: 15,
max: 60,
step: 1,
leading: const Icon(Icons.format_size),
leading: Icon(Icons.format_size),
decimalPrecision: 0,
onChange: (value) {},
),
DropDownSettingsTile<String>(
title: 'גופן',
Expand Down

This file was deleted.

Loading

0 comments on commit 07d05b4

Please sign in to comment.