diff --git a/shadowwalkerz/Backend.zip b/shadowwalkerz/Backend.zip new file mode 100644 index 0000000..0f3828b Binary files /dev/null and b/shadowwalkerz/Backend.zip differ diff --git a/shadowwalkerz/Backend/Keywords/all_combined_keywords.txt b/shadowwalkerz/Backend/Keywords/all_combined_keywords.txt new file mode 100644 index 0000000..55285d6 --- /dev/null +++ b/shadowwalkerz/Backend/Keywords/all_combined_keywords.txt @@ -0,0 +1,55 @@ +care +forest +group +playing +tiger +sore +with +tree +build +bite +elephant +python +kid +powerful +teamwork +hills +stretching +trunk +eat +ostrich +climbing +riding +home +1 +ant +2 +laugh +banana +3 +mother +nose +destructive +eating +destroy +anthill +hippopotamus +trumbling +crossing +river +baby +washing +running +ants +jungle +ride +break +water +family +bird +Mischievous +tickle +fix +snake +maxresdefault +angry \ No newline at end of file diff --git a/shadowwalkerz/Backend/__pycache__/gen.cpython-311.pyc b/shadowwalkerz/Backend/__pycache__/gen.cpython-311.pyc new file mode 100644 index 0000000..ae8076f Binary files /dev/null and b/shadowwalkerz/Backend/__pycache__/gen.cpython-311.pyc differ diff --git a/shadowwalkerz/Backend/__pycache__/quiz.cpython-311.pyc b/shadowwalkerz/Backend/__pycache__/quiz.cpython-311.pyc new file mode 100644 index 0000000..60180ed Binary files /dev/null and b/shadowwalkerz/Backend/__pycache__/quiz.cpython-311.pyc differ diff --git a/shadowwalkerz/Backend/__pycache__/quiz_game.cpython-311.pyc b/shadowwalkerz/Backend/__pycache__/quiz_game.cpython-311.pyc new file mode 100644 index 0000000..04ac026 Binary files /dev/null and b/shadowwalkerz/Backend/__pycache__/quiz_game.cpython-311.pyc differ diff --git a/shadowwalkerz/Backend/__pycache__/video.cpython-311.pyc b/shadowwalkerz/Backend/__pycache__/video.cpython-311.pyc new file mode 100644 index 0000000..be60a19 Binary files /dev/null and b/shadowwalkerz/Backend/__pycache__/video.cpython-311.pyc differ diff --git a/shadowwalkerz/Backend/app.py b/shadowwalkerz/Backend/app.py new file mode 100644 index 0000000..5873e00 --- /dev/null +++ b/shadowwalkerz/Backend/app.py @@ -0,0 +1,257 @@ +import re +import sqlite3 +import PyPDF2 +from flask import Flask, request, jsonify, send_from_directory +import os +from werkzeug.utils import secure_filename +import google.generativeai as genai +import threading +from flask_cors import CORS +from video import process_files_for_keywords +from gen import process_single_pdf +from quiz import process_second_pdf +from quiz_game import save_score_to_database + +app = Flask(__name__) +CORS(app) + +input_folder = r"./input_pdfs" +output_folder = r"./output_txt" +image_folder = "./dataset/english" +output_video = "./Keywords" + +ALLOWED_EXTENSIONS = {'pdf'} + +def allowed_file(filename): + return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS + +@app.route('/upload', methods=['POST']) +def upload_file(): + if 'pdf' not in request.files: + return jsonify({'error': 'No file part'}), 400 + + file = request.files['pdf'] + + if file.filename == '': + return jsonify({'error': 'No selected file'}), 400 + + if file and allowed_file(file.filename): + filename = secure_filename(file.filename) + file_path = os.path.join(input_folder, filename) + file.save(file_path) + + threading.Thread(target=process_single_pdf, args=(filename, input_folder, output_folder)).start() + threading.Thread(target=process_second_pdf, args=(filename, input_folder, output_folder)).start() + threading.Thread(target=process_files_for_keywords, args=(output_folder, image_folder, output_video)).start() + + return jsonify({'message': 'File uploaded and processing started'}), 200 + else: + return jsonify({'error': 'Invalid file format. Please upload a PDF file.'}), 400 + +@app.route('/get_mcqs', methods=['GET']) +def get_mcqs(): + db_path = os.path.join(r"../Backend", 'mcq_database.db') + + try: + conn = sqlite3.connect(db_path) + cursor = conn.cursor() + + cursor.execute('SELECT id, question FROM mcqs') + questions = cursor.fetchall() + mcqs_data = [] + + for question_id, question in questions: + cursor.execute('SELECT option_text FROM options WHERE question_id = ?', (question_id,)) + options = cursor.fetchall() + mcqs_data.append({ + 'id': question_id, + 'question': question, + 'options': [option[0] for option in options] + }) + + conn.close() + return jsonify(mcqs_data), 200 + + except Exception as e: + return jsonify({'error': str(e)}), 500 + +@app.route('/submit_answers', methods=['POST']) +def submit_answers(): + db_path = os.path.join(r"../Backend", 'mcq_database.db') + + try: + data = request.json + print(data) + if 'answers' not in data or not isinstance(data['answers'], list): + return jsonify({'error': 'No answers provided or invalid format'}), 400 + + answers = data['answers'] + score = 0 + + conn = sqlite3.connect(db_path) + cursor = conn.cursor() + + for answer in answers: + question_id = answer.get('question_id') + user_answer = answer.get('selected_option') + + if question_id is None or user_answer is None: + continue + + cursor.execute('SELECT answer FROM answers WHERE question_id = ?', (question_id,)) + correct_answer = cursor.fetchone() + + if correct_answer is not None: + correct_answer = correct_answer[0] + print(f"Correct answer: {correct_answer}") + + # Use regex to extract the correct answer letter (e.g., 'a' from 'Answer a...') + correct_match = re.search(r'Answer\s+([a-d])', correct_answer, re.IGNORECASE) + + user_match = re.search(r'Answer\s+([a-d])', user_answer, re.IGNORECASE) + + if correct_match and user_match: + correct_letter = correct_match.group(1).strip().lower() + user_letter = user_match.group(1).strip().lower() + + print(f"User answer: {user_letter}, Correct answer: {correct_letter}") + + if user_letter == correct_letter: + score += 1 # Increment score if the answer is correct + print(f"Score: {score}") + + # Close the database connection + conn.close() + save_score_to_database(score) + return jsonify({'score': score, 'total': len(answers)}), 200 + + except Exception as e: + return jsonify({'error': str(e)}), 500 + +# audio file and txt file +@app.route('/check-files', methods=['GET']) +def check_files(): + folder_path = r"./output_txt" + + files = os.listdir(folder_path) + + file1 = next((f for f in files if "summary.txt" in f), None) + file2 = next((f for f in files if "full_audio.mp3" in f), None) + + print(f"Summary File: {file1}\nAudio File: {file2}") + + # Check if files exist + file1_exists = file1 is not None and os.path.exists(os.path.join(folder_path, file1)) + file2_exists = file2 is not None and os.path.exists(os.path.join(folder_path, file2)) + + if file1_exists and file2_exists: + return jsonify({'files_exist': True, 'file1': file1, 'file2': file2}) + else: + return jsonify({'files_exist': False, 'missing_files': {'summary': file1 is None, 'audio': file2 is None}}) + +# Video File +@app.route('/check-video', methods=['GET']) +def check_video(): + folder_path = r"./Keywords" + + files = os.listdir(folder_path) + + file = next((f for f in files if "merged_video.mp4" in f), None) + + print(f"video File: {file}\n") + + # Check if files exist + file_exists = file is not None and os.path.exists(os.path.join(folder_path, file)) + + if file_exists: + return jsonify({'files_exist': True, 'video': file}) + else: + return jsonify({'files_exist': False, 'missing_files': {'video': file is None}}) + + +# Route to download specific files +@app.route('/download-video/', methods=['GET']) +def download_video(filename): + folder_path = r"./Keywords" + + if os.path.exists(os.path.join(folder_path, filename)): + return send_from_directory(folder_path, filename, as_attachment=True) + else: + return jsonify({'error': 'File not found'}), 404 + + +# Route to download specific files +@app.route('/download/', methods=['GET']) +def download_file(filename): + folder_path = r"./output_txt" + + if os.path.exists(os.path.join(folder_path, filename)): + return send_from_directory(folder_path, filename, as_attachment=True) + else: + return jsonify({'error': 'File not found'}), 404 + +#Chatting with pdfs +genai.configure(api_key="AIzaSyAcpkdxOkgN0iPb_tgq3ZV_pFVpotx_-gA") + +generation_config = { + "temperature": 1, + "top_p": 0.95, + "top_k": 64, + "max_output_tokens": 8192, + "response_mime_type": "text/plain", +} + +model = genai.GenerativeModel( + model_name="gemini-1.5-flash", + generation_config=generation_config, +) + + +# Extract text from the PDF +def extract_text_from_pdf(pdf_path): + if not os.path.exists(pdf_path): + return "PDF file not found." + + with open(pdf_path, "rb") as file: + reader = PyPDF2.PdfReader(file) + text = "" + for page in reader.pages: + text += page.extract_text() + return text + +@app.route('/ask', methods=['POST']) +def ask_question(): + data = request.json + question = data.get('question') + pdf_filename = data.get('pdf_filename') + + pdf_directory = r"./input_pdfs" + pdf_path = os.path.join(pdf_directory, pdf_filename) + + # Extract the text from the provided PDF + pdf_text = extract_text_from_pdf(pdf_path) + + if pdf_text == "PDF file not found.": + return jsonify({'answer': "The specified PDF file could not be found."}) + + # Create the prompt + prompt = ( + f"{question}\n\n" + f"Please answer in a concise manner using the following text:\n" + f"{pdf_text}\n\n" + "Provide your answer in 1-2 lines." + ) + + response = model.generate_content(prompt) + answer_text = response.text if hasattr(response, 'text') else str(response) + + if "I don't know" in answer_text or "not found" in answer_text: + return jsonify({'answer': "I don't know."}) + + return jsonify({'answer': answer_text.strip()}) + +if __name__ == '__main__': + os.makedirs(input_folder, exist_ok=True) + os.makedirs(output_folder, exist_ok=True) + + app.run(host='0.0.0.0', port=5000) diff --git a/shadowwalkerz/Backend/commands_error_occure.txt b/shadowwalkerz/Backend/commands_error_occure.txt new file mode 100644 index 0000000..a532700 --- /dev/null +++ b/shadowwalkerz/Backend/commands_error_occure.txt @@ -0,0 +1,3 @@ + +pip install -U langchain-community +pip install langchain faiss-cpu google-generativeai streamlit PyPDF2 python-dotenv diff --git a/shadowwalkerz/Backend/gen.py b/shadowwalkerz/Backend/gen.py new file mode 100644 index 0000000..8c7472b --- /dev/null +++ b/shadowwalkerz/Backend/gen.py @@ -0,0 +1,172 @@ +import os +import re +import time +import threading +from pdfminer.high_level import extract_text +import google.generativeai as genai +from gtts import gTTS +from pydub import AudioSegment, effects + +# Configure the Gemini API +genai.configure(api_key="AIzaSyAcpkdxOkgN0iPb_tgq3ZV_pFVpotx_-gA") + +# Create the model +generation_config = { + "temperature": 1, + "top_p": 0.95, + "top_k": 64, + "max_output_tokens": 8192, + "response_mime_type": "text/plain", +} + +model = genai.GenerativeModel( + model_name="gemini-1.5-flash", + generation_config=generation_config, +) + +# Function to extract text from a PDF and save it to a .txt file +def extract_text_from_pdf(pdf_path, txt_output_path): + try: + full_text = extract_text(pdf_path) + with open(txt_output_path, 'w', encoding='utf-8') as txt_file: + txt_file.write(full_text) + print(f"Text extracted and saved to {txt_output_path}") + return full_text + except Exception as e: + print(f"Error extracting text from {pdf_path}: {e}") + return None + +# Function to clean up text +def clean_text(text): + cleaned_text = re.sub(r'[#*]', '', text) + keywords_to_remove = ["example", "activity","Question"] # Add more keywords if needed + for keyword in keywords_to_remove: + cleaned_text = re.sub(rf'\b{keyword}\b', '', cleaned_text, flags=re.IGNORECASE) + cleaned_text = ' '.join(cleaned_text.split()) + return cleaned_text + +# Function to send the extracted text to the Gemini model and get a response +def send_text_to_gemini(extracted_text): + try: + start_time = time.time() + response = model.generate_content(extracted_text) + elapsed_time = time.time() - start_time + print(f"Gemini response received (took {elapsed_time:.2f} seconds)") + return response.text if response else "No response generated." + except Exception as e: + print(f"Error generating content: {e}") + return "Sorry, I'm having trouble generating a response." + +# Function to generate an audio file from the text using gTTS +def generate_audio_from_text(text, audio_output_path): + try: + tts = gTTS(text=text, lang='en') + temp_audio_file_path = audio_output_path.replace('.mp3', '_temp.mp3') + tts.save(temp_audio_file_path) + audio = AudioSegment.from_mp3(temp_audio_file_path) + + speed_change = 1.0 # Speed adjustment + new_sample_rate = int(audio.frame_rate * speed_change) + audio = audio._spawn(audio.raw_data, overrides={'frame_rate': new_sample_rate}) + audio = audio.set_frame_rate(44100) + + volume_change = 5 # Volume adjustment + audio = audio + volume_change + audio = effects.strip_silence(audio, silence_thresh=audio.dBFS - 14) + audio.export(audio_output_path, format='mp3') + + if os.path.exists(temp_audio_file_path): + os.remove(temp_audio_file_path) + + print(f"Adjusted audio file saved as: {audio_output_path}") + except Exception as e: + print(f"Error generating audio from text: {e}") + +# Function to generate audio in parallel +def generate_audio_from_text_parallel(text_chunk, audio_output_path): + threading.Thread(target=generate_audio_from_text, args=(text_chunk, audio_output_path)).start() + +# Function to save chunks, generate audio, and create a full audio file +def save_chunks_and_generate_audio(cleaned_response, output_folder, base_filename): + words = cleaned_response.split() + chunk_size = 200 + num_chunks = len(words) // chunk_size + (1 if len(words) % chunk_size != 0 else 0) + + all_text = [] + + for i in range(num_chunks): + chunk = ' '.join(words[i * chunk_size:(i + 1) * chunk_size]) + chunk_txt_path = os.path.join(output_folder, f"{base_filename}_chunk_{i + 1}.txt") + audio_output_path = os.path.join(output_folder, f"{base_filename}_chunk_{i + 1}_audio.mp3") + + with open(chunk_txt_path, 'w', encoding='utf-8') as txt_file: + txt_file.write(chunk) + + generate_audio_from_text_parallel(chunk, audio_output_path) + print(f"Saved {chunk_txt_path} and started audio generation for it.") + + all_text.append(chunk) + + full_text = ' '.join(all_text) + full_audio_output_path = os.path.join(output_folder, f"{base_filename}_full_audio.mp3") + + generate_audio_from_text(full_text, full_audio_output_path) + print(f"Generated complete audio file: {full_audio_output_path}") + +# Function to process a single PDF +def process_single_pdf(pdf_file, input_folder, output_folder): + pdf_path = os.path.join(input_folder, pdf_file) + txt_output_path = os.path.join(output_folder, f"{os.path.splitext(pdf_file)[0]}_raw.txt") + gemini_output_path = os.path.join(output_folder, f"{os.path.splitext(pdf_file)[0]}_processed.txt") + summary_output_path = os.path.join(output_folder, f"{os.path.splitext(pdf_file)[0]}_summary.txt") + + print(f"Processing {pdf_file}...") + + extracted_text = extract_text_from_pdf(pdf_path, txt_output_path) + if extracted_text is None: + return + + gemini_response = send_text_to_gemini(extracted_text + " I want to remove all unnecessary words and images, keeping only the text and space between paragraphs and remove all activity and questions not examples.") + if gemini_response is None: + return + + + + cleaned_response = clean_text(gemini_response) + + with open(gemini_output_path, 'w', encoding='utf-8') as txt_file: + txt_file.write(cleaned_response) + + print(f"Processed and updated {pdf_file} with Gemini response.") + summary_response = send_text_to_gemini("Summarize the following text:\n" + cleaned_response) + if summary_response: + with open(summary_output_path, 'w', encoding='utf-8') as summary_file: + summary_file.write(summary_response) + print(f"Summary generated and saved to {summary_output_path}") + + save_chunks_and_generate_audio(cleaned_response, output_folder, os.path.splitext(pdf_file)[0]) + + if os.path.exists(txt_output_path): + os.remove(txt_output_path) + print(f"Removed raw file {txt_output_path}") + +# Function to process all PDFs sequentially +def process_pdfs_sequentially(input_folder, output_folder): + if not os.path.exists(output_folder): + os.makedirs(output_folder) + + pdf_files = [f for f in os.listdir(input_folder) if f.endswith(".pdf")] + + for pdf_file in pdf_files: + process_single_pdf(pdf_file, input_folder, output_folder) + + print("All PDFs processed.") + +# Example usage +if __name__ == "__main__": + input_folder = "D:\Projects ALL\Practice Apps models\preception\Backend\input_pdfs" + output_folder = "D:\Projects ALL\Practice Apps models\preception\Backend\output_txt" + + process_pdfs_sequentially(input_folder, output_folder) + + print("Processing complete.") diff --git a/shadowwalkerz/Backend/input_pdfs/geah103.pdf b/shadowwalkerz/Backend/input_pdfs/geah103.pdf new file mode 100644 index 0000000..c2622e2 Binary files /dev/null and b/shadowwalkerz/Backend/input_pdfs/geah103.pdf differ diff --git a/shadowwalkerz/Backend/input_pdfs/new.txt b/shadowwalkerz/Backend/input_pdfs/new.txt new file mode 100644 index 0000000..e69de29 diff --git a/shadowwalkerz/Backend/mcq_database.db b/shadowwalkerz/Backend/mcq_database.db new file mode 100644 index 0000000..365bbf4 Binary files /dev/null and b/shadowwalkerz/Backend/mcq_database.db differ diff --git a/shadowwalkerz/Backend/output_txt/cleaned_mcqs.txt b/shadowwalkerz/Backend/output_txt/cleaned_mcqs.txt new file mode 100644 index 0000000..755b784 --- /dev/null +++ b/shadowwalkerz/Backend/output_txt/cleaned_mcqs.txt @@ -0,0 +1,84 @@ + MCQs based on the text + +1. Whom does Golu ask, Why dont you ever fly like other birds? +a His aunt, the ostrich +b His uncle, the giraffe +c His uncle, the hippopotamus +d His uncle, the baboon + +Answer a His aunt, the ostrich + +2. Which uncle of Golu had red eyes? +a His uncle, the giraffe +b His uncle, the baboon +c His uncle, the hippopotamus +d None of the above + +Answer c His uncle, the hippopotamus + +3. Golus relatives did not answer his questions because +a they were shy. +b the questions were too difficult. +c Golu was a naughty baby. +d they didnt know the answers. + +Answer d they didnt know the answers. + +4. Who advised Golu to go to the Limpopo river? +a His aunt, the ostrich +b His uncle, the giraffe +c The mynah bird +d The python + +Answer c The mynah bird + +5. Why did Golu go to the river? +a To find out what the crocodile had for dinner. +b To see a crocodile for the first time. +c To find out what the crocodile looked like. +d All of the above + +Answer d All of the above + +6. The crocodile lay on the bank of the Limpopo river. Golu thought it was +a a living crocodile. +b a dead crocodile. +c a log of wood. +d a rock + +Answer c a log of wood. + +7. What did the crocodile do to show that it was a real crocodile? +a It winked at Golu. +b It lifted half its tail out of the mud. +c It shed crocodile tears. +d All of the above + +Answer d All of the above + +8. Come here, little one, and Ill whisper the answer to you. The crocodile said this because +a he couldnt stand up. +b he wanted to eat Golu. +c Golu was deaf. +d he wanted to tell Golu a secret. + +Answer b he wanted to eat Golu. + +9. Who helped Golu on the bank of the river? +a The mynah bird +b The python +c The crocodile +d Golus family + +Answer b The python + +10. Name two things the elephant can do with his trunk, and two he cannot. + +Answer + + Can do + Pick up things + Blow water + Cannot do + Fly + Speak \ No newline at end of file diff --git a/shadowwalkerz/Backend/quiz.py b/shadowwalkerz/Backend/quiz.py new file mode 100644 index 0000000..5563a3d --- /dev/null +++ b/shadowwalkerz/Backend/quiz.py @@ -0,0 +1,80 @@ +import google.generativeai as genai +import PyPDF2 +import re +import sqlite3 +import os + +from quiz_game import save_answers_to_database, save_cleaned_text_to_file, save_mcqs_to_file, save_options_to_database, save_questions_to_database + +# Configure the Gemini API +genai.configure(api_key="AIzaSyAcpkdxOkgN0iPb_tgq3ZV_pFVpotx_-gA") + +generation_config = { + "temperature": 1, + "top_p": 0.95, + "top_k": 64, + "max_output_tokens": 8192, + "response_mime_type": "text/plain", +} + +model = genai.GenerativeModel( + model_name="gemini-1.5-flash", + generation_config=generation_config, +) + +def extract_text_from_pdf(pdf_path): + with open(pdf_path, "rb") as file: + reader = PyPDF2.PdfReader(file) + text = "" + for page in reader.pages: + text += page.extract_text() or "" + return text + +def generate_mcqs(text): + prompt = f"Generate only mcqs with 4 options and answer based on the following text:\n\n{text}" + response = model.generate_content(prompt) + if not response.text: + raise ValueError("No MCQs were generated. Check the input text.") + return response.text.strip() + +def clean_text(text): + cleaned_text = re.sub(r"[*]", "", text) + cleaned_text = re.sub(r"[^\w\s,.?]", "", cleaned_text) + return cleaned_text + +def delete_database_if_exists(db_path): + if os.path.exists(db_path): + os.remove(db_path) + +def process_second_pdf(filename, input_folder, output_folder): + + pdf_path = os.path.join(input_folder, filename) + db_path = os.path.join(output_folder, 'mcq_database.db') + mcqs_path = os.path.join(output_folder, 'mcqs.txt') + cleaned_txt_path = os.path.join(output_folder, 'cleaned_mcqs.txt') + + try: + delete_database_if_exists('./mcq_database.db') + + # Extract text from the PDF + extracted_text = extract_text_from_pdf(pdf_path) + if not extracted_text: + raise ValueError("No text extracted from PDF. Check the PDF file.") + + # Generate MCQs from the extracted text + mcqs = generate_mcqs(extracted_text) + save_mcqs_to_file(mcqs, mcqs_path) + + cleaned_mcqs = clean_text(mcqs) + save_cleaned_text_to_file(cleaned_mcqs, cleaned_txt_path) + + save_questions_to_database(cleaned_mcqs) + save_options_to_database(cleaned_mcqs) + save_answers_to_database(cleaned_mcqs) + + print("MCQs generated, cleaned, and saved successfully.") + + except Exception as e: + print(f"An error occurred: {str(e)}") + + diff --git a/shadowwalkerz/Backend/quiz_game.py b/shadowwalkerz/Backend/quiz_game.py new file mode 100644 index 0000000..d260ae9 --- /dev/null +++ b/shadowwalkerz/Backend/quiz_game.py @@ -0,0 +1,230 @@ +import google.generativeai as genai +import PyPDF2 +import re +import sqlite3 +import os + +genai.configure(api_key="AIzaSyAcpkdxOkgN0iPb_tgq3ZV_pFVpotx_-gA") + +generation_config = { + "temperature": 1, + "top_p": 0.95, + "top_k": 64, + "max_output_tokens": 8192, + "response_mime_type": "text/plain", +} + +model = genai.GenerativeModel( + model_name="gemini-1.5-flash", + generation_config=generation_config, +) + +def extract_text_from_pdf(pdf_path): + with open(pdf_path, "rb") as file: + reader = PyPDF2.PdfReader(file) + text = "" + for page in reader.pages: + text += page.extract_text() or "" + return text + +def generate_mcqs(text): + prompt = f"Generate only mcqs with always 4 options in alphabetical order only and answer based on the following text:\n\n{text}" + response = model.generate_content(prompt) + if not response.text: + raise ValueError("No MCQs were generated. Check the input text.") + return response.text.strip() + +def clean_text(text): + cleaned_text = re.sub(r"[*]", "", text) + cleaned_text = re.sub(r"[^\w\s,.?]", "", cleaned_text) + return cleaned_text + +def delete_database_if_exists(db_path): + if os.path.exists(db_path): + conn = sqlite3.connect(db_path) + cursor = conn.cursor() + cursor.execute('DROP TABLE IF EXISTS options') + cursor.execute('DROP TABLE IF EXISTS mcqs') + cursor.execute('DROP TABLE IF EXISTS answers') + conn.commit() + conn.close() + +def save_questions_to_database(mcqs): + conn = sqlite3.connect('mcq_database.db') + cursor = conn.cursor() + + cursor.execute('''CREATE TABLE IF NOT EXISTS mcqs ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + question TEXT + )''') + + current_question = "" + for line in mcqs.splitlines(): + line = line.strip() + if re.match(r'^\d+\.', line): + if current_question: + cursor.execute('INSERT INTO mcqs (question) VALUES (?)', (current_question,)) + current_question = line + + if current_question: + cursor.execute('INSERT INTO mcqs (question) VALUES (?)', (current_question,)) + + conn.commit() + conn.close() + +def save_options_to_database(mcqs): + conn = sqlite3.connect('mcq_database.db') + cursor = conn.cursor() + + cursor.execute('''CREATE TABLE IF NOT EXISTS options ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + question_id INTEGER, + option_text TEXT, + FOREIGN KEY (question_id) REFERENCES mcqs(id) + )''') + + current_question_id = None + options = [] + + cursor.execute('SELECT id, question FROM mcqs') + questions = cursor.fetchall() + + for line in mcqs.splitlines(): + line = line.strip() + if re.match(r'^\d+\.', line): + if current_question_id is not None and options: + for option in options: + cursor.execute('INSERT INTO options (question_id, option_text) VALUES (?, ?)', + (current_question_id, option)) + current_question = line + current_question_id = next((q[0] for q in questions if q[1] == current_question), None) + options = [] + elif re.match(r'^[a-d]\s', line): + options.append(line) + + if current_question_id is not None and options: + for option in options: + cursor.execute('INSERT INTO options (question_id, option_text) VALUES (?, ?)', + (current_question_id, option)) + + conn.commit() + conn.close() + +def save_answers_to_database(mcqs): + conn = sqlite3.connect('mcq_database.db') + cursor = conn.cursor() + + cursor.execute('''CREATE TABLE IF NOT EXISTS answers ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + question_id INTEGER, + answer TEXT, + FOREIGN KEY (question_id) REFERENCES mcqs(id) + )''') + + current_question_id = None + correct_answer = None + + cursor.execute('SELECT id, question FROM mcqs') + questions = cursor.fetchall() + + for line in mcqs.splitlines(): + line = line.strip() + if re.match(r'^\d+\.', line): + current_question = line + current_question_id = next((q[0] for q in questions if q[1] == current_question), None) + elif re.match(r'^Answer', line): + correct_answer = line + + if current_question_id is not None and correct_answer: + cursor.execute('INSERT INTO answers (question_id, answer) VALUES (?, ?)', + (current_question_id, correct_answer)) + correct_answer = None + + conn.commit() + conn.close() + +def ask_questions(): + conn = sqlite3.connect('mcq_database.db') + cursor = conn.cursor() + + cursor.execute('SELECT id, question FROM mcqs') + questions = cursor.fetchall() + score = 0 + + for question_id, question in questions: + print(question) + + cursor.execute('SELECT option_text FROM options WHERE question_id = ?', (question_id,)) + options = cursor.fetchall() + + for option in options: + print(option[0]) + + answer = input("Your answer (a/b/c/d): ").strip().lower() + + cursor.execute('SELECT answer FROM answers WHERE question_id = ?', (question_id,)) + correct_answer = cursor.fetchone()[0] + + if answer == correct_answer[0].lower(): + score += 1 + + print(f"Your score: {score}/{len(questions)}") + conn.close() + + return score + +def save_score_to_database(score): + conn = sqlite3.connect('mcq_database.db') + cursor = conn.cursor() + + cursor.execute('''CREATE TABLE IF NOT EXISTS scores ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + score INTEGER + )''') + + cursor.execute('INSERT INTO scores (score) VALUES (?)', (score,)) + + conn.commit() + conn.close() + +def save_mcqs_to_file(mcqs, mcqs_path): + with open(mcqs_path, 'w', encoding='utf-8') as f: + f.write(mcqs) + +def save_cleaned_text_to_file(cleaned_text, cleaned_txt_path): + with open(cleaned_txt_path, 'w', encoding='utf-8') as f: + f.write(cleaned_text) + +# pdf_path = r"D:\Projects ALL\AI Based\P-Dio\PRECEPTION\input_pdfs\geah101.pdf" +db_path = 'mcq_database.db' +mcqs_path = './mcqs.txt' +cleaned_txt_path = './cleaned_mcqs.txt' + +try: + delete_database_if_exists(db_path) + + # extracted_text = extract_text_from_pdf(pdf_path) + # if not extracted_text: + # raise ValueError("No text extracted from PDF. Check the PDF file.") + + # mcqs = generate_mcqs(extracted_text) + + # save_mcqs_to_file(mcqs, mcqs_path) + + # cleaned_mcqs = clean_text(mcqs) + # save_cleaned_text_to_file(cleaned_mcqs, cleaned_txt_path) + + # save_questions_to_database(cleaned_mcqs) + + # save_options_to_database(cleaned_mcqs) + + # save_answers_to_database(cleaned_mcqs) + + # print("MCQs generated, cleaned, and saved to the databases and files successfully.") + + # score = ask_questions() + + # save_score_to_database(score) + +except Exception as e: + print(f"An error occurred: {str(e)}") diff --git a/shadowwalkerz/Backend/requirements.txt b/shadowwalkerz/Backend/requirements.txt new file mode 100644 index 0000000..3db13df --- /dev/null +++ b/shadowwalkerz/Backend/requirements.txt @@ -0,0 +1,12 @@ +streamlit +langchain_google_genai +langchain +PyPDF2 +werkzeug +sqlite3 +flask_cors +re +pdfminer +pydub +gtts +moviepy diff --git a/shadowwalkerz/Backend/sample pdf/geah103.pdf b/shadowwalkerz/Backend/sample pdf/geah103.pdf new file mode 100644 index 0000000..c2622e2 Binary files /dev/null and b/shadowwalkerz/Backend/sample pdf/geah103.pdf differ diff --git a/shadowwalkerz/Backend/talking.py b/shadowwalkerz/Backend/talking.py new file mode 100644 index 0000000..b3fd3ab --- /dev/null +++ b/shadowwalkerz/Backend/talking.py @@ -0,0 +1,54 @@ +import PyPDF2 +import google.generativeai as genai + +# Configure the Gemini API +genai.configure(api_key="AIzaSyAcpkdxOkgN0iPb_tgq3ZV_pFVpotx_-gA") + +generation_config = { + "temperature": 1, + "top_p": 0.95, + "top_k": 64, + "max_output_tokens": 8192, + "response_mime_type": "text/plain", +} + +model = genai.GenerativeModel( + model_name="gemini-1.5-flash", + generation_config=generation_config, +) + +# Function to extract text from the PDF +def extract_text_from_pdf(pdf_path): + with open(pdf_path, "rb") as file: + reader = PyPDF2.PdfReader(file) + text = "" + for page in reader.pages: + text += page.extract_text() + return text + +pdf_path = r"D:\Projects ALL\Practice Apps models\preception\Backend\input_pdfs\geah102.pdf" + +# Extract text +pdf_text = extract_text_from_pdf(pdf_path) + +def ask_question(question): + prompt = ( + f"{question}\n\n" + f"Please answer in a concise manner using the following text:\n" + f"{pdf_text}\n\n" + "Provide your answer in 1-2 lines." + ) + + response = model.generate_content(prompt) + + + answer_text = response.text if hasattr(response, 'text') else str(response) + + if "I don't know" in answer_text or "not found" in answer_text: + return "I don't know." + + return answer_text.strip() +# Example usage +question = "what meteoroid?" +answer = ask_question(question) +print(answer) diff --git a/shadowwalkerz/Backend/video.py b/shadowwalkerz/Backend/video.py new file mode 100644 index 0000000..1955ce8 --- /dev/null +++ b/shadowwalkerz/Backend/video.py @@ -0,0 +1,280 @@ +import os +import re +import PyPDF2 +import google.generativeai as genai +from moviepy.editor import ImageClip, VideoFileClip, concatenate_videoclips,AudioFileClip +from concurrent.futures import ThreadPoolExecutor +from moviepy.video.fx.all import speedx +from moviepy.video.fx.all import fadein, fadeout + +# Configure the Gemini API +genai.configure(api_key="AIzaSyAcpkdxOkgN0iPb_tgq3ZV_pFVpotx_-gA") + +generation_config = { + "temperature": 1, + "top_p": 0.95, + "top_k": 64, + "max_output_tokens": 8192, + "response_mime_type": "text/plain", +} + +model = genai.GenerativeModel( + model_name="gemini-1.5-flash", + generation_config=generation_config, +) + +# Function to clean text (remove special characters, extra spaces, etc.) +def clean_text(text): + cleaned_text = re.sub(r'[#*]', '', text) + cleaned_text = ' '.join(cleaned_text.split()) + return cleaned_text + +# Function to extract keywords from image filenames +def extract_keywords_from_images(image_folder): + keywords = set() # Use a set to avoid duplicate keywords + try: + # Iterate through all files in the image folder + for file_name in os.listdir(image_folder): + if file_name.endswith(('.jpg', '.jpeg', '.png', '.webp', '.gif')): + # Remove the file extension and split by underscore + name_without_extension = os.path.splitext(file_name)[0] + keyword_parts = name_without_extension.split('_') + # Add each part as a keyword + keywords.update(keyword_parts) + except Exception as e: + print(f"Error reading files from {image_folder}: {e}") + + return list(keywords) + +# Function to extract keywords using Gemini AI +def extract_keywords_gemini(text, top_n=8): + try: + prompt = f"{text} Extract the top {top_n} simple and most common keywords without any symbols, descriptions,reactions(like HAA HAA,W W) and also arrange in manner of story " + + # Use Gemini AI to process the request + response = model.generate_content(prompt) + + keywords = response.text.splitlines() + + return keywords[:top_n] + except Exception as e: + print(f"Error extracting keywords with Gemini: {e}") + return [] + +# Function to read a text file and return its content +def read_text_file(file_path): + try: + with open(file_path, 'r', encoding='utf-8') as file: + return file.read() + except Exception as e: + print(f"Error reading file {file_path}: {e}") + return "" + + +# Function to save the combined extracted keywords to a new file +def save_combined_keywords_to_file(keywords, output_folder, base_filename): + try: + # Define the path where the keywords will be saved + keywords_output_path = os.path.join(output_folder, f"{base_filename}_combined_keywords.txt") + # Write the keywords to the file + with open(keywords_output_path, 'w', encoding='utf-8') as file: + file.write('\n'.join(keywords)) + print(f"Combined keywords saved to {keywords_output_path}") + except Exception as e: + print(f"Error saving combined keywords: {e}") + + +#effects +def apply_pan_effect(clip, pan_duration, direction="right", pan_speed=15): + width, height = clip.size + + def pan_frame(get_frame, t): + frame = get_frame(t) + x_move = int(pan_speed * t) + if direction == "right": + return frame[:, x_move:min(width, x_move + width), :] + elif direction == "left": + return frame[:, max(0, width - x_move):width, :] + return frame + + return clip.fl(pan_frame).set_duration(pan_duration) + + +def generate_video_from_keywords(keywords, image_folder, output_folder, video_number, used_images, target_size=(1280, 720)): + clips = [] + used_keywords = set() + normalized_keywords = [kw.lower() for kw in keywords] + + for keyword in normalized_keywords: + # Construct the image filename base (no extension) + image_base_name = f"{keyword}" + image_found = False + + # Check for all image formats + for ext in ['.jpg', '.jpeg', '.png', '.webp', '.gif']: + image_filename = f"{image_base_name}{ext}" + image_path = os.path.join(image_folder, image_filename) + + # Check if the image exists and has not been used + if os.path.exists(image_path) and image_path not in used_images: + if ext == '.gif': + gif_clip = VideoFileClip(image_path) + + slow_gif_clip = speedx(gif_clip, factor=0.5) + + clip = slow_gif_clip.resize(target_size).subclip(0, min(5, slow_gif_clip.duration)) + + + # duration = gif_clip.duration # Get the GIF's total duration + + # # If the GIF is longer than 5 seconds, play the full duration + # clip = gif_clip.resize(target_size) + # # if duration > 2 else gif_clip.subclip(0, 5).resize(target_size) + + else: + # Use ImageClip for static images + clip = ImageClip(image_path).set_duration(8).resize(target_size) + clip = clip.resize(lambda t: 1 + 0.1 * t) # Zoom in over time + clip = apply_pan_effect(clip, pan_duration=8, direction="right") + clip = fadeout(clip, 1) + clips.append(clip) + used_keywords.add(keyword) + used_images.add(image_path) + image_found = True + break + if not image_found: + print(f"Image not found for keyword: {keyword}") + + # Concatenate the video clips + if clips: + video = concatenate_videoclips(clips[:3], method="compose") + video_output_path = os.path.join(output_folder, f"story_video_{video_number}.mp4") + video.write_videofile(video_output_path, fps=24) + print(f"Video {video_number} saved to {video_output_path}") + return video_output_path + else: + print(f"No clips to create video {video_number}.") + return None + +#merge audio file +def merge_videos_with_audio(video_paths, output_folder, audio_folder): + try: + # Merge video clips + video_clips = [VideoFileClip(path) for path in video_paths] + final_video = concatenate_videoclips(video_clips) + final_output_path = os.path.join(output_folder, "final_merged_video.mp4") + + # Find the audio file with 'full_audio.mp3' suffix + audio_file = None + for file_name in os.listdir(audio_folder): + if file_name.endswith("full_audio.mp3"): + audio_file = os.path.join(audio_folder, file_name) + break + + if audio_file: + # Load audio and set it to the video + final_audio = AudioFileClip(audio_file) + final_video = final_video.set_audio(final_audio) + + # Write the final video with audio, explicitly setting FPS + final_video.write_videofile(final_output_path, fps=24, codec='libx264') + print(f"Final merged video with audio saved to {final_output_path}") + except Exception as e: + print(f"Error merging videos with audio: {e}") + +# Function to process text files and images for keyword extraction +def process_files_for_keywords(text_folder, image_folder, output_folder): + combined_keywords = set() # Use a set to avoid duplicates + used_images = set() # Track used images across all videos + + # Process text files for keywords + for text_file in os.listdir(text_folder): + if text_file.endswith(".txt"): + text_file_path = os.path.join(text_folder, text_file) + raw_text = read_text_file(text_file_path) + if raw_text: + cleaned_text = clean_text(raw_text) + keywords_from_text = extract_keywords_gemini(cleaned_text, top_n=10) + combined_keywords.update(keywords_from_text) + + # Extract keywords from image filenames + keywords_from_images = extract_keywords_from_images(image_folder) + combined_keywords.update(keywords_from_images) + + # Save the combined keywords to a new file + save_combined_keywords_to_file(list(combined_keywords), output_folder, 'all') + + # Split keywords into groups for 30-second videos + keywords_list = list(combined_keywords) + keyword_groups = [keywords_list[i:i + 6] for i in range(0, len(keywords_list), 6)] + + video_paths = [] + + # Generate videos in parallel + with ThreadPoolExecutor() as executor: + futures = [] + for i, keyword_group in enumerate(keyword_groups): + futures.append(executor.submit(generate_video_from_keywords, keyword_group, image_folder, output_folder, i + 1, used_images)) + + # Wait for all futures to complete and collect video paths + for future in futures: + video_path = future.result() + if video_path: + video_paths.append(video_path) + + # Merge all videos into one final video + if video_paths: + merge_videos_with_audio(video_paths, output_folder,text_folder) + else: + print("No videos were generated to merge.") + +# Function to merge multiple videos into one +# def merge_videos(video_paths, output_folder): +# try: +# video_clips = [VideoFileClip(path) for path in video_paths] +# final_video = concatenate_videoclips(video_clips) +# final_output_path = os.path.join(output_folder, "final_merged_video.mp4") +# final_video.write_videofile(final_output_path, fps=24) +# print(f"Final merged video saved to {final_output_path}") +# except Exception as e: +# print(f"Error merging videos: {e}") + +# Function to process a single PDF and extract text +def process_third_pdf(pdf_path, output_folder): + # Extract text from the PDF using PyPDF2 + with open(pdf_path, 'rb') as pdf_file: + pdf_reader = PyPDF2.PdfFileReader(pdf_file) + text = "" + for page_num in range(pdf_reader.numPages): + page = pdf_reader.getPage(page_num) + text += page.extractText() + + # Clean the text (using the clean_text function) + cleaned_text = clean_text(text) + + # Extract keywords using Gemini AI + keywords = extract_keywords_gemini(cleaned_text) + + # Use these keywords to generate video clips (existing function) + used_images = set() # Track used images + video_paths = [] + + # Generate video using keywords + video_paths = generate_video_from_keywords(keywords, image_folder="./dataset/english", output_folder=output_folder, video_number=1, used_images=used_images) + + return video_paths # Return video paths for further use + + +# Example usage +# if __name__ == "__main__": + # Folder with input paragraph text files + # text_folder = "D:\\Projects ALL\\AI Based\\P-Dio\\PRECEPTION\\output_txt" + # # Folder with images + # image_folder = "D:\\Projects ALL\\AI Based\\P-Dio\\PRECEPTION\\dataset\\english" + # # Folder where the keywords and videos will be saved + # output_folder = "D:\\Projects ALL\\AI Based\\P-Dio\\PRECEPTION\\Keywords" + + # # Process text files and images to generate combined keywords and videos + # process_files_for_keywords(text_folder, image_folder, output_folder) + + # print("Keyword extraction, video generation, and merging complete.") \ No newline at end of file diff --git a/shadowwalkerz/README.md b/shadowwalkerz/README.md new file mode 100644 index 0000000..3df3b1b --- /dev/null +++ b/shadowwalkerz/README.md @@ -0,0 +1,82 @@ +## Team Name : Shadow Walkerz +# Project : Perception +## 🌟 What is PERCEPTION? + +*PERCEPTION* is a revolutionary tool that leverages *Generative AI* to convert static text-based content (from books, PDFs, and more) into *context-aware, dynamic videos*. By providing fresh visual perspectives with each video generation, it transforms the way we learn, making it more engaging, enjoyable, and effective for all types of learners. + +With PERCEPTION, you can say goodbye to monotonous reading and embrace a multi-sensory learning experience. πŸŽ¬πŸ“š + + +*How can we enhance engagement and retention in traditional text-based learning?* + +Many learners struggle with staying motivated while reading dense, text-heavy materials. PERCEPTION addresses this by transforming static paragraphs into immersive videos, catering to different learning styles and improving retention. + +## Backend Setup +- In Backend Folder You need to download the dataset of images Collection +- Backend -> dataset -> english set in this format +- link dataset - https://drive.proton.me/urls/EYC8KE7S84#FmDZysBlWdi5 +- AFTER + +# Installation Backend +-- "pip install -r requirements.txt" +- if any error occur related to community and command error text file available in folder + +# Run Background Command +- "python app.py" + +![image](https://github.com/user-attachments/assets/16668054-41e1-4200-9cc5-b5e324a56642) + + +## install the app +# First its neccessary proper to set up flutter + +- download flutter and set up +# commands +-- "flutter clean" + +-- "flutter pub get" + + +# api setup +- In constant.dart file : "http://.... app.py paste" + +# Run the app +-- "flutter run" command + +# Build the apk File +- firstly project name change to "preception" because during building apk its finds the proper path +# commands + +-- "flutter build apk" +--- + +## πŸ’» How It Works + +1. *Text Input*: Users can input text from any source (books, PDFs, articles). +2. *Context Analysis*: The text is analyzed using NLP to understand its context, tone, and key themes. +3. *Video Generation*: Using MoviePy, relevant visuals and animations are generated to reflect the text’s meaning. +4. *Text-to-Speech*: The text is narrated using gTTS/pyttsx3, providing an immersive audio experience. +5. *Final Output*: The generated video, complete with visuals and narration, is delivered to the user. + +--- + +## πŸš€ Key Features +- *AI-Powered Video Generation*: Converts text into dynamic, visually engaging videos. +- *Text-to-Speech Narration*: Provides audio narration synchronized with visual content for an immersive learning experience. +- *Multi-Sensory Engagement*: Engages learners through visual, auditory, and contextual formats. +- *Supports Diverse Learning Styles*: Tailored content for visual, auditory, and kinesthetic learners. +- *Fresh Perspectives*: Each video generation offers a new interpretation of the content, keeping learning fresh and exciting. + +--- + +## πŸ”§ Technologies Used +- *Python*: Backend processing and logic +- *Flask*: Lightweight framework for web deployment +- *MoviePy*: Video generation and editing +- *gTTS* & *pyttsx3*: Text-to-speech libraries +- *Natural Language Processing (NLP)*: For contextual analysis of text + +--- + + + diff --git a/shadowwalkerz/analysis_options.yaml b/shadowwalkerz/analysis_options.yaml new file mode 100644 index 0000000..d4e0f0c --- /dev/null +++ b/shadowwalkerz/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/shadowwalkerz/android/app/build.gradle b/shadowwalkerz/android/app/build.gradle new file mode 100644 index 0000000..e41e487 --- /dev/null +++ b/shadowwalkerz/android/app/build.gradle @@ -0,0 +1,58 @@ +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file("local.properties") +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader("UTF-8") { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty("flutter.versionCode") +if (flutterVersionCode == null) { + flutterVersionCode = "1" +} + +def flutterVersionName = localProperties.getProperty("flutter.versionName") +if (flutterVersionName == null) { + flutterVersionName = "1.0" +} + +android { + namespace = "com.example.preception" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.preception" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.debug + } + } +} + +flutter { + source = "../.." +} diff --git a/shadowwalkerz/android/app/src/debug/AndroidManifest.xml b/shadowwalkerz/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..8ffe024 --- /dev/null +++ b/shadowwalkerz/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/shadowwalkerz/android/app/src/main/AndroidManifest.xml b/shadowwalkerz/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e91244b --- /dev/null +++ b/shadowwalkerz/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/shadowwalkerz/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 0000000..b5c355c --- /dev/null +++ b/shadowwalkerz/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,54 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new xyz.luan.audioplayers.AudioplayersPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin audioplayers_android, xyz.luan.audioplayers.AudioplayersPlugin", e); + } + try { + flutterEngine.getPlugins().add(new com.mr.flutter.plugin.filepicker.FilePickerPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin file_picker, com.mr.flutter.plugin.filepicker.FilePickerPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin flutter_plugin_android_lifecycle, io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.github.ponnamkarthik.toast.fluttertoast.FlutterToastPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin fluttertoast, io.github.ponnamkarthik.toast.fluttertoast.FlutterToastPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.imagepicker.ImagePickerPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin image_picker_android, io.flutter.plugins.imagepicker.ImagePickerPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.videoplayer.VideoPlayerPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin video_player_android, io.flutter.plugins.videoplayer.VideoPlayerPlugin", e); + } + } +} diff --git a/shadowwalkerz/android/app/src/main/kotlin/com/example/preception/MainActivity.kt b/shadowwalkerz/android/app/src/main/kotlin/com/example/preception/MainActivity.kt new file mode 100644 index 0000000..e74e35b --- /dev/null +++ b/shadowwalkerz/android/app/src/main/kotlin/com/example/preception/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.preception + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/shadowwalkerz/android/app/src/main/res/drawable-v21/launch_background.xml b/shadowwalkerz/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..1cb7aa2 --- /dev/null +++ b/shadowwalkerz/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/shadowwalkerz/android/app/src/main/res/drawable/launch_background.xml b/shadowwalkerz/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..8403758 --- /dev/null +++ b/shadowwalkerz/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/shadowwalkerz/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/shadowwalkerz/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..55aebf9 --- /dev/null +++ b/shadowwalkerz/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,3 @@ + + + diff --git a/shadowwalkerz/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/shadowwalkerz/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..24e7c8a Binary files /dev/null and b/shadowwalkerz/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/shadowwalkerz/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/shadowwalkerz/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..fd4351f Binary files /dev/null and b/shadowwalkerz/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/shadowwalkerz/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/shadowwalkerz/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..bd790cb Binary files /dev/null and b/shadowwalkerz/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/shadowwalkerz/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/shadowwalkerz/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..808e619 Binary files /dev/null and b/shadowwalkerz/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/shadowwalkerz/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/shadowwalkerz/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..cd81652 Binary files /dev/null and b/shadowwalkerz/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/shadowwalkerz/android/app/src/main/res/values-night/styles.xml b/shadowwalkerz/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..360a160 --- /dev/null +++ b/shadowwalkerz/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/shadowwalkerz/android/app/src/main/res/values/styles.xml b/shadowwalkerz/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..5fac679 --- /dev/null +++ b/shadowwalkerz/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/shadowwalkerz/android/app/src/profile/AndroidManifest.xml b/shadowwalkerz/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..8ffe024 --- /dev/null +++ b/shadowwalkerz/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/shadowwalkerz/android/build.gradle b/shadowwalkerz/android/build.gradle new file mode 100644 index 0000000..0066644 --- /dev/null +++ b/shadowwalkerz/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = "../build" +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/shadowwalkerz/android/gradle.properties b/shadowwalkerz/android/gradle.properties new file mode 100644 index 0000000..0d7fbd5 --- /dev/null +++ b/shadowwalkerz/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +android.enableJetifier=true diff --git a/shadowwalkerz/android/gradle/wrapper/gradle-wrapper.jar b/shadowwalkerz/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..13372ae Binary files /dev/null and b/shadowwalkerz/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/shadowwalkerz/android/gradle/wrapper/gradle-wrapper.properties b/shadowwalkerz/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..8854897 --- /dev/null +++ b/shadowwalkerz/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/shadowwalkerz/android/gradlew b/shadowwalkerz/android/gradlew new file mode 100644 index 0000000..9d82f78 --- /dev/null +++ b/shadowwalkerz/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/shadowwalkerz/android/gradlew.bat b/shadowwalkerz/android/gradlew.bat new file mode 100644 index 0000000..aec9973 --- /dev/null +++ b/shadowwalkerz/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/shadowwalkerz/android/local.properties b/shadowwalkerz/android/local.properties new file mode 100644 index 0000000..d9a950a --- /dev/null +++ b/shadowwalkerz/android/local.properties @@ -0,0 +1,5 @@ +sdk.dir=C:\\Users\\VP\\AppData\\Local\\Android\\sdk +flutter.sdk=D:\\software\\flutter_windows_3.7.12-stable\\flutter +flutter.buildMode=release +flutter.versionName=1.0.0 +flutter.versionCode=1 \ No newline at end of file diff --git a/shadowwalkerz/android/preception_android.iml b/shadowwalkerz/android/preception_android.iml new file mode 100644 index 0000000..5e74ee6 --- /dev/null +++ b/shadowwalkerz/android/preception_android.iml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/android/settings.gradle b/shadowwalkerz/android/settings.gradle new file mode 100644 index 0000000..0f10e04 --- /dev/null +++ b/shadowwalkerz/android/settings.gradle @@ -0,0 +1,25 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app" diff --git a/shadowwalkerz/assets/logo.jpeg b/shadowwalkerz/assets/logo.jpeg new file mode 100644 index 0000000..310192a Binary files /dev/null and b/shadowwalkerz/assets/logo.jpeg differ diff --git a/shadowwalkerz/flutter_01.png b/shadowwalkerz/flutter_01.png new file mode 100644 index 0000000..27d1c8e Binary files /dev/null and b/shadowwalkerz/flutter_01.png differ diff --git a/shadowwalkerz/hello.txt b/shadowwalkerz/hello.txt new file mode 100644 index 0000000..e69de29 diff --git a/shadowwalkerz/ios/Flutter/AppFrameworkInfo.plist b/shadowwalkerz/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..e041d38 --- /dev/null +++ b/shadowwalkerz/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/shadowwalkerz/ios/Flutter/Debug.xcconfig b/shadowwalkerz/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..0b2d479 --- /dev/null +++ b/shadowwalkerz/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/shadowwalkerz/ios/Flutter/Release.xcconfig b/shadowwalkerz/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..0b2d479 --- /dev/null +++ b/shadowwalkerz/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/shadowwalkerz/ios/Runner.xcodeproj/project.pbxproj b/shadowwalkerz/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2c24f62 --- /dev/null +++ b/shadowwalkerz/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,616 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c4b79bd --- /dev/null +++ b/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..af0309c --- /dev/null +++ b/shadowwalkerz/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/shadowwalkerz/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/shadowwalkerz/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..2324e91 --- /dev/null +++ b/shadowwalkerz/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/ios/Runner.xcworkspace/contents.xcworkspacedata b/shadowwalkerz/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..59c6d39 --- /dev/null +++ b/shadowwalkerz/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/shadowwalkerz/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/shadowwalkerz/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/shadowwalkerz/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/shadowwalkerz/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/shadowwalkerz/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..af0309c --- /dev/null +++ b/shadowwalkerz/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/shadowwalkerz/ios/Runner/AppDelegate.swift b/shadowwalkerz/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..0bf9c3e --- /dev/null +++ b/shadowwalkerz/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d0d98aa --- /dev/null +++ b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1 @@ +{"images":[{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@3x.png","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@3x.png","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@3x.png","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@1x.png","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@3x.png","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@1x.png","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@1x.png","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@1x.png","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@2x.png","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@1x.png","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@2x.png","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@1x.png","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@2x.png","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"Icon-App-83.5x83.5@2x.png","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"Icon-App-1024x1024@1x.png","scale":"1x"}],"info":{"version":1,"author":"xcode"}} \ No newline at end of file diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..3769968 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..dd827a1 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..40a20f6 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..de66e03 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..f2adbc4 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..40d9eec Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..a3df1e1 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..40a20f6 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..fb4d1e8 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..ec02531 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png new file mode 100644 index 0000000..8ca90f9 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png new file mode 100644 index 0000000..25cfafd Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png new file mode 100644 index 0000000..07c7fa9 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png new file mode 100644 index 0000000..f47643a Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..ec02531 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..245548a Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png new file mode 100644 index 0000000..24e7c8a Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png new file mode 100644 index 0000000..808e619 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..462db45 Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..c1f193d Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..ff215ec Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..d08a4de --- /dev/null +++ b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..65a94b5 --- /dev/null +++ b/shadowwalkerz/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -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. \ No newline at end of file diff --git a/shadowwalkerz/ios/Runner/Base.lproj/LaunchScreen.storyboard b/shadowwalkerz/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..497371e --- /dev/null +++ b/shadowwalkerz/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/ios/Runner/Base.lproj/Main.storyboard b/shadowwalkerz/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bbb83ca --- /dev/null +++ b/shadowwalkerz/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/ios/Runner/GeneratedPluginRegistrant.h b/shadowwalkerz/ios/Runner/GeneratedPluginRegistrant.h new file mode 100644 index 0000000..7a89092 --- /dev/null +++ b/shadowwalkerz/ios/Runner/GeneratedPluginRegistrant.h @@ -0,0 +1,19 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GeneratedPluginRegistrant_h +#define GeneratedPluginRegistrant_h + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface GeneratedPluginRegistrant : NSObject ++ (void)registerWithRegistry:(NSObject*)registry; +@end + +NS_ASSUME_NONNULL_END +#endif /* GeneratedPluginRegistrant_h */ diff --git a/shadowwalkerz/ios/Runner/GeneratedPluginRegistrant.m b/shadowwalkerz/ios/Runner/GeneratedPluginRegistrant.m new file mode 100644 index 0000000..50ab1e0 --- /dev/null +++ b/shadowwalkerz/ios/Runner/GeneratedPluginRegistrant.m @@ -0,0 +1,56 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#import "GeneratedPluginRegistrant.h" + +#if __has_include() +#import +#else +@import audioplayers_darwin; +#endif + +#if __has_include() +#import +#else +@import file_picker; +#endif + +#if __has_include() +#import +#else +@import fluttertoast; +#endif + +#if __has_include() +#import +#else +@import image_picker_ios; +#endif + +#if __has_include() +#import +#else +@import path_provider_foundation; +#endif + +#if __has_include() +#import +#else +@import video_player_avfoundation; +#endif + +@implementation GeneratedPluginRegistrant + ++ (void)registerWithRegistry:(NSObject*)registry { + [AudioplayersDarwinPlugin registerWithRegistrar:[registry registrarForPlugin:@"AudioplayersDarwinPlugin"]]; + [FilePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FilePickerPlugin"]]; + [FluttertoastPlugin registerWithRegistrar:[registry registrarForPlugin:@"FluttertoastPlugin"]]; + [FLTImagePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTImagePickerPlugin"]]; + [PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]]; + [FVPVideoPlayerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FVPVideoPlayerPlugin"]]; +} + +@end diff --git a/shadowwalkerz/ios/Runner/Info.plist b/shadowwalkerz/ios/Runner/Info.plist new file mode 100644 index 0000000..93dd7c6 --- /dev/null +++ b/shadowwalkerz/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Perception + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + preception + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/shadowwalkerz/ios/Runner/Runner-Bridging-Header.h b/shadowwalkerz/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..fae207f --- /dev/null +++ b/shadowwalkerz/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/shadowwalkerz/ios/RunnerTests/RunnerTests.swift b/shadowwalkerz/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..4d206de --- /dev/null +++ b/shadowwalkerz/ios/RunnerTests/RunnerTests.swift @@ -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. + } + +} diff --git a/shadowwalkerz/lib/chat_screen.dart b/shadowwalkerz/lib/chat_screen.dart new file mode 100644 index 0000000..258f310 --- /dev/null +++ b/shadowwalkerz/lib/chat_screen.dart @@ -0,0 +1,82 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:preception/constants.dart'; + +class ChatScreen extends StatefulWidget { + @override + _ChatScreenState createState() => _ChatScreenState(); +} + +class _ChatScreenState extends State { + final TextEditingController _controller = TextEditingController(); + List> messages = []; + + Future _sendMessage(String message) async { + final url = Uri.parse('${baseUrl}/ask'); // Change to your backend URL + final response = await http.post( + url, + headers: {"Content-Type": "application/json"}, + body: jsonEncode({ + 'question': message, + 'pdf_filename': 'geah103.pdf', // Hardcoded PDF filename + }), + ); + + if (response.statusCode == 200) { + final data = jsonDecode(response.body); + setState(() { + messages.add({'user': message, 'bot': data['answer']}); + }); + } else { + setState(() { + messages.add({'user': message, 'bot': 'Error fetching response.'}); + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('AI Chat')), + body: Column( + children: [ + Expanded( + child: ListView.builder( + itemCount: messages.length, + itemBuilder: (context, index) { + return ListTile( + title: Text('You: ${messages[index]['user']}'), + subtitle: Text('AI: ${messages[index]['bot']}'), + ); + }, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Expanded( + child: TextField( + controller: _controller, + decoration: InputDecoration(hintText: 'Ask a question...'), + ), + ), + IconButton( + icon: Icon(Icons.send), + onPressed: () { + final message = _controller.text; + _controller.clear(); + if (message.isNotEmpty) { + _sendMessage(message); // Only sending the message + } + }, + ) + ], + ), + ), + ], + ), + ); + } +} diff --git a/shadowwalkerz/lib/constants.dart b/shadowwalkerz/lib/constants.dart new file mode 100644 index 0000000..0475373 --- /dev/null +++ b/shadowwalkerz/lib/constants.dart @@ -0,0 +1,3 @@ +String baseUrl='http://192.168.137.202:5000'; +// String baseUrl=' http://192.168.1.133:5000'; +// String baseUrl='http://192.168.42.136:5000'; \ No newline at end of file diff --git a/shadowwalkerz/lib/file_screen.dart b/shadowwalkerz/lib/file_screen.dart new file mode 100644 index 0000000..21bfa58 --- /dev/null +++ b/shadowwalkerz/lib/file_screen.dart @@ -0,0 +1,248 @@ +import 'dart:async'; // To use Timer +import 'dart:io'; +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:path_provider/path_provider.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:audioplayers/audioplayers.dart'; +import 'package:preception/constants.dart'; + +class FileCheckScreen extends StatefulWidget { + @override + _FileCheckScreenState createState() => _FileCheckScreenState(); +} + +class _FileCheckScreenState extends State { + bool isLoading = true; + bool filesExist = false; + String file1Path = ""; + String file2Path = ""; + String fileText = ""; + late AudioPlayer audioPlayer; + bool isPlaying = false; + Duration currentPosition = Duration.zero; + Duration totalDuration = Duration.zero; + Timer? checkFilesTimer; // Timer for sending requests every 5 seconds + + @override + void initState() { + super.initState(); + audioPlayer = AudioPlayer(); + + audioPlayer.onDurationChanged.listen((Duration d) { + setState(() { + totalDuration = d; + }); + }); + + audioPlayer.onPositionChanged.listen((Duration p) { + setState(() { + currentPosition = p; + }); + }); + + audioPlayer.onPlayerComplete.listen((event) { + setState(() { + isPlaying = false; + currentPosition = Duration.zero; + }); + }); + + // Start checking for files every 5 seconds + startFileCheck(); + } + + @override + void dispose() { + // Cancel the timer if the widget is disposed + checkFilesTimer?.cancel(); + super.dispose(); + } + + // Function to check for files every 5 seconds + void startFileCheck() { + checkFiles(); // Initial check + checkFilesTimer = Timer.periodic(Duration(seconds: 5), (timer) { + checkFiles(); // Re-check files every 5 seconds + }); + } + + // Function to check if files exist + Future checkFiles() async { + try { + final response = await http.get(Uri.parse('${baseUrl}/check-files')); + + if (response.statusCode == 200) { + final jsonResponse = jsonDecode(response.body); + + if (jsonResponse['files_exist'] == true) { + setState(() { + filesExist = true; + }); + + // Stop the periodic check if files are found + checkFilesTimer?.cancel(); + + // Download the files + await downloadFiles(jsonResponse['file1'], jsonResponse['file2']); + } else { + setState(() { + filesExist = false; + }); + } + } else { + Fluttertoast.showToast(msg: 'Failed to check files'); + } + } catch (e) { + Fluttertoast.showToast(msg: 'Error: $e'); + } + } + + // Function to download files + Future downloadFiles(String file1, String file2) async { + final url1 = '${baseUrl}/download/${file1}'; + final url2 = '${baseUrl}/download/${file2}'; + + final directory = await getApplicationDocumentsDirectory(); + + // Download text file + final response1 = await http.get(Uri.parse(url1)); + if (response1.statusCode == 200) { + final localFile1 = File('${directory.path}/$file1'); + await localFile1.writeAsBytes(response1.bodyBytes); + setState(() { + file1Path = localFile1.path; + }); + await readTextFile(file1Path); + } else { + Fluttertoast.showToast(msg: 'Failed to download text file'); + } + + // Download audio file + final response2 = await http.get(Uri.parse(url2)); + if (response2.statusCode == 200) { + final localFile2 = File('${directory.path}/$file2'); + await localFile2.writeAsBytes(response2.bodyBytes); + setState(() { + file2Path = localFile2.path; + }); + } else { + Fluttertoast.showToast(msg: 'Failed to download audio file'); + } + + // Stop showing loading after file download + setState(() { + isLoading = false; + }); + } + + // Function to read text file + Future readTextFile(String path) async { + try { + final file = File(path); + String content = await file.readAsString(); + setState(() { + fileText = content; + }); + } catch (e) { + Fluttertoast.showToast(msg: 'Failed to read text file'); + } + } + + // Function to play/pause the audio file + void togglePlayPause() async { + if (file2Path.isNotEmpty) { + if (isPlaying) { + await audioPlayer.pause(); + } else { + await audioPlayer.play(DeviceFileSource(file2Path)); + } + setState(() { + isPlaying = !isPlaying; + }); + } else { + Fluttertoast.showToast(msg: 'Audio file not available'); + } + } + + // Function to stop the audio + void stopAudio() async { + await audioPlayer.stop(); + setState(() { + isPlaying = false; + currentPosition = Duration.zero; + }); + } + + String formatDuration(Duration d) { + String twoDigits(int n) => n.toString().padLeft(2, "0"); + return "${twoDigits(d.inMinutes)}:${twoDigits(d.inSeconds.remainder(60))}"; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('Checking Files')), + body: Center( + child: isLoading + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircularProgressIndicator(), + SizedBox(height: 20), + Text('Checking for files... Please wait.'), // Show loading text + ], + ) + : filesExist + ? SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('Files are available!'), + SizedBox(height: 20), + Column( + children: [ + Text('${formatDuration(currentPosition)} / ${formatDuration(totalDuration)}'), + Slider( + value: currentPosition.inSeconds.toDouble(), + max: totalDuration.inSeconds.toDouble(), + onChanged: (value) async { + final newPosition = Duration(seconds: value.toInt()); + await audioPlayer.seek(newPosition); + setState(() { + currentPosition = newPosition; + }); + }, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + icon: Icon(isPlaying ? Icons.pause : Icons.play_arrow), + onPressed: togglePlayPause, + iconSize: 20, + ), + IconButton( + icon: Icon(Icons.stop), + onPressed: stopAudio, + iconSize: 20, + ), + ], + ), + SizedBox(height: 20), + if (fileText.isNotEmpty) + Padding( + padding: const EdgeInsets.all(8.0), + child: Text(fileText), // Display text content + ), + ], + ), + ], + ), + ) + : Text('Files are not available!'), + ), + ); + } +} diff --git a/shadowwalkerz/lib/home_screen.dart b/shadowwalkerz/lib/home_screen.dart new file mode 100644 index 0000000..53b442a --- /dev/null +++ b/shadowwalkerz/lib/home_screen.dart @@ -0,0 +1,223 @@ +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:file_picker/file_picker.dart'; +import 'package:path/path.dart'; +import 'package:preception/chat_screen.dart'; +import 'package:preception/constants.dart'; +import 'package:preception/file_screen.dart'; +import 'package:preception/quiz_screen.dart'; +import 'package:preception/video_screen.dart'; // To extract file name + +class FileUploadScreen extends StatefulWidget { + @override + _FileUploadScreenState createState() => _FileUploadScreenState(); +} + +class _FileUploadScreenState extends State { + File? selectedFile; + String uploadMessage = ""; + bool isUploading = false; // To track file upload status + bool isFileUploaded = false; // To check if file is uploaded + + // Function to pick a PDF file + Future pickFile() async { + FilePickerResult? result = await FilePicker.platform.pickFiles( + type: FileType.custom, + allowedExtensions: ['pdf'], + ); + + if (result != null) { + setState(() { + selectedFile = File(result.files.single.path!); + isFileUploaded = false; // Reset after selecting a new file + }); + } + } + + // Function to upload the PDF file + Future uploadFile() async { + if (selectedFile == null) { + setState(() { + uploadMessage = "No file selected!"; + }); + return; + } + + setState(() { + isUploading = true; + uploadMessage = ""; + }); + + var request = http.MultipartRequest( + 'POST', + Uri.parse('${baseUrl}/upload'), // Change this to your server URL + // Uri.parse('http://192.168.1.133:5000/upload'), // Change this to your server URL + ); + + // Add the file to the request + request.files.add(await http.MultipartFile.fromPath('pdf', selectedFile!.path)); + + // Send the request and handle the response + try { + var response = await request.send(); + + if (response.statusCode == 200) { + setState(() { + uploadMessage = "File uploaded successfully!"; + isFileUploaded = true; // Enable quiz button + }); + } else { + setState(() { + uploadMessage = "File upload failed with status: ${response.statusCode}"; + }); + } + } catch (e) { + setState(() { + uploadMessage = "File upload failed: $e"; + }); + } finally { + setState(() { + isUploading = false; + }); + } + } + + // Function to navigate to the quiz screen + void navigateToQuizScreen(BuildContext context) { + if (isFileUploaded) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => QuizScreen()), + ); + } + } + + // Function to navigate to the file check screen +void navigateToFileCheckScreen(BuildContext context) { + if (isFileUploaded) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => FileCheckScreen()), + ); + } +} + + // Function to navigate to the file check screen +void navigateToVideoCheckScreen(BuildContext context) { + if (isFileUploaded) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => VideoCheckScreen()), + ); +} +} + + // Function to navigate to the quiz screen + void navigateToChatScreen(BuildContext context) { + if (isFileUploaded) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => ChatScreen()), + ); + } + } + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("PERCEPTION",style: TextStyle(color: Colors.red,fontWeight: FontWeight.w800),), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (isFileUploaded) // Show Quiz button only after file upload + ElevatedButton( + onPressed: () => navigateToVideoCheckScreen(context), // Change this line + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Icon(Icons.video_camera_back_outlined,size: 48,color: Colors.red), + Text("Video",style: TextStyle(color: Colors.red),) + ], + ), + ), + ), + SizedBox(height: 20,), + if (selectedFile != null) + Text("Selected File: ${basename(selectedFile!.path)}"), + ElevatedButton( + onPressed: pickFile, + child: Text("Select PDF",style: TextStyle(color: Colors.red),), + ), + ElevatedButton( + onPressed: isUploading ? null : uploadFile, + child: isUploading ? CircularProgressIndicator() : Text("Upload PDF",style: TextStyle(color: Colors.red),), + ), + if (uploadMessage.isNotEmpty) + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + uploadMessage, + style: TextStyle(color: uploadMessage.contains('successfully') ? Colors.red : Colors.orange), + ), + ), + Row( + + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (isFileUploaded) // Show Quiz button only after file upload + ElevatedButton( + onPressed: () => navigateToQuizScreen(context), // Passing context here + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Icon(Icons.quiz,color: Colors.red,), + + Text("Quiz",style: TextStyle(color: Colors.red),) + ], + ), + ), + ), + if (isFileUploaded) // Show Quiz button only after file upload + ElevatedButton( + + onPressed: () => navigateToChatScreen(context), // Passing context here + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Icon(Icons.chat,color: Colors.red), + + Text("Chat",style: TextStyle(color: Colors.red),) + ], + ), + ), + ), + if (isFileUploaded) // Show Quiz button only after file upload + ElevatedButton( + onPressed: () => navigateToFileCheckScreen(context), // Change this line + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Icon(Icons.audio_file,color: Colors.red), + Text("Audio",style: TextStyle(color: Colors.red),) + ], + ), + ), + ), + ], + ) + ], + ), + ), + ); + } +} + diff --git a/shadowwalkerz/lib/main.dart b/shadowwalkerz/lib/main.dart new file mode 100644 index 0000000..c77c406 --- /dev/null +++ b/shadowwalkerz/lib/main.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:preception/home_screen.dart'; +import 'package:preception/splash_screen.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + debugShowCheckedModeBanner: false, + theme: ThemeData( + brightness: Brightness.dark, // Dark theme for Netflix look + ), + // home: FileUploadScreen(), + initialRoute: '/', + routes: { + '/': (context) => SplashScreen(), // Splash screen as the initial screen + '/home': (context) => FileUploadScreen(), // Main screen after splash + }, + ); + } +} diff --git a/shadowwalkerz/lib/quiz_screen.dart b/shadowwalkerz/lib/quiz_screen.dart new file mode 100644 index 0000000..c6a08bc --- /dev/null +++ b/shadowwalkerz/lib/quiz_screen.dart @@ -0,0 +1,144 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:preception/constants.dart'; +import 'score_screen.dart'; + +class QuizScreen extends StatefulWidget { + @override + _QuizScreenState createState() => _QuizScreenState(); +} + +class _QuizScreenState extends State { + List _mcqs = []; + int _currentQuestionIndex = 0; + String? _selectedOption; + List> _userAnswers = []; + // String baseUrl = 'http://192.168.43.215:5000'; + + @override + void initState() { + super.initState(); + _fetchMCQs(); + } + + Future _fetchMCQs() async { + var response = await http.get(Uri.parse('${baseUrl}/get_mcqs')); + + if (response.statusCode == 200) { + setState(() { + _mcqs = json.decode(response.body); + }); + } else { + print('Failed to fetch MCQs: ${response.body}'); + } + } + + void _submitAnswer() { + if (_selectedOption == null) { + // Show an alert if no option is selected + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text('Please select an answer!'), + )); + return; + } + + _userAnswers.add({ + 'question_id': _mcqs[_currentQuestionIndex]['id'], + 'selected_option':"Answer ${_selectedOption}" + }); + + if (_currentQuestionIndex < _mcqs.length - 1) { + setState(() { + _currentQuestionIndex++; + _selectedOption = null; // Clear selected option for next question + }); + } else { + _submitAnswers(); + } + } + + Future _submitAnswers() async { + var response = await http.post( + Uri.parse('${baseUrl}/submit_answers'), + headers: { + 'Content-Type': 'application/json; charset=UTF-8', + }, + body: jsonEncode({'answers': _userAnswers}), + ); + + if (response.statusCode == 200) { + int score = json.decode(response.body)['score']; + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => ScoreScreen(score: score), + ), + ); + } else { + print('Failed to submit answers: ${response.body}'); + } + } + + List _getOptions(dynamic options) { + // If options are null or empty, return dummy options + if (options == null || (options is List && options.isEmpty)) { + return ['Dummy Option 1', 'Dummy Option 2', 'Dummy Option 3', 'Dummy Option 4']; + } else { + return List.from(options); + } + } + + @override + Widget build(BuildContext context) { + if (_mcqs.isEmpty) { + return Scaffold( + appBar: AppBar(title: Text('Quiz')), + body: Center(child: CircularProgressIndicator()), + ); + } + + var currentQuestion = _mcqs[_currentQuestionIndex]; + var options = _getOptions(currentQuestion['options']); // Use dummy options if necessary + + return Scaffold( + appBar: AppBar(title: Text('Quiz')), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Text( + 'Question ${_currentQuestionIndex + 1}/${_mcqs.length}', + style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold), + ), + SizedBox(height: 20), + Text(currentQuestion['question'], style: TextStyle(fontSize: 18)), + ...options.map((option) { + return RadioListTile( + title: Text(option), + value: option, + groupValue: _selectedOption, // Manage selected answer + onChanged: (value) { + setState(() { + _selectedOption = value.toString(); + }); + }, + ); + }).toList(), + SizedBox(height: 20), + if (_currentQuestionIndex == _mcqs.length - 1) + ElevatedButton( + onPressed: _submitAnswer, // Submit quiz after the last question + child: Text('Submit Quiz'), + ), + if (_currentQuestionIndex < _mcqs.length - 1) + ElevatedButton( + onPressed: _submitAnswer, // Next question button + child: Text('Next Question'), + ), + ], + ), + ), + ); + } +} diff --git a/shadowwalkerz/lib/score_screen.dart b/shadowwalkerz/lib/score_screen.dart new file mode 100644 index 0000000..39271fc --- /dev/null +++ b/shadowwalkerz/lib/score_screen.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; + +class ScoreScreen extends StatelessWidget { + final int score; + + const ScoreScreen({Key? key, required this.score}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('Quiz Score')), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('Your Score:', style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold)), + SizedBox(height: 20), + Text('$score', style: TextStyle(fontSize: 50, fontWeight: FontWeight.bold)), + SizedBox(height: 40), + ElevatedButton( + onPressed: () { + Navigator.popUntil(context, (route) => route.isFirst); + }, + child: Text('Back to Home'), + ), + ], + ), + ), + ); + } +} diff --git a/shadowwalkerz/lib/splash_screen.dart b/shadowwalkerz/lib/splash_screen.dart new file mode 100644 index 0000000..a8ba34b --- /dev/null +++ b/shadowwalkerz/lib/splash_screen.dart @@ -0,0 +1,66 @@ +import 'package:flutter/material.dart'; +import 'dart:async'; + +class SplashScreen extends StatefulWidget { + @override + _SplashScreenState createState() => _SplashScreenState(); +} + +class _SplashScreenState extends State with SingleTickerProviderStateMixin { + late AnimationController _animationController; + late Animation _fadeAnimation; + + @override + void initState() { + super.initState(); + + // Animation controller for the fade-in effect + _animationController = AnimationController( + duration: const Duration(seconds: 2), + vsync: this, + ); + + _fadeAnimation = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation( + parent: _animationController, + curve: Curves.easeIn, + ), + ); + + // Start the animation + _animationController.forward(); + + // Delay for splash screen before navigating to the home screen + Timer(Duration(seconds: 4), () { + Navigator.pushReplacementNamed(context, '/home'); + }); + } + + @override + void dispose() { + _animationController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.black, + body: Center( + child: FadeTransition( + opacity: _fadeAnimation, // Corrected usage of the animation + child: Text( + 'PERCEPTION', + style: TextStyle( + fontSize: 48, + fontWeight: FontWeight.bold, + color: Colors.red, // Netflix-style red color + letterSpacing: 4.0, // Optional letter spacing to enhance the effect + fontFamily: 'NetflixFont', // Optional: You can add custom fonts here + ), + ), + ), + ), + ); + } +} diff --git a/shadowwalkerz/lib/video_screen.dart b/shadowwalkerz/lib/video_screen.dart new file mode 100644 index 0000000..7cde8d4 --- /dev/null +++ b/shadowwalkerz/lib/video_screen.dart @@ -0,0 +1,157 @@ +import 'dart:async'; +import 'dart:io'; +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:path_provider/path_provider.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:preception/constants.dart'; +import 'package:video_player/video_player.dart'; + +class VideoCheckScreen extends StatefulWidget { + @override + _VideoCheckScreenState createState() => _VideoCheckScreenState(); +} + +class _VideoCheckScreenState extends State { + bool isLoading = true; + bool filesExist = false; + String videoPath = ""; + late VideoPlayerController _controller; + Timer? checkFilesTimer; // Timer for sending requests every 5 seconds + + @override + void initState() { + super.initState(); + + // Start checking for video file every 5 seconds + startFileCheck(); + } + + @override + void dispose() { + _controller.dispose(); + checkFilesTimer?.cancel(); + super.dispose(); + } + + // Function to check for video file every 5 seconds + void startFileCheck() { + checkFiles(); // Initial check + checkFilesTimer = Timer.periodic(Duration(seconds: 5), (timer) { + checkFiles(); // Re-check video file every 5 seconds + }); + } + + // Function to check if video file exists + Future checkFiles() async { + try { + final response = await http.get(Uri.parse('${baseUrl}/check-video')); + + if (response.statusCode == 200) { + final jsonResponse = jsonDecode(response.body); + + if (jsonResponse['files_exist'] == true) { + setState(() { + filesExist = true; + videoPath = jsonResponse['video']; + }); + // Stop the periodic check if video file is found + checkFilesTimer?.cancel(); + + // Download the video file + await downloadVideo(videoPath); + } else { + setState(() { + filesExist = false; + }); + } + } else { + Fluttertoast.showToast(msg: 'Failed to check video file'); + } + } catch (e) { + Fluttertoast.showToast(msg: 'Error: $e'); + } + } + + // Function to download the video file + Future downloadVideo(String filename) async { + final url = '${baseUrl}/download-video/$filename'; + final directory = await getApplicationDocumentsDirectory(); + + // Download video file + final response = await http.get(Uri.parse(url)); + if (response.statusCode == 200) { + final localFile = File('${directory.path}/$filename'); + await localFile.writeAsBytes(response.bodyBytes); + + if (await localFile.exists()) { + setState(() { + videoPath = localFile.path; + isLoading = false; // Stop loading after download + }); + + // Initialize video player after confirming file exists + _controller = VideoPlayerController.file(localFile) + ..initialize().then((_) { + setState(() {}); + _controller.play(); // Automatically start playing + }); + } else { + Fluttertoast.showToast(msg: 'Video file not found after download'); + } + } else { + Fluttertoast.showToast(msg: 'Failed to download video file'); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('Video Playback')), + body: Center( + child: isLoading + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircularProgressIndicator(), + SizedBox(height: 20), + Text('Checking for video... Please wait.'), + ], + ) + : filesExist + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _controller.value.isInitialized + ? FittedBox( + fit: BoxFit.contain, + child: SizedBox( + width: _controller.value.size.width ?? 0, + height: _controller.value.size.height ?? 0, + child: VideoPlayer(_controller), + ), + ) + : Container(), + SizedBox(height: 20), + ElevatedButton( + onPressed: () { + setState(() { + _controller.value.isPlaying + ? _controller.pause() + : _controller.play(); + }); + }, + child: Icon( + _controller.value.isPlaying + ? Icons.pause + : Icons.play_arrow, + ), + ), + ], + ) + : Text('Video file is not available!'), + ), + ); + } +} diff --git a/shadowwalkerz/linux/CMakeLists.txt b/shadowwalkerz/linux/CMakeLists.txt new file mode 100644 index 0000000..45ff7f9 --- /dev/null +++ b/shadowwalkerz/linux/CMakeLists.txt @@ -0,0 +1,145 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "preception") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.preception") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/shadowwalkerz/linux/flutter/CMakeLists.txt b/shadowwalkerz/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..27860e8 --- /dev/null +++ b/shadowwalkerz/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/shadowwalkerz/linux/flutter/generated_plugin_registrant.cc b/shadowwalkerz/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..e0c16cd --- /dev/null +++ b/shadowwalkerz/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,19 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin"); + audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar); + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); +} diff --git a/shadowwalkerz/linux/flutter/generated_plugin_registrant.h b/shadowwalkerz/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/shadowwalkerz/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/shadowwalkerz/linux/flutter/generated_plugins.cmake b/shadowwalkerz/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..a77328d --- /dev/null +++ b/shadowwalkerz/linux/flutter/generated_plugins.cmake @@ -0,0 +1,25 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + audioplayers_linux + file_selector_linux +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/shadowwalkerz/linux/main.cc b/shadowwalkerz/linux/main.cc new file mode 100644 index 0000000..4340ffc --- /dev/null +++ b/shadowwalkerz/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/shadowwalkerz/linux/my_application.cc b/shadowwalkerz/linux/my_application.cc new file mode 100644 index 0000000..8785136 --- /dev/null +++ b/shadowwalkerz/linux/my_application.cc @@ -0,0 +1,124 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "preception"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "preception"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_NON_UNIQUE, + nullptr)); +} diff --git a/shadowwalkerz/linux/my_application.h b/shadowwalkerz/linux/my_application.h new file mode 100644 index 0000000..8f20fb5 --- /dev/null +++ b/shadowwalkerz/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/shadowwalkerz/macos/Flutter/Flutter-Debug.xcconfig b/shadowwalkerz/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..f022c34 --- /dev/null +++ b/shadowwalkerz/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/shadowwalkerz/macos/Flutter/Flutter-Release.xcconfig b/shadowwalkerz/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..f022c34 --- /dev/null +++ b/shadowwalkerz/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/shadowwalkerz/macos/Flutter/GeneratedPluginRegistrant.swift b/shadowwalkerz/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..ecdd6db --- /dev/null +++ b/shadowwalkerz/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,18 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import audioplayers_darwin +import file_selector_macos +import path_provider_foundation +import video_player_avfoundation + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin")) +} diff --git a/shadowwalkerz/macos/Runner.xcodeproj/project.pbxproj b/shadowwalkerz/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6422aa2 --- /dev/null +++ b/shadowwalkerz/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,705 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* preception.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "preception.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* preception.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* preception.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/preception.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/preception"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/preception.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/preception"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.preception.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/preception.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/preception"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/shadowwalkerz/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/shadowwalkerz/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/shadowwalkerz/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/shadowwalkerz/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/shadowwalkerz/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..cc6074f --- /dev/null +++ b/shadowwalkerz/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/macos/Runner.xcworkspace/contents.xcworkspacedata b/shadowwalkerz/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..59c6d39 --- /dev/null +++ b/shadowwalkerz/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/shadowwalkerz/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/shadowwalkerz/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..fc6bf80 --- /dev/null +++ b/shadowwalkerz/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/shadowwalkerz/macos/Runner/AppDelegate.swift b/shadowwalkerz/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..553a135 --- /dev/null +++ b/shadowwalkerz/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..8d4e7cb --- /dev/null +++ b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..82b6f9d Binary files /dev/null and b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..13b35eb Binary files /dev/null and b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..0a3f5fa Binary files /dev/null and b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..bdb5722 Binary files /dev/null and b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..f083318 Binary files /dev/null and b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..326c0e7 Binary files /dev/null and b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..2f1632c Binary files /dev/null and b/shadowwalkerz/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/shadowwalkerz/macos/Runner/Base.lproj/MainMenu.xib b/shadowwalkerz/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..4632c69 --- /dev/null +++ b/shadowwalkerz/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/macos/Runner/Configs/AppInfo.xcconfig b/shadowwalkerz/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..cbb1cb6 --- /dev/null +++ b/shadowwalkerz/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = preception + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.preception + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright Β© 2024 com.example. All rights reserved. diff --git a/shadowwalkerz/macos/Runner/Configs/Debug.xcconfig b/shadowwalkerz/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..b398823 --- /dev/null +++ b/shadowwalkerz/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/shadowwalkerz/macos/Runner/Configs/Release.xcconfig b/shadowwalkerz/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..d93e5dc --- /dev/null +++ b/shadowwalkerz/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/shadowwalkerz/macos/Runner/Configs/Warnings.xcconfig b/shadowwalkerz/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..fb4d7d3 --- /dev/null +++ b/shadowwalkerz/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/shadowwalkerz/macos/Runner/DebugProfile.entitlements b/shadowwalkerz/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..51d0967 --- /dev/null +++ b/shadowwalkerz/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/shadowwalkerz/macos/Runner/Info.plist b/shadowwalkerz/macos/Runner/Info.plist new file mode 100644 index 0000000..3733c1a --- /dev/null +++ b/shadowwalkerz/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/shadowwalkerz/macos/Runner/MainFlutterWindow.swift b/shadowwalkerz/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..ab30cba --- /dev/null +++ b/shadowwalkerz/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/shadowwalkerz/macos/Runner/Release.entitlements b/shadowwalkerz/macos/Runner/Release.entitlements new file mode 100644 index 0000000..04336df --- /dev/null +++ b/shadowwalkerz/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/shadowwalkerz/macos/RunnerTests/RunnerTests.swift b/shadowwalkerz/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..21fe1ab --- /dev/null +++ b/shadowwalkerz/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +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. + } + +} diff --git a/shadowwalkerz/preception.iml b/shadowwalkerz/preception.iml new file mode 100644 index 0000000..4a179b7 --- /dev/null +++ b/shadowwalkerz/preception.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/pubspec.lock b/shadowwalkerz/pubspec.lock new file mode 100644 index 0000000..f271b3e --- /dev/null +++ b/shadowwalkerz/pubspec.lock @@ -0,0 +1,754 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" + args: + dependency: transitive + description: + name: args + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + audioplayers: + dependency: "direct main" + description: + name: audioplayers + sha256: c346ba5a39dc208f1bab55fc239855f573d69b0e832402114bf0b793622adc4d + url: "https://pub.dev" + source: hosted + version: "6.1.0" + audioplayers_android: + dependency: transitive + description: + name: audioplayers_android + sha256: de576b890befe27175c2f511ba8b742bec83765fa97c3ce4282bba46212f58e4 + url: "https://pub.dev" + source: hosted + version: "5.0.0" + audioplayers_darwin: + dependency: transitive + description: + name: audioplayers_darwin + sha256: e507887f3ff18d8e5a10a668d7bedc28206b12e10b98347797257c6ae1019c3b + url: "https://pub.dev" + source: hosted + version: "6.0.0" + audioplayers_linux: + dependency: transitive + description: + name: audioplayers_linux + sha256: "3d3d244c90436115417f170426ce768856d8fe4dfc5ed66a049d2890acfa82f9" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + audioplayers_platform_interface: + dependency: transitive + description: + name: audioplayers_platform_interface + sha256: "6834dd48dfb7bc6c2404998ebdd161f79cd3774a7e6779e1348d54a3bfdcfaa5" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + audioplayers_web: + dependency: transitive + description: + name: audioplayers_web + sha256: "3609bdf0e05e66a3d9750ee40b1e37f2a622c4edb796cc600b53a90a30a2ace4" + url: "https://pub.dev" + source: hosted + version: "5.0.1" + audioplayers_windows: + dependency: transitive + description: + name: audioplayers_windows + sha256: "8605762dddba992138d476f6a0c3afd9df30ac5b96039929063eceed416795c2" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + charts_common: + dependency: transitive + description: + name: charts_common + sha256: "7b8922f9b0d9b134122756a787dab1c3946ae4f3fc5022ff323ba0014998ea02" + url: "https://pub.dev" + source: hosted + version: "0.12.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + sha256: "4172c3f4b85322fdffe1896ffbed79ae4689ae72cb6fe6690dcaaea620a9c558" + url: "https://pub.dev" + source: hosted + version: "0.12.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + url: "https://pub.dev" + source: hosted + version: "0.4.1" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + file_picker: + dependency: "direct main" + description: + name: file_picker + sha256: "2ca051989f69d1b2ca012b2cf3ccf78c70d40144f0861ff2c063493f7c8c3d45" + url: "https://pub.dev" + source: hosted + version: "8.0.5" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" + source: hosted + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: cb284e267f8e2a45a904b5c094d2ba51d0aabfc20b1538ab786d9ef7dc2bf75c + url: "https://pub.dev" + source: hosted + version: "0.9.4+1" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "2ad726953f6e8affbc4df8dc78b77c3b4a060967a291e528ef72ae846c60fb69" + url: "https://pub.dev" + source: hosted + version: "0.9.3+2" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + sha256: "619817c4b65b322b5104b6bb6dfe6cda62d9729bd7ad4303ecc8b4e690a67a77" + url: "https://pub.dev" + source: hosted + version: "0.14.1" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f" + url: "https://pub.dev" + source: hosted + version: "2.0.19" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + fluttertoast: + dependency: "direct main" + description: + name: fluttertoast + sha256: "95f349437aeebe524ef7d6c9bde3e6b4772717cf46a0eb6a3ceaddc740b297cc" + url: "https://pub.dev" + source: hosted + version: "8.2.8" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 + url: "https://pub.dev" + source: hosted + version: "6.2.1" + html: + dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" + http: + dependency: "direct main" + description: + name: http + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + url: "https://pub.dev" + source: hosted + version: "1.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + image: + dependency: transitive + description: + name: image + sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + url: "https://pub.dev" + source: hosted + version: "4.2.0" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "0f57fee1e8bfadf8cc41818bbcd7f72e53bb768a54d9496355d5e8a5681a19f1" + url: "https://pub.dev" + source: hosted + version: "0.8.12+1" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "65d94623e15372c5c51bebbcb820848d7bcb323836e12dfdba60b5d3a8b39e50" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "6703696ad49f5c3c8356d576d7ace84d1faf459afb07accbb0fae780753ff447" + url: "https://pub.dev" + source: hosted + version: "0.8.12" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "9ec26d410ff46f483c5519c29c02ef0e02e13a543f882b152d4bfd2f06802f80" + url: "https://pub.dev" + source: hosted + version: "2.10.0" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + intl: + dependency: transitive + description: + name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" + source: hosted + version: "0.17.0" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + url: "https://pub.dev" + source: hosted + version: "10.0.4" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + url: "https://pub.dev" + source: hosted + version: "3.0.3" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + meta: + dependency: transitive + description: + name: meta + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + mime: + dependency: transitive + description: + name: mime + sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + url: "https://pub.dev" + source: hosted + version: "1.0.6" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + url: "https://pub.dev" + source: hosted + version: "2.1.4" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d + url: "https://pub.dev" + source: hosted + version: "2.2.4" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + url: "https://pub.dev" + source: hosted + version: "2.4.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + platform: + dependency: transitive + description: + name: platform + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + url: "https://pub.dev" + source: hosted + version: "3.1.5" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + provider: + dependency: "direct main" + description: + name: provider + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c + url: "https://pub.dev" + source: hosted + version: "6.1.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + video_player: + dependency: "direct main" + description: + name: video_player + sha256: e30df0d226c4ef82e2c150ebf6834b3522cf3f654d8e2f9419d376cdc071425d + url: "https://pub.dev" + source: hosted + version: "2.9.1" + video_player_android: + dependency: transitive + description: + name: video_player_android + sha256: "134e1ad410d67e18a19486ed9512c72dfc6d8ffb284d0e8f2e99e903d1ba8fa3" + url: "https://pub.dev" + source: hosted + version: "2.4.14" + video_player_avfoundation: + dependency: transitive + description: + name: video_player_avfoundation + sha256: d1e9a824f2b324000dc8fb2dcb2a3285b6c1c7c487521c63306cc5b394f68a7c + url: "https://pub.dev" + source: hosted + version: "2.6.1" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + sha256: "236454725fafcacf98f0f39af0d7c7ab2ce84762e3b63f2cbb3ef9a7e0550bc6" + url: "https://pub.dev" + source: hosted + version: "6.2.2" + video_player_web: + dependency: transitive + description: + name: video_player_web + sha256: "6dcdd298136523eaf7dfc31abaf0dfba9aa8a8dbc96670e87e9d42b6f2caf774" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + url: "https://pub.dev" + source: hosted + version: "14.2.1" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" + win32: + dependency: transitive + description: + name: win32 + sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" + url: "https://pub.dev" + source: hosted + version: "5.5.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" + source: hosted + version: "1.0.4" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.4.0-282.3.beta <4.0.0" + flutter: ">=3.19.2" diff --git a/shadowwalkerz/pubspec.yaml b/shadowwalkerz/pubspec.yaml new file mode 100644 index 0000000..62e19da --- /dev/null +++ b/shadowwalkerz/pubspec.yaml @@ -0,0 +1,104 @@ +name: preception +description: "A new Flutter project." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: '>=3.4.0-282.3.beta <4.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + http: + google_fonts: + file_picker: + provider: + charts_flutter: + image_picker: + audioplayers: + fluttertoast: + video_player: + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.6 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_launcher_icons: + +flutter_icons: + android: true + ios: true + image_path: "assets/logo.jpeg" + + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^3.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - assets/logo.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/shadowwalkerz/test/widget_test.dart b/shadowwalkerz/test/widget_test.dart new file mode 100644 index 0000000..355ef8b --- /dev/null +++ b/shadowwalkerz/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:preception/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/shadowwalkerz/web/favicon.png b/shadowwalkerz/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/shadowwalkerz/web/favicon.png differ diff --git a/shadowwalkerz/web/icons/Icon-192.png b/shadowwalkerz/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/shadowwalkerz/web/icons/Icon-192.png differ diff --git a/shadowwalkerz/web/icons/Icon-512.png b/shadowwalkerz/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/shadowwalkerz/web/icons/Icon-512.png differ diff --git a/shadowwalkerz/web/icons/Icon-maskable-192.png b/shadowwalkerz/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/shadowwalkerz/web/icons/Icon-maskable-192.png differ diff --git a/shadowwalkerz/web/icons/Icon-maskable-512.png b/shadowwalkerz/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/shadowwalkerz/web/icons/Icon-maskable-512.png differ diff --git a/shadowwalkerz/web/index.html b/shadowwalkerz/web/index.html new file mode 100644 index 0000000..5202eb6 --- /dev/null +++ b/shadowwalkerz/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + preception + + + + + + diff --git a/shadowwalkerz/web/manifest.json b/shadowwalkerz/web/manifest.json new file mode 100644 index 0000000..0a47ef8 --- /dev/null +++ b/shadowwalkerz/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "preception", + "short_name": "preception", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/shadowwalkerz/windows/CMakeLists.txt b/shadowwalkerz/windows/CMakeLists.txt new file mode 100644 index 0000000..ed91430 --- /dev/null +++ b/shadowwalkerz/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(preception LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "preception") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/shadowwalkerz/windows/flutter/CMakeLists.txt b/shadowwalkerz/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..efb62eb --- /dev/null +++ b/shadowwalkerz/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/shadowwalkerz/windows/flutter/generated_plugin_registrant.cc b/shadowwalkerz/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..5783469 --- /dev/null +++ b/shadowwalkerz/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,17 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + AudioplayersWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin")); + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); +} diff --git a/shadowwalkerz/windows/flutter/generated_plugin_registrant.h b/shadowwalkerz/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/shadowwalkerz/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/shadowwalkerz/windows/flutter/generated_plugins.cmake b/shadowwalkerz/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..786e173 --- /dev/null +++ b/shadowwalkerz/windows/flutter/generated_plugins.cmake @@ -0,0 +1,25 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + audioplayers_windows + file_selector_windows +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/shadowwalkerz/windows/runner/CMakeLists.txt b/shadowwalkerz/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..2041a04 --- /dev/null +++ b/shadowwalkerz/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/shadowwalkerz/windows/runner/Runner.rc b/shadowwalkerz/windows/runner/Runner.rc new file mode 100644 index 0000000..e20fcd5 --- /dev/null +++ b/shadowwalkerz/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "preception" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "preception" "\0" + VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "preception.exe" "\0" + VALUE "ProductName", "preception" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/shadowwalkerz/windows/runner/flutter_window.cpp b/shadowwalkerz/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..c819cb0 --- /dev/null +++ b/shadowwalkerz/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/shadowwalkerz/windows/runner/flutter_window.h b/shadowwalkerz/windows/runner/flutter_window.h new file mode 100644 index 0000000..28c2383 --- /dev/null +++ b/shadowwalkerz/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/shadowwalkerz/windows/runner/main.cpp b/shadowwalkerz/windows/runner/main.cpp new file mode 100644 index 0000000..22702cc --- /dev/null +++ b/shadowwalkerz/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"preception", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/shadowwalkerz/windows/runner/resource.h b/shadowwalkerz/windows/runner/resource.h new file mode 100644 index 0000000..ddc7f3e --- /dev/null +++ b/shadowwalkerz/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/shadowwalkerz/windows/runner/resources/app_icon.ico b/shadowwalkerz/windows/runner/resources/app_icon.ico new file mode 100644 index 0000000..c04e20c Binary files /dev/null and b/shadowwalkerz/windows/runner/resources/app_icon.ico differ diff --git a/shadowwalkerz/windows/runner/runner.exe.manifest b/shadowwalkerz/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..157e871 --- /dev/null +++ b/shadowwalkerz/windows/runner/runner.exe.manifest @@ -0,0 +1,20 @@ + + + + + PerMonitorV2 + + + + + + + + + + + + + + + diff --git a/shadowwalkerz/windows/runner/utils.cpp b/shadowwalkerz/windows/runner/utils.cpp new file mode 100644 index 0000000..259d85b --- /dev/null +++ b/shadowwalkerz/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/shadowwalkerz/windows/runner/utils.h b/shadowwalkerz/windows/runner/utils.h new file mode 100644 index 0000000..3f0e05c --- /dev/null +++ b/shadowwalkerz/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/shadowwalkerz/windows/runner/win32_window.cpp b/shadowwalkerz/windows/runner/win32_window.cpp new file mode 100644 index 0000000..b5ba2a0 --- /dev/null +++ b/shadowwalkerz/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/shadowwalkerz/windows/runner/win32_window.h b/shadowwalkerz/windows/runner/win32_window.h new file mode 100644 index 0000000..49b847f --- /dev/null +++ b/shadowwalkerz/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_