diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 70aa5855..5ef49ab4 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; @@ -16,7 +17,9 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:webview_flutter/webview_flutter.dart'; class AllHabibMedicalService extends StatefulWidget { @override @@ -264,18 +267,20 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).parking, ), ServicesContainer( - onTap: () =>launch("https://hmgwebservices.com/vt_mobile/html/index.html"), + onTap: () => launch( + "https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: 'assets/images/new-design/virtual_tour_icon.png', title: 'Virtual Tour', ), ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: ParkingPage(), - ), - ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => MyWebView( + title: "HMG News", + selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ))); + }, imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', title: 'Latest News', diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart new file mode 100644 index 00000000..e614c8d0 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -0,0 +1,38 @@ +import 'dart:async'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +import 'package:webview_flutter/webview_flutter.dart'; +import 'package:tweet_webview/tweet_webview.dart'; + +class MyWebView extends StatelessWidget { + final String title; + final String selectedUrl; + + final Completer _controller = + Completer(); + + MyWebView({ + @required this.title, + @required this.selectedUrl, + }); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: title, + + body: + WebView( + initialUrl: selectedUrl, + javascriptMode: JavascriptMode.unrestricted, + onWebViewCreated: (WebViewController webViewController) { + _controller.complete(webViewController); + }, + ) + + + ); + } +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 9b9588fd..b5a2444a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,8 +16,9 @@ dependencies: flutter_localizations: sdk: flutter intl: ^0.16.1 - - + # web view + webview_flutter: ^0.3.24 + tweet_webview: ^0.2.2 # http client http: ^0.12.1 connectivity: ^0.4.9