Skip to content

Commit

Permalink
Fix analyze issue workflow (#307)
Browse files Browse the repository at this point in the history
* fix analyze issue workflow

* an attempt to fix
  • Loading branch information
letsintegreat committed Jun 2, 2023
1 parent 4888514 commit b17503f
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 20 deletions.
45 changes: 45 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Uncomment this line to define a global platform for your project
platform :ios, '12.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)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
8 changes: 1 addition & 7 deletions lib/src/pages/home/report_bug.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import 'dart:io';
import 'dart:math';
//import 'dart:typed_data';
import 'dart:ui';

import 'package:blt/src/util/api/general_api.dart';
import 'package:blt/src/util/endpoints/general_endpoints.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
Expand Down Expand Up @@ -39,7 +37,6 @@ class _ReportBugState extends ConsumerState<ReportBug> {
return SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 20),
child: ReportForm(
size: window.physicalSize / window.devicePixelRatio,
parentContext: context,
reportPageDefaults: widget.reportPageDefaults,
),
Expand All @@ -48,13 +45,11 @@ class _ReportBugState extends ConsumerState<ReportBug> {
}

class ReportForm extends ConsumerStatefulWidget {
final Size size;
final BuildContext parentContext;
final ReportPageDefaults reportPageDefaults;

const ReportForm({
Key? key,
required this.size,
required this.parentContext,
required this.reportPageDefaults,
}) : super(key: key);
Expand Down Expand Up @@ -365,7 +360,6 @@ class _ReportFormState extends ConsumerState<ReportForm> {

@override
Widget build(BuildContext context) {
final Size size = widget.size;
return Form(
key: _formKey,
child: Column(
Expand Down Expand Up @@ -864,7 +858,7 @@ class _ReportFormState extends ConsumerState<ReportForm> {
),
),
Container(
width: size.width,
width: double.infinity,
height: 50,
child: TextButton(
child: Text(
Expand Down
14 changes: 4 additions & 10 deletions lib/src/pages/home/start_hunt.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:io';
import 'dart:typed_data';
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
Expand All @@ -24,16 +23,13 @@ class _StartHuntPageState extends ConsumerState<StartHuntPage> {
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 20),
child: HuntForm(
size: window.physicalSize / window.devicePixelRatio,
),
child: HuntForm(),
);
}
}

class HuntForm extends StatefulWidget {
final Size size;
const HuntForm({Key? key, required this.size}) : super(key: key);
const HuntForm({Key? key}) : super(key: key);

@override
State<HuntForm> createState() => _HuntFormState();
Expand Down Expand Up @@ -90,7 +86,6 @@ class _HuntFormState extends State<HuntForm> {

@override
Widget build(BuildContext context) {
final Size size = widget.size;
return Form(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down Expand Up @@ -191,7 +186,7 @@ class _HuntFormState extends State<HuntForm> {
),
Container(
height: 280,
width: size.width,
width: double.infinity,
margin: const EdgeInsets.only(bottom: 12.0),
child: _image.path == ""
? Center(
Expand Down Expand Up @@ -255,7 +250,6 @@ class _HuntFormState extends State<HuntForm> {
),
),
Container(
width: 0.6 * size.width,
child: Slider.adaptive(
value: prizeMoney.toDouble(),
max: 10000,
Expand All @@ -274,7 +268,7 @@ class _HuntFormState extends State<HuntForm> {
),
),
Container(
width: size.width,
width: double.infinity,
height: 50,
child: TextButton(
child: Text(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/pages/issues/issue_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class IssueDetailPage extends StatelessWidget {
static final String path = "lib/src/pages/blog/article1.dart";
final Issue issue;

List<int> validScreenshotIndexes = [];
final List<int> validScreenshotIndexes = [];

IssueDetailPage({
Key? key,
Expand Down Expand Up @@ -46,7 +46,7 @@ class IssueDetailPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
validScreenshotIndexes = [];
validScreenshotIndexes.clear();
for (var i = 1; i <= issue.screenshotsLink!.length; i++) {
validScreenshotIndexes.add(i);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/util/services/init_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class InitService {

static void _setOrientation() {
final shortestSide =
MediaQueryData.fromWindow(WidgetsBinding.instance.window)
MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first)
.size
.shortestSide;
if (shortestSide > 600) {
Expand Down

0 comments on commit b17503f

Please sign in to comment.