Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ezeanyimhenry committed Jul 31, 2024
1 parent d517ff5 commit 017216b
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 11 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
GEMINI_API_KEY='you_api_key'
VIDEO_TOKEN='video_token'
17 changes: 17 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
PODS:
- Flutter (1.0.0)
- flutter_inappwebview_ios (0.0.1):
- Flutter
- flutter_inappwebview_ios/Core (= 0.0.1)
- OrderedSet (~> 5.0)
- flutter_inappwebview_ios/Core (0.0.1):
- Flutter
- OrderedSet (~> 5.0)
- nfc_manager (0.0.1):
- Flutter
- OrderedSet (5.0.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -14,14 +22,21 @@ PODS:

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- nfc_manager (from `.symlinks/plugins/nfc_manager/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:
- OrderedSet

EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_inappwebview_ios:
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
nfc_manager:
:path: ".symlinks/plugins/nfc_manager/ios"
path_provider_foundation:
Expand All @@ -33,7 +48,9 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
nfc_manager: d7da7cb781f7744b94df5fe9dbca904ac4a0939e
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
Expand Down
42 changes: 33 additions & 9 deletions lib/presentation/screens/watch_demo_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:chewie/chewie.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:nfc_app/constants/app_colors.dart';
Expand All @@ -16,23 +18,42 @@ class WatchDemoScreen extends StatefulWidget {
}

class _WatchDemoScreenState extends State<WatchDemoScreen> {
late VideoPlayerController _controller;
late VideoPlayerController _videoPlayerController;
late ChewieController _chewieController;
@override
void initState() {
final String videoToken = dotenv.env['VIDEO_TOKEN'] ?? '';
super.initState();
_controller = VideoPlayerController.networkUrl(Uri.parse(
'https://firebasestorage.googleapis.com/v0/b/landlisting-d88df.appspot.com/o/buddy.MP4?alt=media&token=325610ac-2de9-48bd-a9ce-9391f25de774'))
_videoPlayerController = VideoPlayerController.networkUrl(Uri.parse(
'https://firebasestorage.googleapis.com/v0/b/landlisting-d88df.appspot.com/o/buddy.MP4?alt=media&token=$videoToken'))
..initialize().then((_) {
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
setState(() {});
});

_controller.play();
_chewieController = ChewieController(
videoPlayerController: _videoPlayerController,
aspectRatio: 16 / 9,
autoPlay: true,
looping: true,
showControls: true,
showControlsOnInitialize: true,
materialProgressColors: ChewieProgressColors(
playedColor: Colors.red,
handleColor: Colors.red,
backgroundColor: Colors.grey,
bufferedColor: Colors.lightGreen,
),
placeholder: Center(
child: CircularProgressIndicator(),
),
);
}

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

Expand Down Expand Up @@ -68,12 +89,15 @@ class _WatchDemoScreenState extends State<WatchDemoScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
color: AppColors.primaryColor,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: AppColors.primaryColor,
),
width: double.infinity,
height: 356,
child: VideoPlayer(
_controller
),
child: Chewie(
controller: _chewieController,
),
),
const YGap(value: 32.0),
Text(
Expand Down
4 changes: 4 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import FlutterMacOS
import Foundation

import flutter_inappwebview_macos
import package_info_plus
import path_provider_foundation
import shared_preferences_foundation
import video_player_avfoundation
import wakelock_plus

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
}
84 changes: 82 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.3"
chewie:
dependency: "direct main"
description:
name: chewie
sha256: d4983f05f28f63ed05c1a741ac7327f6d72dff73f27484953478179fe70e762b
url: "https://pub.dev"
source: hosted
version: "1.8.2"
cli_util:
dependency: transitive
description:
Expand Down Expand Up @@ -105,6 +113,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.8"
dbus:
dependency: transitive
description:
name: dbus
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
url: "https://pub.dev"
source: hosted
version: "0.7.10"
dropdown_search:
dependency: "direct main"
description:
Expand Down Expand Up @@ -206,6 +222,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.8"
flutter_launcher_icons:
dependency: "direct dev"
description:
name: flutter_launcher_icons
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
url: "https://pub.dev"
source: hosted
version: "0.13.1"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -296,6 +320,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.7"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
version: "4.9.0"
leak_tracker:
dependency: transitive
description:
Expand Down Expand Up @@ -368,6 +400,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.5.0"
package_info_plus:
dependency: transitive
description:
name: package_info_plus
sha256: "4de6c36df77ffbcef0a5aefe04669d33f2d18397fea228277b852a2d4e58e860"
url: "https://pub.dev"
source: hosted
version: "8.0.1"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66
url: "https://pub.dev"
source: hosted
version: "3.0.1"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -669,14 +717,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "14.2.1"
wakelock_plus:
dependency: transitive
description:
name: wakelock_plus
sha256: "4fa83a128b4127619e385f686b4f080a5d2de46cff8e8c94eccac5fcf76550e5"
url: "https://pub.dev"
source: hosted
version: "1.2.7"
wakelock_plus_platform_interface:
dependency: transitive
description:
name: wakelock_plus_platform_interface
sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
web:
dependency: transitive
description:
name: web
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
version: "0.5.1"
win32:
dependency: transitive
description:
name: win32
sha256: "015002c060f1ae9f41a818f2d5640389cc05283e368be19dc8d77cecb43c40c9"
url: "https://pub.dev"
source: hosted
version: "5.5.3"
xdg_directories:
dependency: transitive
description:
Expand All @@ -693,6 +765,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.5.0"
yaml:
dependency: transitive
description:
name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
youtube_player_flutter:
dependency: "direct main"
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies:
timeago: ^3.7.0
video_player: ^2.8.6
youtube_player_flutter: ^9.0.1
chewie: ^1.8.2

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 017216b

Please sign in to comment.