mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 13:38:13 -08: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:math' as math;
|
||||
|
||||
import 'package:flutter/material.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/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 {
|
||||
final double fontSize;
|
||||
|
|
@ -79,7 +80,7 @@ class SubtitleSettingsModel {
|
|||
height: 1.4,
|
||||
fontSize: fontSize,
|
||||
fontWeight: fontWeight,
|
||||
fontFamily: GoogleFonts.openSans().fontFamily,
|
||||
fontFamily: 'OpenSans',
|
||||
letterSpacing: 0.0,
|
||||
wordSpacing: 0.0,
|
||||
color: color,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
|
||||
import 'package:fladder/models/credentials_model.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/localization_helper.dart';
|
||||
import 'package:fladder/util/theme_extensions.dart';
|
||||
|
|
@ -21,7 +22,6 @@ class DiscoverServersWidget extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
if (kIsWeb) return const SizedBox.shrink();
|
||||
final existingServers = serverCredentials
|
||||
.map(
|
||||
(credentials) => DiscoveryInfo(
|
||||
|
|
@ -58,51 +58,53 @@ class DiscoverServersWidget extends ConsumerWidget {
|
|||
)
|
||||
.toList()
|
||||
.addInBetween(const SizedBox(height: 4)),
|
||||
const Divider(),
|
||||
],
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
context.localized.discovered,
|
||||
style: context.textTheme.bodyLarge,
|
||||
),
|
||||
const Spacer(),
|
||||
const Opacity(opacity: 0.65, child: Icon(IconsaxBold.airdrop, size: 16)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
discoverdServersStream.when(
|
||||
data: (data) {
|
||||
final servers = data.where((discoverdServer) => !existingServers.contains(discoverdServer));
|
||||
return servers.isNotEmpty
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
...servers.map(
|
||||
(serverInfo) => _ServerInfoCard(
|
||||
server: serverInfo,
|
||||
onPressed: onPressed,
|
||||
),
|
||||
)
|
||||
].toList().addInBetween(const SizedBox(height: 4)),
|
||||
)
|
||||
: Center(
|
||||
child: Opacity(
|
||||
opacity: 0.65,
|
||||
child: Text(
|
||||
context.localized.noServersFound,
|
||||
style: context.textTheme.bodyLarge,
|
||||
),
|
||||
));
|
||||
},
|
||||
error: (error, stackTrace) => Text(context.localized.error),
|
||||
loading: () => const Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 24.0,
|
||||
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
|
||||
if (!kIsWeb && FladderConfig.baseUrl?.isEmpty == true) ...[
|
||||
const Divider(),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
context.localized.discovered,
|
||||
style: context.textTheme.bodyLarge,
|
||||
),
|
||||
const Spacer(),
|
||||
const Opacity(opacity: 0.65, child: Icon(IconsaxBold.airdrop, size: 16)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
discoverdServersStream.when(
|
||||
data: (data) {
|
||||
final servers = data.where((discoverdServer) => !existingServers.contains(discoverdServer));
|
||||
return servers.isNotEmpty
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
...servers.map(
|
||||
(serverInfo) => _ServerInfoCard(
|
||||
server: serverInfo,
|
||||
onPressed: onPressed,
|
||||
),
|
||||
)
|
||||
].toList().addInBetween(const SizedBox(height: 4)),
|
||||
)
|
||||
: Center(
|
||||
child: Opacity(
|
||||
opacity: 0.65,
|
||||
child: Text(
|
||||
context.localized.noServersFound,
|
||||
style: context.textTheme.bodyLarge,
|
||||
),
|
||||
));
|
||||
},
|
||||
error: (error, stackTrace) => Text(context.localized.error),
|
||||
loading: () => const Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 24.0,
|
||||
child: CircularProgressIndicator.adaptive(strokeCap: StrokeCap.round),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 32),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
|
|
@ -74,7 +75,8 @@ class SettingsScaffold extends ConsumerWidget {
|
|||
),
|
||||
),
|
||||
SliverPadding(
|
||||
padding: MediaQuery.paddingOf(context),
|
||||
padding: MediaQuery.paddingOf(context)
|
||||
.copyWith(top: AdaptiveLayout.of(context).isDesktop || kIsWeb ? 0 : null),
|
||||
sliver: SliverList(
|
||||
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: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) {
|
||||
if (theme == null) return null;
|
||||
|
|
@ -34,7 +36,7 @@ class FladderTheme {
|
|||
static ThemeData theme(ColorScheme? colorScheme) {
|
||||
final ColorScheme? scheme = generateDynamicColourSchemes(colorScheme);
|
||||
|
||||
final textTheme = GoogleFonts.rubikTextTheme(
|
||||
final textTheme = FladderFonts.rubikTextTheme(
|
||||
const TextTheme(),
|
||||
);
|
||||
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,
|
||||
children: [
|
||||
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(
|
||||
children: [
|
||||
Expanded(
|
||||
|
|
|
|||
|
|
@ -794,14 +794,6 @@ 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:
|
||||
|
|
|
|||
17
pubspec.yaml
17
pubspec.yaml
|
|
@ -64,9 +64,6 @@ dependencies:
|
|||
shared_preferences: ^2.1.0
|
||||
path_provider: ^2.1.3
|
||||
|
||||
# Fonts
|
||||
google_fonts: ^6.1.0
|
||||
|
||||
# Media
|
||||
media_kit: ^1.1.10 # Primary package.
|
||||
media_kit_video: ^1.2.4 # For video rendering.
|
||||
|
|
@ -162,6 +159,20 @@ flutter:
|
|||
- config/
|
||||
|
||||
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
|
||||
fonts:
|
||||
- asset: assets/fonts/mp-font.ttf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue