Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auth): サインイン画面の背景を動画に変更 #402

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
Expand All @@ -134,6 +137,7 @@ DEPENDENCIES:
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)

SPEC REPOS:
trunk:
Expand Down Expand Up @@ -168,6 +172,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"

SPEC CHECKSUMS:
Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86
Expand All @@ -191,6 +197,7 @@ SPEC CHECKSUMS:
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3

PODFILE CHECKSUM: 6150a9e74fbdb1f914e34d1010fcbe9acdaf34db

Expand Down
56 changes: 56 additions & 0 deletions app/pubspec.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions catalog/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import FlutterMacOS
import Foundation

import dynamic_color
import video_player_avfoundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
}
64 changes: 64 additions & 0 deletions catalog/pubspec.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions feature/auth/.flutter-plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This is a generated file; do not edit or check into version control.
video_player=/Users/tatsutakein/.pub-cache/hosted/pub.dev/video_player-2.8.7/
video_player_android=/Users/tatsutakein/.pub-cache/hosted/pub.dev/video_player_android-2.5.0/
video_player_avfoundation=/Users/tatsutakein/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.6.1/
video_player_web=/Users/tatsutakein/.pub-cache/hosted/pub.dev/video_player_web-2.3.1/
1 change: 1 addition & 0 deletions feature/auth/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"video_player_avfoundation","path":"/Users/tatsutakein/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.6.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"video_player_android","path":"/Users/tatsutakein/.pub-cache/hosted/pub.dev/video_player_android-2.5.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"video_player_avfoundation","path":"/Users/tatsutakein/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.6.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"video_player_web","path":"/Users/tatsutakein/.pub-cache/hosted/pub.dev/video_player_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"video_player","dependencies":["video_player_android","video_player_avfoundation","video_player_web"]},{"name":"video_player_android","dependencies":[]},{"name":"video_player_avfoundation","dependencies":[]},{"name":"video_player_web","dependencies":[]}],"date_created":"2024-06-15 00:29:59.394836","version":"3.23.0-0.1.pre","swift_package_manager_enabled":false}
Binary file added feature/auth/assets/videos/hero.mp4
Binary file not shown.
30 changes: 24 additions & 6 deletions feature/auth/lib/src/ui/page/auth/auth_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:core_designsystem/component.dart';
import 'dart:ui';

import 'package:feature_auth/src/ui/page/auth/components/sign_in_form.dart';
import 'package:feature_auth/src/ui/page/auth/components/video_background_view.dart';
import 'package:flutter/material.dart';

/// 認証ページ
Expand All @@ -21,12 +23,28 @@ final class AuthPage extends StatelessWidget {
focus.unfocus();
}
},
child: AsisScaffold(
appBar: const AsisAppBar(
title: Text('サインイン'),
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(
title: const Text('サインイン'),
centerTitle: true,
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SignInForm(
onLoginSuccess: _onLoginSuccess,
body: Stack(
children: [
ImageFiltered(
imageFilter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: const HeroBackground(),
),
Positioned.fill(
child: SafeArea(
child: SignInForm(
onLoginSuccess: _onLoginSuccess,
),
),
),
],
),
),
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:video_player/video_player.dart';

final class HeroBackground extends HookWidget {
const HeroBackground({super.key});

@override
Widget build(BuildContext context) {
final controller = useMemoized(
() => VideoPlayerController.asset(
'assets/videos/hero.mp4',
package: 'feature_auth',
),
);
final isInitialized = useState(false);

useEffect(
() {
controller.addListener(() {
if (controller.value.isInitialized) {
isInitialized.value = true;
}
});

unawaited(
Future<void>(
() async {
await controller.setLooping(true);
await controller.initialize().then((_) {
isInitialized.value = true;
controller.play();
});
},
),
);

return controller.dispose;
},
const [],
);

return SizedBox.expand(
child: FittedBox(
fit: BoxFit.cover,
child: isInitialized.value
? SizedBox(
width: controller.value.size.width,
height: controller.value.size.height,
child: VideoPlayer(controller),
)
: const Center(child: CircularProgressIndicator()),
),
);
}
}
Loading
Loading