Skip to content

Commit

Permalink
Terms and conditions optimization (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
thePeras authored Dec 18, 2023
2 parents 36e66a7 + 8e29c1a commit 43484df
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 10 deletions.
30 changes: 30 additions & 0 deletions uni/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
channel: unknown

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- platform: ios
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
23 changes: 23 additions & 0 deletions uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions uni/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Launch Screen Assets

You can customize the launch screen with your own desired assets by replacing the image files in this directory.

You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
12 changes: 12 additions & 0 deletions uni/ios/RunnerTests/RunnerTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Flutter
import UIKit
import XCTest

class RunnerTests: XCTestCase {

func testExample() {
// If you add code to the Runner application, consider adding tests here.
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
}

}
10 changes: 0 additions & 10 deletions uni/lib/controller/load_static/terms_and_conditions.dart
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
import 'dart:convert';

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:crypto/crypto.dart';
import 'package:flutter/services.dart' show rootBundle;
import 'package:http/http.dart' as http;
import 'package:uni/controller/local_storage/app_shared_preferences.dart';

/// Returns the content of the Terms and Conditions remote file,
/// or the local one if the remote file is not available.
///
/// If this operation is unsuccessful, an error message is returned.
Future<String> fetchTermsAndConditions() async {
if (await Connectivity().checkConnectivity() != ConnectivityResult.none) {
const url =
'https://raw.githubusercontent.com/NIAEFEUP/project-schrodinger/develop/uni/assets/text/TermsAndConditions.md';
final response = await http.get(Uri.parse(url));
if (response.statusCode == 200) {
return response.body;
}
}
return rootBundle.loadString('assets/text/TermsAndConditions.md');
}

Expand Down

0 comments on commit 43484df

Please sign in to comment.