Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

webview_flutter version upgrade and linter fixes #100

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';

import 'webview_page.dart';
import 'package:webviewx_example/webview_page.dart';

void main() {
runApp(const MyApp());
Expand Down
12 changes: 6 additions & 6 deletions example/lib/webview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:webviewx/webviewx.dart';

import 'helpers.dart';
import 'package:webviewx_example/helpers.dart';

class WebViewXPage extends StatefulWidget {
const WebViewXPage({
Key? key,
}) : super(key: key);

@override
_WebViewXPageState createState() => _WebViewXPageState();
State<WebViewXPage> createState() => _WebViewXPageState();
}

class _WebViewXPageState extends State<WebViewXPage> {
Expand Down Expand Up @@ -47,19 +47,19 @@ class _WebViewXPageState extends State<WebViewXPage> {
padding: const EdgeInsets.only(bottom: 20.0),
child: Text(
'Play around with the buttons below',
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
),
),
buildSpace(direction: Axis.vertical, amount: 10.0, flex: false),
Container(
DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 0.2),
),
child: _buildWebViewX(),
),
Expanded(
child: Scrollbar(
isAlwaysShown: true,
thumbVisibility: true,
child: SizedBox(
width: min(screenSize.width * 0.8, 512),
child: ListView(
Expand Down Expand Up @@ -102,7 +102,7 @@ class _WebViewXPageState extends State<WebViewXPage> {
DartCallback(
name: 'TestDartCallback',
callBack: (msg) => showSnackBar(msg.toString(), context),
)
),
},
webSpecificParams: const WebSpecificParams(
printDebugInfo: true,
Expand Down
Loading