mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-14 17:55:58 -07:00
## Pull Request Description Added the google fonts locally Also added back saved servers for web ## Issue Being Fixed Issue Number: #54 ## Screenshots / Recordings <!-- This section is optional but highly recommended to show off your changes! --> ## Checklist - [ ] If a new package was added, did you ensure it works for all supported platforms? Is the package also well maintained? - [ ] Did you add localization for any text? If yes, did you sort the .arb file using ```arb_utils sort <INPUT_FILE>```? - [ ] Check that any changes are related to the issue at hand. --------- Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
ff45bb8641
commit
9df13cfb34
12 changed files with 189 additions and 64 deletions
BIN
assets/fonts/opensans/OpenSans-Italic.ttf
Normal file
BIN
assets/fonts/opensans/OpenSans-Italic.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/opensans/OpenSans.ttf
Normal file
BIN
assets/fonts/opensans/OpenSans.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/rubik/Rubik-Italic-VariableFont_wght.ttf
Normal file
BIN
assets/fonts/rubik/Rubik-Italic-VariableFont_wght.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/rubik/Rubik-VariableFont_wght.ttf
Normal file
BIN
assets/fonts/rubik/Rubik-VariableFont_wght.ttf
Normal file
Binary file not shown.
|
|
@ -2,12 +2,13 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
import 'package:fladder/providers/settings/subtitle_settings_provider.dart';
|
import 'package:fladder/providers/settings/subtitle_settings_provider.dart';
|
||||||
import 'package:fladder/providers/settings/video_player_settings_provider.dart';
|
import 'package:fladder/providers/settings/video_player_settings_provider.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
|
|
||||||
class SubtitleSettingsModel {
|
class SubtitleSettingsModel {
|
||||||
final double fontSize;
|
final double fontSize;
|
||||||
|
|
@ -79,7 +80,7 @@ class SubtitleSettingsModel {
|
||||||
height: 1.4,
|
height: 1.4,
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
fontWeight: fontWeight,
|
fontWeight: fontWeight,
|
||||||
fontFamily: GoogleFonts.openSans().fontFamily,
|
fontFamily: 'OpenSans',
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
wordSpacing: 0.0,
|
wordSpacing: 0.0,
|
||||||
color: color,
|
color: color,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
import 'package:fladder/models/credentials_model.dart';
|
import 'package:fladder/models/credentials_model.dart';
|
||||||
import 'package:fladder/providers/discovery_provider.dart';
|
import 'package:fladder/providers/discovery_provider.dart';
|
||||||
|
import 'package:fladder/util/fladder_config.dart';
|
||||||
import 'package:fladder/util/list_padding.dart';
|
import 'package:fladder/util/list_padding.dart';
|
||||||
import 'package:fladder/util/localization_helper.dart';
|
import 'package:fladder/util/localization_helper.dart';
|
||||||
import 'package:fladder/util/theme_extensions.dart';
|
import 'package:fladder/util/theme_extensions.dart';
|
||||||
|
|
@ -21,7 +22,6 @@ class DiscoverServersWidget extends ConsumerWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
if (kIsWeb) return const SizedBox.shrink();
|
|
||||||
final existingServers = serverCredentials
|
final existingServers = serverCredentials
|
||||||
.map(
|
.map(
|
||||||
(credentials) => DiscoveryInfo(
|
(credentials) => DiscoveryInfo(
|
||||||
|
|
@ -58,51 +58,53 @@ class DiscoverServersWidget extends ConsumerWidget {
|
||||||
)
|
)
|
||||||
.toList()
|
.toList()
|
||||||
.addInBetween(const SizedBox(height: 4)),
|
.addInBetween(const SizedBox(height: 4)),
|
||||||
const Divider(),
|
|
||||||
],
|
],
|
||||||
Row(
|
if (!kIsWeb && FladderConfig.baseUrl?.isEmpty == true) ...[
|
||||||
children: [
|
const Divider(),
|
||||||
Text(
|
Row(
|
||||||
context.localized.discovered,
|
children: [
|
||||||
style: context.textTheme.bodyLarge,
|
Text(
|
||||||
),
|
context.localized.discovered,
|
||||||
const Spacer(),
|
style: context.textTheme.bodyLarge,
|
||||||
const Opacity(opacity: 0.65, child: Icon(IconsaxBold.airdrop, size: 16)),
|
),
|
||||||
],
|
const Spacer(),
|
||||||
),
|
const Opacity(opacity: 0.65, child: Icon(IconsaxBold.airdrop, size: 16)),
|
||||||
const SizedBox(height: 4),
|
],
|
||||||
discoverdServersStream.when(
|
),
|
||||||
data: (data) {
|
const SizedBox(height: 4),
|
||||||
final servers = data.where((discoverdServer) => !existingServers.contains(discoverdServer));
|
discoverdServersStream.when(
|
||||||
return servers.isNotEmpty
|
data: (data) {
|
||||||
? Column(
|
final servers = data.where((discoverdServer) => !existingServers.contains(discoverdServer));
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
return servers.isNotEmpty
|
||||||
children: [
|
? Column(
|
||||||
...servers.map(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
(serverInfo) => _ServerInfoCard(
|
children: [
|
||||||
server: serverInfo,
|
...servers.map(
|
||||||
onPressed: onPressed,
|
(serverInfo) => _ServerInfoCard(
|
||||||
),
|
server: serverInfo,
|
||||||
)
|
onPressed: onPressed,
|
||||||
].toList().addInBetween(const SizedBox(height: 4)),
|
),
|
||||||
)
|
)
|
||||||
: Center(
|
].toList().addInBetween(const SizedBox(height: 4)),
|
||||||
child: Opacity(
|
)
|
||||||
opacity: 0.65,
|
: Center(
|
||||||
child: Text(
|
child: Opacity(
|
||||||
context.localized.noServersFound,
|
opacity: 0.65,
|
||||||
style: context.textTheme.bodyLarge,
|
child: Text(
|
||||||
),
|
context.localized.noServersFound,
|
||||||
));
|
style: context.textTheme.bodyLarge,
|
||||||
},
|
),
|
||||||
error: (error, stackTrace) => Text(context.localized.error),
|
));
|
||||||
loading: () => const Center(
|
},
|
||||||
child: SizedBox.square(
|
error: (error, stackTrace) => Text(context.localized.error),
|
||||||
dimension: 24.0,
|
loading: () => const Center(
|
||||||
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
|
child: SizedBox.square(
|
||||||
|
dimension: 24.0,
|
||||||
|
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
const SizedBox(height: 32),
|
const SizedBox(height: 32),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:auto_route/auto_route.dart';
|
||||||
|
|
@ -74,7 +75,8 @@ class SettingsScaffold extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: MediaQuery.paddingOf(context),
|
padding: MediaQuery.paddingOf(context)
|
||||||
|
.copyWith(top: AdaptiveLayout.of(context).isDesktop || kIsWeb ? 0 : null),
|
||||||
sliver: SliverList(
|
sliver: SliverList(
|
||||||
delegate: SliverChildListDelegate(items),
|
delegate: SliverChildListDelegate(items),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import 'package:dynamic_color/dynamic_color.dart';
|
|
||||||
import 'package:fladder/util/custom_color_themes.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
|
|
||||||
|
import 'package:fladder/theme/fonts.dart';
|
||||||
|
import 'package:fladder/util/custom_color_themes.dart';
|
||||||
|
|
||||||
ColorScheme? generateDynamicColourSchemes(ColorScheme? theme) {
|
ColorScheme? generateDynamicColourSchemes(ColorScheme? theme) {
|
||||||
if (theme == null) return null;
|
if (theme == null) return null;
|
||||||
|
|
@ -34,7 +36,7 @@ class FladderTheme {
|
||||||
static ThemeData theme(ColorScheme? colorScheme) {
|
static ThemeData theme(ColorScheme? colorScheme) {
|
||||||
final ColorScheme? scheme = generateDynamicColourSchemes(colorScheme);
|
final ColorScheme? scheme = generateDynamicColourSchemes(colorScheme);
|
||||||
|
|
||||||
final textTheme = GoogleFonts.rubikTextTheme(
|
final textTheme = FladderFonts.rubikTextTheme(
|
||||||
const TextTheme(),
|
const TextTheme(),
|
||||||
);
|
);
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
|
|
|
||||||
115
lib/theme/fonts.dart
Normal file
115
lib/theme/fonts.dart
Normal file
|
|
@ -0,0 +1,115 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class FladderFonts {
|
||||||
|
static TextTheme rubikTextTheme([TextTheme? textTheme]) {
|
||||||
|
textTheme ??= ThemeData.light().textTheme;
|
||||||
|
|
||||||
|
return TextTheme(
|
||||||
|
displayLarge: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.displayLarge?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 300),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
displayMedium: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.displayMedium?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 400),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
displaySmall: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.displaySmall?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 500),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
headlineLarge: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.headlineLarge?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 600),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
headlineMedium: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.headlineMedium?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 700),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
headlineSmall: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.headlineSmall?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 800),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
titleLarge: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.titleLarge?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 400),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
titleMedium: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.titleMedium?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 500),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
titleSmall: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.titleSmall?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 600),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
bodyLarge: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.bodyLarge?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 400),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
bodyMedium: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.bodyMedium?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 500),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
bodySmall: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.bodySmall?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 400),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
labelLarge: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.labelLarge?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 600),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
labelMedium: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.labelMedium?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 500),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
labelSmall: TextStyle(
|
||||||
|
fontFamily: 'Rubik',
|
||||||
|
fontSize: textTheme.labelSmall?.fontSize,
|
||||||
|
fontVariations: [
|
||||||
|
const FontVariation('wght', 400),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -42,7 +42,7 @@ class NestedNavigationDrawer extends ConsumerWidget {
|
||||||
surfaceTintColor: isExpanded ? Colors.transparent : null,
|
surfaceTintColor: isExpanded ? Colors.transparent : null,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.fromLTRB(28, AdaptiveLayout.of(context).isDesktop ? 0 : 16, 16, 0),
|
padding: EdgeInsets.fromLTRB(28, AdaptiveLayout.of(context).isDesktop || kIsWeb ? 0 : 16, 16, 0),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
|
||||||
|
|
@ -794,14 +794,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
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:
|
graphs:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
17
pubspec.yaml
17
pubspec.yaml
|
|
@ -64,9 +64,6 @@ dependencies:
|
||||||
shared_preferences: ^2.1.0
|
shared_preferences: ^2.1.0
|
||||||
path_provider: ^2.1.3
|
path_provider: ^2.1.3
|
||||||
|
|
||||||
# Fonts
|
|
||||||
google_fonts: ^6.1.0
|
|
||||||
|
|
||||||
# Media
|
# Media
|
||||||
media_kit: ^1.1.10 # Primary package.
|
media_kit: ^1.1.10 # Primary package.
|
||||||
media_kit_video: ^1.2.4 # For video rendering.
|
media_kit_video: ^1.2.4 # For video rendering.
|
||||||
|
|
@ -162,6 +159,20 @@ flutter:
|
||||||
- config/
|
- config/
|
||||||
|
|
||||||
fonts:
|
fonts:
|
||||||
|
- family: Rubik
|
||||||
|
fonts:
|
||||||
|
- asset: assets/fonts/rubik/Rubik-VariableFont_wght.ttf
|
||||||
|
style: normal
|
||||||
|
- asset: assets/fonts/rubik/Rubik-Italic-VariableFont_wght.ttf
|
||||||
|
style: italic
|
||||||
|
|
||||||
|
- family: OpenSans
|
||||||
|
fonts:
|
||||||
|
- asset: assets/fonts/opensans/OpenSans.ttf
|
||||||
|
style: normal
|
||||||
|
- asset: assets/fonts/opensans/OpenSans-Italic.ttf
|
||||||
|
style: italic
|
||||||
|
|
||||||
- family: mp-font
|
- family: mp-font
|
||||||
fonts:
|
fonts:
|
||||||
- asset: assets/fonts/mp-font.ttf
|
- asset: assets/fonts/mp-font.ttf
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue