Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
refactor: deps
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Nov 3, 2023
1 parent ec4d9e2 commit db6bc26
Show file tree
Hide file tree
Showing 18 changed files with 688 additions and 326 deletions.
29 changes: 7 additions & 22 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: c251856c895807251bf9d74797ce6c57919282bf
channel: master
revision: "476aa717cd342d11e16439b71f4f4c9209c50712"
channel: "beta"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: c251856c895807251bf9d74797ce6c57919282bf
base_revision: c251856c895807251bf9d74797ce6c57919282bf
- platform: android
create_revision: c251856c895807251bf9d74797ce6c57919282bf
base_revision: c251856c895807251bf9d74797ce6c57919282bf
- platform: ios
create_revision: c251856c895807251bf9d74797ce6c57919282bf
base_revision: c251856c895807251bf9d74797ce6c57919282bf
create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712
base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712
- platform: linux
create_revision: c251856c895807251bf9d74797ce6c57919282bf
base_revision: c251856c895807251bf9d74797ce6c57919282bf
- platform: macos
create_revision: c251856c895807251bf9d74797ce6c57919282bf
base_revision: c251856c895807251bf9d74797ce6c57919282bf
- platform: web
create_revision: c251856c895807251bf9d74797ce6c57919282bf
base_revision: c251856c895807251bf9d74797ce6c57919282bf
- platform: windows
create_revision: c251856c895807251bf9d74797ce6c57919282bf
base_revision: c251856c895807251bf9d74797ce6c57919282bf
create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712
base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712

# User provided section

Expand Down
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"editor.formatOnSave": true
}
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[dart]": {
"editor.defaultFormatter": "Dart-Code.dart-code"
}
}
12 changes: 6 additions & 6 deletions cli/tasks/icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ Future<void> main() async {
final Image backgroundImage = decodePng(backgroundImageBytes)!;
final Image overlayImage = decodePng(overlayImageBytes)!;

final Image iconImage = drawImage(
final Image iconImage = compositeImage(
overlayImage,
copyCrop(
backgroundImage,
0,
overlayContentSize ~/ 2,
defaultImageSize,
defaultImageSize - overlayContentSize,
x: 0,
y: overlayContentSize ~/ 2,
width: defaultImageSize,
height: defaultImageSize - overlayContentSize,
),
);

for (final TwinTuple<int, String> x in androidIconSizes) {
final String iconPath = getAndroidIconPath(x.last);
final File iconFile = File(iconPath);
final List<int> icon = encodeNamedImage(
copyResizeCropSquare(iconImage, x.first),
path.basename(iconFile.path),
copyResizeCropSquare(iconImage, size: x.first),
)!;
await iconFile.writeAsBytes(icon);
_logger.info('Generated $iconPath (${x.last})');
Expand Down
2 changes: 1 addition & 1 deletion lib/core/app/meta.generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ part of 'meta.dart';

abstract class _GeneratedAppMeta {
static const String version = '3.0.0';
static const int builtAtMs = 1659024927924;
static const int builtAtMs = 1699028756663;
}
91 changes: 45 additions & 46 deletions lib/core/player/video_player.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_meedu_videoplayer/meedu_player.dart';
import 'package:media_kit/media_kit.dart' as media_kit;
import 'package:media_kit_video/media_kit_video.dart' as media_kit;

class PlayerPage extends StatefulWidget {
const PlayerPage({super.key});
Expand All @@ -15,78 +16,76 @@ String fileContents =
''; // TODO: Placeholder variable. Subtitles will have to be implemented later.

class _PlayerPageState extends State<PlayerPage> {
late MeeduPlayerController _controller;
late media_kit.Player _player;
late media_kit.VideoController _controller;

final ValueNotifier<bool> _subtitlesEnabled = ValueNotifier<bool>(true);

@override
void initState() {
super.initState();
_controller = MeeduPlayerController();
_player = media_kit.Player();
_controller = media_kit.VideoController(_player);
_setDataSource();
}

@override
void dispose() {
_controller.dispose();
_player.dispose();
super.dispose();
}

Future<void> _setDataSource() async {
await _controller.setDataSource(
DataSource(
source: sourceurl,
type: DataSourceType.network,
closedCaptionFile: _loadCaptions(),
),
await _player.open(
media_kit.Media(sourceurl),
);
_controller.onClosedCaptionEnabled(true);
// _controller.onClosedCaptionEnabled(true);
}

Future<ClosedCaptionFile> _loadCaptions() async =>
SubRipCaptionFile(fileContents);
// Future<ClosedCaptionFile> _loadCaptions() async =>
// SubRipCaptionFile(fileContents);

@override
Widget build(final BuildContext context) => Scaffold(
appBar: AppBar(),
body: SafeArea(
child: AspectRatio(
aspectRatio: 16 / 9,
child: MeeduVideoPlayer(
child: media_kit.Video(
controller: _controller,
bottomRight: (
final BuildContext ctx,
final MeeduPlayerController controller,
final Responsive responsive,
) {
final double fontSize = responsive.ip(3);
// bottomRight: (
// final BuildContext ctx,
// final MeeduPlayerController controller,
// final Responsive responsive,
// ) {
// final double fontSize = responsive.ip(3);

return CupertinoButton(
padding: const EdgeInsets.all(5),
minSize: 25,
child: ValueListenableBuilder<bool>(
valueListenable: _subtitlesEnabled,
builder: (
final BuildContext context,
final bool enabled,
final _,
) =>
Text(
'CC',
style: TextStyle(
fontSize: fontSize > 18 ? 18 : fontSize,
color: Colors.white.withOpacity(
enabled ? 1 : 0.4,
),
),
),
),
onPressed: () {
_subtitlesEnabled.value = !_subtitlesEnabled.value;
_controller.onClosedCaptionEnabled(_subtitlesEnabled.value);
},
);
},
// return CupertinoButton(
// padding: const EdgeInsets.all(5),
// minSize: 25,
// child: ValueListenableBuilder<bool>(
// valueListenable: _subtitlesEnabled,
// builder: (
// final BuildContext context,
// final bool enabled,
// final _,
// ) =>
// Text(
// 'CC',
// style: TextStyle(
// fontSize: fontSize > 18 ? 18 : fontSize,
// color: Colors.white.withOpacity(
// enabled ? 1 : 0.4,
// ),
// ),
// ),
// ),
// onPressed: () {
// _subtitlesEnabled.value = !_subtitlesEnabled.value;
// _controller.onClosedCaptionEnabled(_subtitlesEnabled.value);
// },
// );
// },
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/core/tenka/manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class TenkaManager {
baseDir: path.join(Paths.docsDir.path, 'tenka'),
);

await repository.initialize();
// await repository.initialize();
}

static Future<T> getExtractor<T>(final TenkaMetadata metadata) async {
Expand Down
47 changes: 24 additions & 23 deletions lib/ui/utils/themer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,30 @@ class ThemerThemeData {
? defaultTypography.black
: defaultTypography.white;
final TextTheme textTheme = defaultTextTheme
.merge(
TextTheme(
displayLarge: TextStyle(fontSize: context.r.size(4.8)),
displayMedium: TextStyle(fontSize: context.r.size(3)),
displaySmall: TextStyle(fontSize: context.r.size(2.4)),
headlineLarge: TextStyle(fontSize: context.r.size(2)),
headlineMedium: TextStyle(fontSize: context.r.size(1.3)),
headlineSmall: TextStyle(fontSize: context.r.size(1.2)),
titleLarge: TextStyle(fontSize: context.r.size(1.1)),
titleMedium: TextStyle(fontSize: context.r.size(0.73)),
titleSmall: TextStyle(fontSize: context.r.size(0.64)),
bodyLarge: TextStyle(fontSize: context.r.size(0.75)),
bodyMedium: TextStyle(fontSize: context.r.size(0.65)),
bodySmall: TextStyle(fontSize: context.r.size(0.55)),
labelLarge: TextStyle(fontSize: context.r.size(0.63)),
labelMedium: TextStyle(fontSize: context.r.size(0.55)),
labelSmall: TextStyle(fontSize: context.r.size(0.5)),
),
)
// .merge(
// TextTheme(
// displayLarge: TextStyle(fontSize: context.r.size(4.8)),
// displayMedium: TextStyle(fontSize: context.r.size(3)),
// displaySmall: TextStyle(fontSize: context.r.size(2.4)),
// headlineLarge: TextStyle(fontSize: context.r.size(2)),
// headlineMedium: TextStyle(fontSize: context.r.size(1.3)),
// headlineSmall: TextStyle(fontSize: context.r.size(1.2)),
// titleLarge: TextStyle(fontSize: context.r.size(1.1)),
// titleMedium: TextStyle(fontSize: context.r.size(0.73)),
// titleSmall: TextStyle(fontSize: context.r.size(0.64)),
// bodyLarge: TextStyle(fontSize: context.r.size(0.75)),
// bodyMedium: TextStyle(fontSize: context.r.size(0.65)),
// bodySmall: TextStyle(fontSize: context.r.size(0.55)),
// labelLarge: TextStyle(fontSize: context.r.size(0.63)),
// labelMedium: TextStyle(fontSize: context.r.size(0.55)),
// labelSmall: TextStyle(fontSize: context.r.size(0.5)),
// ),
// )
.apply(
fontFamily: fontFamily,
bodyColor: backgroundContrastColor,
displayColor: backgroundContrastColor,
);
fontFamily: fontFamily,
bodyColor: backgroundContrastColor,
displayColor: backgroundContrastColor,
);

return ThemeData(
colorScheme: ColorScheme(
Expand All @@ -99,6 +99,7 @@ class ThemerThemeData {
onError: foregroundContrastColor,
surface: backgroundColorLevel0,
onSurface: backgroundContrastColor,
outline: backgroundColorLevel0,
),
textTheme: textTheme,
useMaterial3: true,
Expand Down
1 change: 1 addition & 0 deletions linux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flutter/ephemeral
Loading

0 comments on commit db6bc26

Please sign in to comment.