How to build a flutter web view app with splash screen using very good adventure

dart pub global activate very_good_cli
very_good create echurch 
C:\Users\your_pc_name\AppData\Local\Pub\Cache\bin
"very_good help" to see global options.
"very_good help" to see global options.
emulator -avd Pixel1
emulator -avd Pixel1 -dns-server 8.8.8.8

$ flutter run --flavor development --target lib/main_development.dart
$ flutter run --flavor staging --target lib/main_staging.dart $ flutter run --flavor production --target lib/main_production.dart
flutter pub add webview_flutter
home: const WebViewContainer(
url: 'https://e-church.herokuapp.com/',
title: 'eChurch',
),
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class WebViewContainer extends StatefulWidget {
//define a constructor to accept the two parameters passed (URL and title)
const WebViewContainer({
Key? key,
required this.url,
required this.title,
}) : super(key: key);
final String url;
final String title;
//because of the no_logic_in_create_state we'll not pass any parameter into the WebViewContainerState() instead we'll use widget to access the parameter in the state
@override
WebViewContainerState createState() => WebViewContainerState();
}class WebViewContainerState extends State<WebViewContainer> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
//pass in the title here
title: Text(widget.title),
),
body: Column(
children: [
Expanded(
child: WebView(
//pass in the key here
key: widget.key,
javascriptMode: JavascriptMode.unrestricted,
//pass in the url
initialUrl: widget.url,
),
),
],
),
);
}
}
flutter run --flavor development --target lib/main_development.dart
build_runner: ^2.1.7flutter pub getflutter pub getflutter packages run build_runner build --delete-conflicting-outputs
dependencies:
splash_screen_view: ^3.0.0
flutter packages get
import 'package:splash_screen_view/SplashScreenView.dart';
home: SplashScreenView(
navigateRoute: const MyApp(),
duration: 10000,
imageSize: 130,
//create an assets folder and add the image to be displayed on the splash screen
imageSrc: 'assets/logo.png',
//text displayed on the splash screen
text: 'eChurch',
//apply animation to the text
textType: TextType.ColorizeAnimationText,
textStyle: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 30,
),
colors: const [
Colors.black,
Colors.blue,
Colors.black,
Colors.blue,
],
backgroundColor: Colors.white,
),
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: WebViewContainer(
url: 'https://e-church.herokuapp.com/',
title: 'eChurch',
),
);
}
}
flutter run --flavor development --target lib/main_development.dart
<uses-permission android:name="android.permission.INTERNET"/>
flutter run --flavor production --target lib/main_production.dart

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store