forked from yaso_meth/mih-project
Merge pull request Tile-Long-Press-For-More_Details
Tile-Long-Press-For-More_Details
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/mih_components/mih_layout/mih_app_drawer.dart';
|
||||
|
||||
import 'mih_app_drawer.dart';
|
||||
import 'mih_body.dart';
|
||||
import 'mih_header.dart';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/mih_components/mih_layout/mih_action.dart';
|
||||
import 'package:pdf/pdf.dart';
|
||||
import 'package:printing/printing.dart';
|
||||
|
||||
import '../../mih_objects/arguments.dart';
|
||||
import '../mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'mih_action.dart';
|
||||
|
||||
class MIHPrintPreview extends StatefulWidget {
|
||||
final PrintPreviewArguments arguments;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_yt_video_player.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import '../../main.dart';
|
||||
import 'package:youtube_player_flutter/youtube_player_flutter.dart';
|
||||
|
||||
import 'mih_window.dart';
|
||||
|
||||
class MIHTile extends StatefulWidget {
|
||||
final String tileName;
|
||||
final String? videoYTLink;
|
||||
final String? videoID;
|
||||
final Widget tileIcon;
|
||||
final void Function() onTap;
|
||||
// final Widget tileIcon;
|
||||
@@ -18,7 +16,7 @@ class MIHTile extends StatefulWidget {
|
||||
super.key,
|
||||
required this.onTap,
|
||||
required this.tileName,
|
||||
this.videoYTLink,
|
||||
this.videoID,
|
||||
required this.tileIcon,
|
||||
required this.p,
|
||||
required this.s,
|
||||
@@ -31,28 +29,9 @@ class MIHTile extends StatefulWidget {
|
||||
class _MIHTileState extends State<MIHTile> {
|
||||
late Color mainC;
|
||||
late Color secondC;
|
||||
late YoutubePlayerController videoController;
|
||||
|
||||
String getVideID() {
|
||||
if (widget.videoYTLink != null) {
|
||||
return YoutubePlayer.convertUrlToId(widget.videoYTLink!) as String;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// void listener() {
|
||||
// if (_isPlayerReady && mounted && !videoController.value.isFullScreen) {
|
||||
// setState(() {
|
||||
// _playerState = videoController.value.playerState;
|
||||
// _videoMetaData = videoController.metadata;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
videoController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -60,19 +39,11 @@ class _MIHTileState extends State<MIHTile> {
|
||||
void initState() {
|
||||
mainC = widget.p;
|
||||
secondC = widget.s;
|
||||
|
||||
videoController = YoutubePlayerController(
|
||||
initialVideoId: getVideID(),
|
||||
flags: YoutubePlayerFlags(
|
||||
autoPlay: false,
|
||||
mute: true,
|
||||
isLive: false,
|
||||
));
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void displayHint() {
|
||||
if (widget.videoYTLink != null) {
|
||||
if (widget.videoID != null) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
@@ -84,20 +55,7 @@ class _MIHTileState extends State<MIHTile> {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: [
|
||||
YoutubePlayerBuilder(
|
||||
player: YoutubePlayer(
|
||||
controller: videoController,
|
||||
showVideoProgressIndicator: true,
|
||||
progressIndicatorColor: Colors.amber,
|
||||
progressColors: ProgressBarColors(
|
||||
playedColor: Colors.amber,
|
||||
handleColor: Colors.amberAccent,
|
||||
),
|
||||
),
|
||||
builder: (context, player) {
|
||||
return player;
|
||||
},
|
||||
),
|
||||
MIHYTVideoPlayer(videoYTLink: widget.videoID!),
|
||||
],
|
||||
);
|
||||
},
|
||||
@@ -131,9 +89,9 @@ class _MIHTileState extends State<MIHTile> {
|
||||
borderRadius: BorderRadius.circular(80),
|
||||
// ho
|
||||
onTap: widget.onTap,
|
||||
// onLongPress: () {
|
||||
// displayHint();
|
||||
// },
|
||||
onLongPress: () {
|
||||
displayHint();
|
||||
},
|
||||
// hoverDuration: ,
|
||||
splashColor:
|
||||
MzanziInnovationHub.of(context)!.theme.highlightColor(),
|
||||
@@ -143,26 +101,6 @@ class _MIHTileState extends State<MIHTile> {
|
||||
),
|
||||
),
|
||||
),
|
||||
// Material(
|
||||
// color: mainC,
|
||||
// borderRadius: BorderRadius.circular(80),
|
||||
// child: Ink(
|
||||
// // width: 200,
|
||||
// // height: 200,
|
||||
// padding: const EdgeInsets.all(20),
|
||||
// child: InkWell(
|
||||
// onTap: widget.onTap,
|
||||
// hoverDuration: Duration(seconds: 2),
|
||||
// highlightColor:
|
||||
// MzanziInnovationHub.of(context)!.theme.messageTextColor(),
|
||||
// child: SizedBox(
|
||||
// height: 200,
|
||||
// width: 200,
|
||||
// child: widget.tileIcon,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
|
||||
46
Frontend/lib/mih_components/mih_yt_video_player.dart
Normal file
46
Frontend/lib/mih_components/mih_yt_video_player.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:youtube_player_iframe/youtube_player_iframe.dart';
|
||||
|
||||
class MIHYTVideoPlayer extends StatefulWidget {
|
||||
final String videoYTLink;
|
||||
const MIHYTVideoPlayer({
|
||||
super.key,
|
||||
required this.videoYTLink,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHYTVideoPlayer> createState() => _MIHYTVideoPlayerState();
|
||||
}
|
||||
|
||||
class _MIHYTVideoPlayerState extends State<MIHYTVideoPlayer> {
|
||||
late YoutubePlayerController _controller;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_controller = YoutubePlayerController(
|
||||
params: const YoutubePlayerParams(
|
||||
enableCaption: false,
|
||||
showControls: true,
|
||||
mute: false,
|
||||
showFullscreenButton: false,
|
||||
loop: false,
|
||||
),
|
||||
);
|
||||
_controller.loadVideoById(videoId: widget.videoYTLink);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return YoutubePlayer(
|
||||
controller: _controller,
|
||||
aspectRatio: 16 / 9,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -80,6 +80,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
void setAppsNewPersonal(List<MIHTile> tileList) {
|
||||
if (widget.signedInUser.fname == "") {
|
||||
tileList.add(MIHTile(
|
||||
videoID: "jFV3NN65DtQ",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed('/user-profile',
|
||||
arguments: AppProfileUpdateArguments(
|
||||
@@ -99,6 +100,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
|
||||
void setAppsNewBusiness(List<MIHTile> tileList) {
|
||||
tileList.add(MIHTile(
|
||||
videoID: "Nfp4pVBZL78",
|
||||
onTap: () {
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
'/business-profile/set-up',
|
||||
@@ -119,7 +121,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
void setAppsPersonal(List<MIHTile> tileList) {
|
||||
ImageProvider logo = MzanziInnovationHub.of(context)!.theme.logoImage();
|
||||
tileList.add(MIHTile(
|
||||
videoYTLink: "https://www.youtube.com/watch?v=P2bM9eosJ_A",
|
||||
videoID: "P2bM9eosJ_A",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/user-profile',
|
||||
@@ -136,6 +138,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
s: getSec(),
|
||||
));
|
||||
tileList.add(MIHTile(
|
||||
videoID: "NUDdoWrbXNc",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed('/patient-profile',
|
||||
arguments: PatientViewArguments(
|
||||
@@ -204,6 +207,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
s: getSec(),
|
||||
));
|
||||
tileList.add(MIHTile(
|
||||
videoID: "hbKhlmY_56U",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/about',
|
||||
@@ -230,6 +234,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
|
||||
void setAppsBusiness(List<MIHTile> tileList) {
|
||||
tileList.add(MIHTile(
|
||||
videoID: "NWyJZq2ZYOM",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/business-profile/manage',
|
||||
@@ -273,6 +278,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
// s: getSec(),
|
||||
// ));
|
||||
tileList.add(MIHTile(
|
||||
videoID: "D6q2qIavoiY",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/patient-manager',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import '../../main.dart';
|
||||
import '../../mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import '../../mih_objects/app_user.dart';
|
||||
import '../../mih_objects/arguments.dart';
|
||||
import '../../mih_objects/patients.dart';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:youtube_player_flutter/youtube_player_flutter.dart';
|
||||
|
||||
import '../../mih_components/mih_layout/mih_action.dart';
|
||||
import '../../mih_components/mih_layout/mih_body.dart';
|
||||
@@ -14,15 +13,15 @@ class MIHTest extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MIHTestState extends State<MIHTest> {
|
||||
late YoutubePlayerController videoController;
|
||||
String videoLink = "https://www.youtube.com/watch?v=P2bM9eosJ_A";
|
||||
@override
|
||||
void initState() {
|
||||
videoController = YoutubePlayerController(
|
||||
initialVideoId: "P2bM9eosJ_A",
|
||||
);
|
||||
super.initState();
|
||||
}
|
||||
// late YoutubePlayerController videoController;
|
||||
// String videoLink = "https://www.youtube.com/watch?v=P2bM9eosJ_A";
|
||||
// @override
|
||||
// void initState() {
|
||||
// videoController = YoutubePlayerController(
|
||||
// initialVideoId: "P2bM9eosJ_A",
|
||||
// );
|
||||
// super.initState();
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -54,9 +53,9 @@ class _MIHTestState extends State<MIHTest> {
|
||||
body: MIHBody(
|
||||
borderOn: false,
|
||||
bodyItems: [
|
||||
YoutubePlayer(
|
||||
controller: videoController,
|
||||
),
|
||||
// YoutubePlayer(
|
||||
// controller: videoController,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
actionDrawer: null,
|
||||
|
||||
@@ -8,7 +8,6 @@ import Foundation
|
||||
import app_links
|
||||
import device_info_plus
|
||||
import firebase_core
|
||||
import flutter_inappwebview_macos
|
||||
import geolocator_apple
|
||||
import no_screenshot
|
||||
import path_provider_foundation
|
||||
@@ -16,12 +15,12 @@ import printing
|
||||
import shared_preferences_foundation
|
||||
import syncfusion_pdfviewer_macos
|
||||
import url_launcher_macos
|
||||
import webview_flutter_wkwebview
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
|
||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
||||
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
|
||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||
NoScreenshotPlugin.register(with: registry.registrar(forPlugin: "NoScreenshotPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
@@ -29,4 +28,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
SyncfusionFlutterPdfViewerPlugin.register(with: registry.registrar(forPlugin: "SyncfusionFlutterPdfViewerPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin"))
|
||||
}
|
||||
|
||||
@@ -406,70 +406,6 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_inappwebview:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_inappwebview
|
||||
sha256: "80092d13d3e29b6227e25b67973c67c7210bd5e35c4b747ca908e31eb71a46d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.5"
|
||||
flutter_inappwebview_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_inappwebview_android
|
||||
sha256: "62557c15a5c2db5d195cb3892aab74fcaec266d7b86d59a6f0027abd672cddba"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.3"
|
||||
flutter_inappwebview_internal_annotations:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_inappwebview_internal_annotations
|
||||
sha256: "5f80fd30e208ddded7dbbcd0d569e7995f9f63d45ea3f548d8dd4c0b473fb4c8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
flutter_inappwebview_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_inappwebview_ios
|
||||
sha256: "5818cf9b26cf0cbb0f62ff50772217d41ea8d3d9cc00279c45f8aabaa1b4025d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
flutter_inappwebview_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_inappwebview_macos
|
||||
sha256: c1fbb86af1a3738e3541364d7d1866315ffb0468a1a77e34198c9be571287da1
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
flutter_inappwebview_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_inappwebview_platform_interface
|
||||
sha256: cf5323e194096b6ede7a1ca808c3e0a078e4b33cc3f6338977d75b4024ba2500
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0+1"
|
||||
flutter_inappwebview_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_inappwebview_web
|
||||
sha256: "55f89c83b0a0d3b7893306b3bb545ba4770a4df018204917148ebb42dc14a598"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
flutter_inappwebview_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_inappwebview_windows
|
||||
sha256: "8b4d3a46078a2cdc636c4a3d10d10f2a16882f6be607962dbfff8874d1642055"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -1445,6 +1381,38 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
webview_flutter:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: webview_flutter
|
||||
sha256: ec81f57aa1611f8ebecf1d2259da4ef052281cb5ad624131c93546c79ccc7736
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.9.0"
|
||||
webview_flutter_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: webview_flutter_android
|
||||
sha256: "47a8da40d02befda5b151a26dba71f47df471cddd91dfdb7802d0a87c5442558"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.16.9"
|
||||
webview_flutter_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: webview_flutter_platform_interface
|
||||
sha256: d937581d6e558908d7ae3dc1989c4f87b786891ab47bb9df7de548a151779d8d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.10.0"
|
||||
webview_flutter_wkwebview:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: webview_flutter_wkwebview
|
||||
sha256: "3be297aa4ca78205abdd284cf55f168c35246c75b3079990ad8ba9d257681a30"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.16.2"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1493,14 +1461,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
youtube_player_flutter:
|
||||
youtube_player_iframe:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: youtube_player_flutter
|
||||
sha256: "4d14aa47f9c84929b5400a87ade4dcfdab87a2ca2e0b18ecc2ef852b1440e123"
|
||||
name: youtube_player_iframe
|
||||
sha256: db0e7aab8ac29c9e417dd145b522b18085fb505b85eb3c61e893341b129fe980
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.1.1"
|
||||
version: "5.2.0"
|
||||
youtube_player_iframe_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: youtube_player_iframe_web
|
||||
sha256: "73dd7bbbe8a6519b5d58905122153e38591f753ad2df40b5328a9d8474e1587e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
sdks:
|
||||
dart: ">=3.5.0 <3.6.0"
|
||||
flutter: ">=3.24.0"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: patient_manager
|
||||
description: "A new Flutter project."
|
||||
name: Mzansi_Innovation_Hub
|
||||
description: ""
|
||||
# The following line prevents the package from being accidentally published to
|
||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
@@ -60,8 +60,8 @@ dependencies:
|
||||
firebase_core: ^3.6.0
|
||||
table_calendar: ^3.1.2
|
||||
flutter_swipe_detector: ^2.0.0
|
||||
youtube_player_flutter: ^9.1.1
|
||||
|
||||
youtube_player_iframe: ^5.2.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include <app_links/app_links_plugin_c_api.h>
|
||||
#include <firebase_core/firebase_core_plugin_c_api.h>
|
||||
#include <flutter_inappwebview_windows/flutter_inappwebview_windows_plugin_c_api.h>
|
||||
#include <geolocator_windows/geolocator_windows.h>
|
||||
#include <printing/printing_plugin.h>
|
||||
#include <syncfusion_pdfviewer_windows/syncfusion_pdfviewer_windows_plugin.h>
|
||||
@@ -19,8 +18,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
|
||||
FirebaseCorePluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
|
||||
FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi"));
|
||||
GeolocatorWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("GeolocatorWindows"));
|
||||
PrintingPluginRegisterWithRegistrar(
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
app_links
|
||||
firebase_core
|
||||
flutter_inappwebview_windows
|
||||
geolocator_windows
|
||||
printing
|
||||
syncfusion_pdfviewer_windows
|
||||
|
||||
Reference in New Issue
Block a user