From bb84f47c5feaf58b8ad6d3dc7e2d83b9751d1749 Mon Sep 17 00:00:00 2001 From: gigabite-pro Date: Thu, 24 Jun 2021 17:04:23 +0530 Subject: [PATCH] moreInfo --- lib/screens/monument.dart | 27 ++++++++++++++++++++++++++ lib/screens/moreInfo.dart | 40 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 lib/screens/moreInfo.dart diff --git a/lib/screens/monument.dart b/lib/screens/monument.dart index 64a5ced..c773a1a 100644 --- a/lib/screens/monument.dart +++ b/lib/screens/monument.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'package:bharat_mystery/screens/directions.dart'; +import 'package:bharat_mystery/screens/moreInfo.dart'; import 'package:bharat_mystery/screens/quiz.dart'; import 'package:bharat_mystery/screens/streetview.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; @@ -397,6 +398,32 @@ class _MonumentContentState extends State { ), ), ), + SizedBox( + height: 10.0, + ), + MaterialButton( + splashColor: Colors.white, + padding: EdgeInsets.symmetric(horizontal: 35.0), + height: 30.0, + elevation: 5.0, + shape: StadiumBorder(), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + MoreInfo(url: result['moreInfo']), + )); + }, + color: Colors.black, + child: Text( + "Get More Info", + style: TextStyle( + fontSize: 13.0, + color: Colors.white, + ), + ), + ), FractionallySizedBox( widthFactor: 0.9, child: Container( diff --git a/lib/screens/moreInfo.dart b/lib/screens/moreInfo.dart new file mode 100644 index 0000000..efa4951 --- /dev/null +++ b/lib/screens/moreInfo.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:webview_flutter/webview_flutter.dart'; + +class MoreInfo extends StatefulWidget { + final String url; + MoreInfo({this.url}); + + @override + _MoreInfoState createState() => _MoreInfoState(); +} + +class _MoreInfoState extends State { + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + backgroundColor: Theme.of(context).accentColor, + leading: IconButton( + icon: Icon( + Icons.arrow_back, + color: Theme.of(context).highlightColor, + ), + onPressed: () => Navigator.of(context).pop(), + ), + title: Text( + "More Info", + style: TextStyle( + fontFamily: 'LexendDeca', + color: Theme.of(context).highlightColor), + ), + ), + body: WebView( + initialUrl: widget.url, + javascriptMode: JavascriptMode.unrestricted, + ), + ), + ); + } +}