diff --git a/session_1/assignments/Solution/program1_fibonacci/.gitignore b/session_1/assignments/Solution/program1_fibonacci/.gitignore new file mode 100644 index 00000000..3c8a1572 --- /dev/null +++ b/session_1/assignments/Solution/program1_fibonacci/.gitignore @@ -0,0 +1,6 @@ +# Files and directories created by pub. +.dart_tool/ +.packages + +# Conventional directory for build output. +build/ diff --git a/session_1/assignments/Solution/program1_fibonacci/.vscode/launch.json b/session_1/assignments/Solution/program1_fibonacci/.vscode/launch.json new file mode 100644 index 00000000..80485ae8 --- /dev/null +++ b/session_1/assignments/Solution/program1_fibonacci/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "program1_fibonacci", + "request": "launch", + "type": "dart", + "console": "terminal" + } + ] +} \ No newline at end of file diff --git a/session_1/assignments/Solution/program1_fibonacci/CHANGELOG.md b/session_1/assignments/Solution/program1_fibonacci/CHANGELOG.md new file mode 100644 index 00000000..effe43c8 --- /dev/null +++ b/session_1/assignments/Solution/program1_fibonacci/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/session_1/assignments/Solution/program1_fibonacci/Outputs/Output 1.png b/session_1/assignments/Solution/program1_fibonacci/Outputs/Output 1.png new file mode 100644 index 00000000..841ba6df Binary files /dev/null and b/session_1/assignments/Solution/program1_fibonacci/Outputs/Output 1.png differ diff --git a/session_1/assignments/Solution/program1_fibonacci/Outputs/Output 2.png b/session_1/assignments/Solution/program1_fibonacci/Outputs/Output 2.png new file mode 100644 index 00000000..9702726b Binary files /dev/null and b/session_1/assignments/Solution/program1_fibonacci/Outputs/Output 2.png differ diff --git a/session_1/assignments/Solution/program1_fibonacci/README.md b/session_1/assignments/Solution/program1_fibonacci/README.md new file mode 100644 index 00000000..a3075394 --- /dev/null +++ b/session_1/assignments/Solution/program1_fibonacci/README.md @@ -0,0 +1 @@ +A simple command-line application. diff --git a/session_1/assignments/Solution/program1_fibonacci/analysis_options.yaml b/session_1/assignments/Solution/program1_fibonacci/analysis_options.yaml new file mode 100644 index 00000000..dee8927a --- /dev/null +++ b/session_1/assignments/Solution/program1_fibonacci/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/session_1/assignments/Solution/program1_fibonacci/bin/program1_fibonacci.dart b/session_1/assignments/Solution/program1_fibonacci/bin/program1_fibonacci.dart new file mode 100644 index 00000000..f1ee88dd --- /dev/null +++ b/session_1/assignments/Solution/program1_fibonacci/bin/program1_fibonacci.dart @@ -0,0 +1,16 @@ +import 'dart:io'; + +void main(List args) { + print("Enter the number of terms:"); + int n = int.parse(stdin.readLineSync()!); + int t1 = 0; + int t2 = 1; + print("$t1\n$t2"); + int t3; + for (var i = 2; i < n; i++) { + t3 = t1 + t2; + print("$t3"); + t1 = t2; + t2 = t3; + } +} diff --git a/session_1/assignments/Solution/program1_fibonacci/pubspec.lock b/session_1/assignments/Solution/program1_fibonacci/pubspec.lock new file mode 100644 index 00000000..50a12baa --- /dev/null +++ b/session_1/assignments/Solution/program1_fibonacci/pubspec.lock @@ -0,0 +1,12 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + lints: + dependency: "direct dev" + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" +sdks: + dart: ">=2.15.1 <3.0.0" diff --git a/session_1/assignments/Solution/program1_fibonacci/pubspec.yaml b/session_1/assignments/Solution/program1_fibonacci/pubspec.yaml new file mode 100644 index 00000000..4250000e --- /dev/null +++ b/session_1/assignments/Solution/program1_fibonacci/pubspec.yaml @@ -0,0 +1,14 @@ +name: program1_fibonacci +description: A simple command-line application. +version: 1.0.0 +# homepage: https://www.example.com + +environment: + sdk: '>=2.15.1 <3.0.0' + + +# dependencies: +# path: ^1.8.0 + +dev_dependencies: + lints: ^1.0.0 diff --git a/session_1/assignments/Solution/program2_semiprime/.gitignore b/session_1/assignments/Solution/program2_semiprime/.gitignore new file mode 100644 index 00000000..3c8a1572 --- /dev/null +++ b/session_1/assignments/Solution/program2_semiprime/.gitignore @@ -0,0 +1,6 @@ +# Files and directories created by pub. +.dart_tool/ +.packages + +# Conventional directory for build output. +build/ diff --git a/session_1/assignments/Solution/program2_semiprime/.vscode/launch.json b/session_1/assignments/Solution/program2_semiprime/.vscode/launch.json new file mode 100644 index 00000000..a17a70c0 --- /dev/null +++ b/session_1/assignments/Solution/program2_semiprime/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "program2_semiprime", + "request": "launch", + "type": "dart", + "console": "terminal" + } + ] +} \ No newline at end of file diff --git a/session_1/assignments/Solution/program2_semiprime/CHANGELOG.md b/session_1/assignments/Solution/program2_semiprime/CHANGELOG.md new file mode 100644 index 00000000..effe43c8 --- /dev/null +++ b/session_1/assignments/Solution/program2_semiprime/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/session_1/assignments/Solution/program2_semiprime/Outputs/Output 1.png b/session_1/assignments/Solution/program2_semiprime/Outputs/Output 1.png new file mode 100644 index 00000000..c6d6759f Binary files /dev/null and b/session_1/assignments/Solution/program2_semiprime/Outputs/Output 1.png differ diff --git a/session_1/assignments/Solution/program2_semiprime/Outputs/Output 2.png b/session_1/assignments/Solution/program2_semiprime/Outputs/Output 2.png new file mode 100644 index 00000000..4f2b0b4f Binary files /dev/null and b/session_1/assignments/Solution/program2_semiprime/Outputs/Output 2.png differ diff --git a/session_1/assignments/Solution/program2_semiprime/README.md b/session_1/assignments/Solution/program2_semiprime/README.md new file mode 100644 index 00000000..a3075394 --- /dev/null +++ b/session_1/assignments/Solution/program2_semiprime/README.md @@ -0,0 +1 @@ +A simple command-line application. diff --git a/session_1/assignments/Solution/program2_semiprime/analysis_options.yaml b/session_1/assignments/Solution/program2_semiprime/analysis_options.yaml new file mode 100644 index 00000000..dee8927a --- /dev/null +++ b/session_1/assignments/Solution/program2_semiprime/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/session_1/assignments/Solution/program2_semiprime/bin/program2_semiprime.dart b/session_1/assignments/Solution/program2_semiprime/bin/program2_semiprime.dart new file mode 100644 index 00000000..ae8815d6 --- /dev/null +++ b/session_1/assignments/Solution/program2_semiprime/bin/program2_semiprime.dart @@ -0,0 +1,41 @@ +import 'dart:io'; + +bool is_Prime(int n) { + if (n <= 1) { + return false; + } else { + for (var i = 2; i < n; i++) { + if (n % i == 0) { + return false; + } + } + return true; + } +} + +bool is_Semiprime(int a) { + if (a <= 3) { + return false; + } else { + for (int i = 2; i < a; i++) { + if (a % i == 0) { + double t = a / i; + int f = t.floor(); + if (is_Prime(i) && is_Prime(f)) { + return true; + } + } + } + return false; + } +} + +void main(List args) { + print("Enter a number:"); + int x = int.parse(stdin.readLineSync()!); + if (is_Semiprime(x)) { + print("The number is semiprime"); + } else { + print("The number is not semiprime"); + } +} diff --git a/session_1/assignments/Solution/program2_semiprime/pubspec.lock b/session_1/assignments/Solution/program2_semiprime/pubspec.lock new file mode 100644 index 00000000..50a12baa --- /dev/null +++ b/session_1/assignments/Solution/program2_semiprime/pubspec.lock @@ -0,0 +1,12 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + lints: + dependency: "direct dev" + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" +sdks: + dart: ">=2.15.1 <3.0.0" diff --git a/session_1/assignments/Solution/program2_semiprime/pubspec.yaml b/session_1/assignments/Solution/program2_semiprime/pubspec.yaml new file mode 100644 index 00000000..7fdc53f9 --- /dev/null +++ b/session_1/assignments/Solution/program2_semiprime/pubspec.yaml @@ -0,0 +1,14 @@ +name: program2_semiprime +description: A simple command-line application. +version: 1.0.0 +# homepage: https://www.example.com + +environment: + sdk: '>=2.15.1 <3.0.0' + + +# dependencies: +# path: ^1.8.0 + +dev_dependencies: + lints: ^1.0.0 diff --git a/session_1/assignments/Solution/program3_primearray/.gitignore b/session_1/assignments/Solution/program3_primearray/.gitignore new file mode 100644 index 00000000..3c8a1572 --- /dev/null +++ b/session_1/assignments/Solution/program3_primearray/.gitignore @@ -0,0 +1,6 @@ +# Files and directories created by pub. +.dart_tool/ +.packages + +# Conventional directory for build output. +build/ diff --git a/session_1/assignments/Solution/program3_primearray/.vscode/launch.json b/session_1/assignments/Solution/program3_primearray/.vscode/launch.json new file mode 100644 index 00000000..0030bacc --- /dev/null +++ b/session_1/assignments/Solution/program3_primearray/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "program3_primearray", + "request": "launch", + "type": "dart", + "console": "terminal" + } + ] +} \ No newline at end of file diff --git a/session_1/assignments/Solution/program3_primearray/CHANGELOG.md b/session_1/assignments/Solution/program3_primearray/CHANGELOG.md new file mode 100644 index 00000000..effe43c8 --- /dev/null +++ b/session_1/assignments/Solution/program3_primearray/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/session_1/assignments/Solution/program3_primearray/Outputs/Output 1.png b/session_1/assignments/Solution/program3_primearray/Outputs/Output 1.png new file mode 100644 index 00000000..13b40ca9 Binary files /dev/null and b/session_1/assignments/Solution/program3_primearray/Outputs/Output 1.png differ diff --git a/session_1/assignments/Solution/program3_primearray/Outputs/Output 2.png b/session_1/assignments/Solution/program3_primearray/Outputs/Output 2.png new file mode 100644 index 00000000..32271531 Binary files /dev/null and b/session_1/assignments/Solution/program3_primearray/Outputs/Output 2.png differ diff --git a/session_1/assignments/Solution/program3_primearray/README.md b/session_1/assignments/Solution/program3_primearray/README.md new file mode 100644 index 00000000..a3075394 --- /dev/null +++ b/session_1/assignments/Solution/program3_primearray/README.md @@ -0,0 +1 @@ +A simple command-line application. diff --git a/session_1/assignments/Solution/program3_primearray/analysis_options.yaml b/session_1/assignments/Solution/program3_primearray/analysis_options.yaml new file mode 100644 index 00000000..dee8927a --- /dev/null +++ b/session_1/assignments/Solution/program3_primearray/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/session_1/assignments/Solution/program3_primearray/bin/program3_primearray.dart b/session_1/assignments/Solution/program3_primearray/bin/program3_primearray.dart new file mode 100644 index 00000000..d5bfe183 --- /dev/null +++ b/session_1/assignments/Solution/program3_primearray/bin/program3_primearray.dart @@ -0,0 +1,36 @@ +import 'dart:io'; + +bool is_Prime(num n) { + if (n <= 1) { + return false; + } else { + for (var i = 2; i < n; i++) { + if (n % i == 0) { + return false; + } + } + return true; + } +} + +void main(List args) { + print("Enter the number of elements:"); + int x = int.parse(stdin.readLineSync()!); + var a = List.empty(growable: true); + a.length = x; + print("Enter the array elements:"); + for (var i = 0; i < x; i++) { + a[i] = int.parse(stdin.readLineSync()!); + } + num s = 0; + for (var i = 0; i < x; i++) { + if (is_Prime(a[i])) { + s = s + a[i]; + } + } + if (is_Prime(s)) { + print("The sum of prime elements is $s which is a prime number"); + } else { + print("The sum of prime elements is $s which is not a prime number"); + } +} diff --git a/session_1/assignments/Solution/program3_primearray/pubspec.lock b/session_1/assignments/Solution/program3_primearray/pubspec.lock new file mode 100644 index 00000000..50a12baa --- /dev/null +++ b/session_1/assignments/Solution/program3_primearray/pubspec.lock @@ -0,0 +1,12 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + lints: + dependency: "direct dev" + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" +sdks: + dart: ">=2.15.1 <3.0.0" diff --git a/session_1/assignments/Solution/program3_primearray/pubspec.yaml b/session_1/assignments/Solution/program3_primearray/pubspec.yaml new file mode 100644 index 00000000..b51e3895 --- /dev/null +++ b/session_1/assignments/Solution/program3_primearray/pubspec.yaml @@ -0,0 +1,14 @@ +name: program3_primearray +description: A simple command-line application. +version: 1.0.0 +# homepage: https://www.example.com + +environment: + sdk: '>=2.15.1 <3.0.0' + + +# dependencies: +# path: ^1.8.0 + +dev_dependencies: + lints: ^1.0.0 diff --git a/session_1/assignments/Solution/program4_course_module/.gitignore b/session_1/assignments/Solution/program4_course_module/.gitignore new file mode 100644 index 00000000..3c8a1572 --- /dev/null +++ b/session_1/assignments/Solution/program4_course_module/.gitignore @@ -0,0 +1,6 @@ +# Files and directories created by pub. +.dart_tool/ +.packages + +# Conventional directory for build output. +build/ diff --git a/session_1/assignments/Solution/program4_course_module/.vscode/launch.json b/session_1/assignments/Solution/program4_course_module/.vscode/launch.json new file mode 100644 index 00000000..1b2fc9b8 --- /dev/null +++ b/session_1/assignments/Solution/program4_course_module/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "program4_course_module", + "request": "launch", + "type": "dart", + "console": "terminal" + } + ] +} \ No newline at end of file diff --git a/session_1/assignments/Solution/program4_course_module/CHANGELOG.md b/session_1/assignments/Solution/program4_course_module/CHANGELOG.md new file mode 100644 index 00000000..effe43c8 --- /dev/null +++ b/session_1/assignments/Solution/program4_course_module/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/session_1/assignments/Solution/program4_course_module/Outputs/Output Part 2.png b/session_1/assignments/Solution/program4_course_module/Outputs/Output Part 2.png new file mode 100644 index 00000000..1454ae38 Binary files /dev/null and b/session_1/assignments/Solution/program4_course_module/Outputs/Output Part 2.png differ diff --git a/session_1/assignments/Solution/program4_course_module/Outputs/Output Part 3.png b/session_1/assignments/Solution/program4_course_module/Outputs/Output Part 3.png new file mode 100644 index 00000000..2492cd31 Binary files /dev/null and b/session_1/assignments/Solution/program4_course_module/Outputs/Output Part 3.png differ diff --git a/session_1/assignments/Solution/program4_course_module/Outputs/Output part 1.png b/session_1/assignments/Solution/program4_course_module/Outputs/Output part 1.png new file mode 100644 index 00000000..a50a7583 Binary files /dev/null and b/session_1/assignments/Solution/program4_course_module/Outputs/Output part 1.png differ diff --git a/session_1/assignments/Solution/program4_course_module/README.md b/session_1/assignments/Solution/program4_course_module/README.md new file mode 100644 index 00000000..a3075394 --- /dev/null +++ b/session_1/assignments/Solution/program4_course_module/README.md @@ -0,0 +1 @@ +A simple command-line application. diff --git a/session_1/assignments/Solution/program4_course_module/analysis_options.yaml b/session_1/assignments/Solution/program4_course_module/analysis_options.yaml new file mode 100644 index 00000000..dee8927a --- /dev/null +++ b/session_1/assignments/Solution/program4_course_module/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/session_1/assignments/Solution/program4_course_module/bin/program4_course_module.dart b/session_1/assignments/Solution/program4_course_module/bin/program4_course_module.dart new file mode 100644 index 00000000..0f568031 --- /dev/null +++ b/session_1/assignments/Solution/program4_course_module/bin/program4_course_module.dart @@ -0,0 +1,103 @@ +import 'dart:io'; + +List BEcourseName = []; +List BEcourseCode = []; +List branch = []; +List year = []; +List OEcourseName = []; +List OEcourseCode = []; + +void admin() { + var be = BranchElective(); + var oe = OpenElective(); + String code, name; + while (true) { + print("Enter the course type:\n1.Open Elective\n2.Branch Elective"); + print("Enter 0 to exit"); + int c = int.parse(stdin.readLineSync()!); + if (c == 1) { + print("Enter course code and name:"); + code = stdin.readLineSync() as String; + name = stdin.readLineSync() as String; + oe.createCourse(name, code); + } else if (c == 2) { + print("Enter course code, name, branch and year:"); + code = stdin.readLineSync() as String; + name = stdin.readLineSync() as String; + String br = stdin.readLineSync() as String; + int yr = int.parse(stdin.readLineSync()!); + be.createCourse(name, code, br, yr); + } else if (c == 0) { + break; + } else { + print("Invalid choice"); + } + } +} + +void student() { + var be = BranchElective(); + var oe = OpenElective(); + print("Enter the branch and the year:"); + String br = stdin.readLineSync() as String; + int yr = int.parse(stdin.readLineSync()!); + print("Open electives:"); + print("Code\tName"); + oe.getCourse(); + print("Branch Electives:"); + print("Code\tName"); + be.getCourse(br, yr); +} + +class BranchElective { + void createCourse(String n, String c, String b, int y) { + BEcourseName.add(n); + BEcourseCode.add(c); + branch.add(b); + year.add(y); + } + + void getCourse(String b, int y) { + for (var i = 0; i < branch.length; i++) { + if (b == branch[i] && y == year[i]) { + stdout.write(BEcourseCode[i]); + stdout.write("\t"); + stdout.write(BEcourseName[i]); + stdout.write("\n"); + } + } + } +} + +class OpenElective { + void createCourse(String n, String c) { + OEcourseName.add(n); + OEcourseCode.add(c); + } + + void getCourse() { + for (var i = 0; i < OEcourseCode.length; i++) { + stdout.write(OEcourseCode[i]); + stdout.write("\t"); + stdout.write(OEcourseName[i]); + stdout.write("\n"); + } + } +} + +void main(List args) { + while (true) { + print("Enter the type of user:\n1.Admin\n2.Student"); + print("Enter 0 to exit"); + int ch = int.parse(stdin.readLineSync()!); + if (ch == 1) { + admin(); + } else if (ch == 2) { + student(); + } else if (ch == 0) { + break; + } else { + print("invalid option"); + } + } +} diff --git a/session_1/assignments/Solution/program4_course_module/pubspec.lock b/session_1/assignments/Solution/program4_course_module/pubspec.lock new file mode 100644 index 00000000..50a12baa --- /dev/null +++ b/session_1/assignments/Solution/program4_course_module/pubspec.lock @@ -0,0 +1,12 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + lints: + dependency: "direct dev" + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" +sdks: + dart: ">=2.15.1 <3.0.0" diff --git a/session_1/assignments/Solution/program4_course_module/pubspec.yaml b/session_1/assignments/Solution/program4_course_module/pubspec.yaml new file mode 100644 index 00000000..477b8f2e --- /dev/null +++ b/session_1/assignments/Solution/program4_course_module/pubspec.yaml @@ -0,0 +1,14 @@ +name: program4_course_module +description: A simple command-line application. +version: 1.0.0 +# homepage: https://www.example.com + +environment: + sdk: '>=2.15.1 <3.0.0' + + +# dependencies: +# path: ^1.8.0 + +dev_dependencies: + lints: ^1.0.0 diff --git a/session_3/Assignment 2 Solution/number_fact/.gitignore b/session_3/Assignment 2 Solution/number_fact/.gitignore new file mode 100644 index 00000000..0fa6b675 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/session_3/Assignment 2 Solution/number_fact/.metadata b/session_3/Assignment 2 Solution/number_fact/.metadata new file mode 100644 index 00000000..fd70cabc --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b + channel: stable + +project_type: app diff --git a/session_3/Assignment 2 Solution/number_fact/README.md b/session_3/Assignment 2 Solution/number_fact/README.md new file mode 100644 index 00000000..ea12e853 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/README.md @@ -0,0 +1,9 @@ +# number_fact + +This is a Number Trivia Application + +Version: 1.3.0 + +App Demo (The spotty texture is a consequence of converting to gif...Please ignore): + + diff --git a/session_3/Assignment 2 Solution/number_fact/analysis_options.yaml b/session_3/Assignment 2 Solution/number_fact/analysis_options.yaml new file mode 100644 index 00000000..61b6c4de --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/analysis_options.yaml @@ -0,0 +1,29 @@ +# 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-lang.github.io/linter/lints/index.html. + # + # 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/session_3/Assignment 2 Solution/number_fact/android/.gitignore b/session_3/Assignment 2 Solution/number_fact/android/.gitignore new file mode 100644 index 00000000..6f568019 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/build.gradle b/session_3/Assignment 2 Solution/number_fact/android/app/build.gradle new file mode 100644 index 00000000..8fca6299 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/build.gradle @@ -0,0 +1,68 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion flutter.compileSdkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.number_fact" + minSdkVersion flutter.minSdkVersion + targetSdkVersion 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 '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/debug/AndroidManifest.xml b/session_3/Assignment 2 Solution/number_fact/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..5a6562cc --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/AndroidManifest.xml b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..8f9eeb4f --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/kotlin/com/example/number_fact/MainActivity.kt b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/kotlin/com/example/number_fact/MainActivity.kt new file mode 100644 index 00000000..50534d6f --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/kotlin/com/example/number_fact/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.number_fact + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable-v21/background.png b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable-v21/background.png new file mode 100644 index 00000000..1c9e3ff8 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable-v21/background.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable-v21/launch_background.xml b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..0b99953d --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable/background.png b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable/background.png new file mode 100644 index 00000000..1c9e3ff8 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable/background.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable/launch_background.xml b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..0b99953d --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..a5ee9c93 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..c4577b30 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..98181ee0 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..71313162 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..a922e036 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/values-night/styles.xml b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..3db14bb5 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/values/styles.xml b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..e9294125 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/src/main/res/values/styles.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/session_3/Assignment 2 Solution/number_fact/android/app/src/profile/AndroidManifest.xml b/session_3/Assignment 2 Solution/number_fact/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..5a6562cc --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/session_3/Assignment 2 Solution/number_fact/android/build.gradle b/session_3/Assignment 2 Solution/number_fact/android/build.gradle new file mode 100644 index 00000000..24047dce --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/session_3/Assignment 2 Solution/number_fact/android/gradle.properties b/session_3/Assignment 2 Solution/number_fact/android/gradle.properties new file mode 100644 index 00000000..94adc3a3 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/session_3/Assignment 2 Solution/number_fact/android/gradle/wrapper/gradle-wrapper.properties b/session_3/Assignment 2 Solution/number_fact/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..bc6a58af --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/session_3/Assignment 2 Solution/number_fact/android/settings.gradle b/session_3/Assignment 2 Solution/number_fact/android/settings.gradle new file mode 100644 index 00000000..44e62bcf --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.0.0.gif b/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.0.0.gif new file mode 100644 index 00000000..ead174ae Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.0.0.gif differ diff --git a/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.2.0.gif b/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.2.0.gif new file mode 100644 index 00000000..730e8f06 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.2.0.gif differ diff --git a/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.3.0.gif b/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.3.0.gif new file mode 100644 index 00000000..a1901835 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/assets/App_Demo/App_Demo_v1.3.0.gif differ diff --git a/session_3/Assignment 2 Solution/number_fact/assets/MochiyPopPOne-Regular.ttf b/session_3/Assignment 2 Solution/number_fact/assets/MochiyPopPOne-Regular.ttf new file mode 100644 index 00000000..291cdc25 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/assets/MochiyPopPOne-Regular.ttf differ diff --git a/session_3/Assignment 2 Solution/number_fact/assets/SignikaNegative-Bold.ttf b/session_3/Assignment 2 Solution/number_fact/assets/SignikaNegative-Bold.ttf new file mode 100644 index 00000000..a03b8531 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/assets/SignikaNegative-Bold.ttf differ diff --git a/session_3/Assignment 2 Solution/number_fact/assets/SignikaNegative-Medium.ttf b/session_3/Assignment 2 Solution/number_fact/assets/SignikaNegative-Medium.ttf new file mode 100644 index 00000000..4242229f Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/assets/SignikaNegative-Medium.ttf differ diff --git a/session_3/Assignment 2 Solution/number_fact/assets/Splash.png b/session_3/Assignment 2 Solution/number_fact/assets/Splash.png new file mode 100644 index 00000000..1c9e3ff8 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/assets/Splash.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/.gitignore b/session_3/Assignment 2 Solution/number_fact/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Flutter/AppFrameworkInfo.plist b/session_3/Assignment 2 Solution/number_fact/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..8d4492f9 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/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 + 9.0 + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Flutter/Debug.xcconfig b/session_3/Assignment 2 Solution/number_fact/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Flutter/Release.xcconfig b/session_3/Assignment 2 Solution/number_fact/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.pbxproj b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..4d29b7bd --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 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 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 = ""; }; + 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 */ + 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 */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + 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 */ + 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 = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 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 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 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; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + 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; + 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 */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase 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; + 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; + 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 = 9.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.numberFact; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 9.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; + 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; + 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 = 9.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.numberFact; + 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.numberFact; + 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 */ + 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/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..c87d15a3 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/contents.xcworkspacedata b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/AppDelegate.swift b/session_3/Assignment 2 Solution/number_fact/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..70693e4a --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@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/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 00000000..8d874838 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png new file mode 100644 index 00000000..080035b9 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png new file mode 100644 index 00000000..a54bbd7c Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png new file mode 100644 index 00000000..229e2d91 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png new file mode 100644 index 00000000..9a6ad056 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png new file mode 100644 index 00000000..230bba6f Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png new file mode 100644 index 00000000..f303f590 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png new file mode 100644 index 00000000..35a3d1ff Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png new file mode 100644 index 00000000..e6d9f600 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png new file mode 100644 index 00000000..18128c93 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png new file mode 100644 index 00000000..c3a9c2ca Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..73d3b7f6 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1 @@ +{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"}]} \ No newline at end of file diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/BrandingImage.imageset/Contents.json b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/BrandingImage.imageset/Contents.json new file mode 100644 index 00000000..12712275 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/BrandingImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "BrandingImage.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "BrandingImage@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "BrandingImage@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json new file mode 100644 index 00000000..9f447e1b --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "background.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png new file mode 100644 index 00000000..1c9e3ff8 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..00cabce8 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "LaunchImage.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "LaunchImage@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "LaunchImage@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..67774cf3 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..67774cf3 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..67774cf3 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/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/session_3/Assignment 2 Solution/number_fact/ios/Runner/Base.lproj/LaunchScreen.storyboard b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..c9811f02 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Base.lproj/Main.storyboard b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Info.plist b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Info.plist new file mode 100644 index 00000000..38daed01 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Number Fact + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + number_fact + 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 + + UIViewControllerBasedStatusBarAppearance + + UIStatusBarHidden + + + \ No newline at end of file diff --git a/session_3/Assignment 2 Solution/number_fact/ios/Runner/Runner-Bridging-Header.h b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/session_3/Assignment 2 Solution/number_fact/lib/main.dart b/session_3/Assignment 2 Solution/number_fact/lib/main.dart new file mode 100644 index 00000000..6a58f2b9 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/lib/main.dart @@ -0,0 +1,171 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Number Fact', + theme: ThemeData( + primarySwatch: Colors.blue, + scaffoldBackgroundColor: Colors.indigo, + ), + home: const HomePage(), + ); + } +} + +class HomePage extends StatefulWidget { + const HomePage({Key? key}) : super(key: key); + + @override + _HomePageState createState() => _HomePageState(); +} + +class _HomePageState extends State { + final n = TextEditingController(); + String fact = ""; + bool f = false; + var clist = [ + 'Math', + 'Trivia', + 'Year', + ]; + String v = "Trivia"; + void get() async { + String num = n.text; + if (num == "") { + num = "random"; + } + String uri = + "http://numbersapi.com/" + num + "/" + v.toLowerCase() + "?json"; + try { + final request = + await http.get(Uri.parse(uri)).timeout(const Duration(seconds: 10)); + final data = jsonDecode(request.body); + f = true; + setState(() { + fact = data["text"]; + }); + } on TimeoutException { + setState(() { + fact = "We are not able to fetch a fact....Looks like you are offline"; + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("Number Fact"), + centerTitle: true, + titleTextStyle: const TextStyle( + fontFamily: "Signika", + fontSize: 30.0, + fontWeight: FontWeight.w700), + ), + body: Center( + child: SingleChildScrollView( + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 40.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const SizedBox( + height: 30.0, + ), + const Text( + "Enter a Number", + style: TextStyle( + fontFamily: "Mochiy Pop", + fontSize: 30.0, + color: Colors.white), + ), + TextField( + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + controller: n, + style: const TextStyle( + fontFamily: "Mochiy Pop", + color: Colors.white, + fontSize: 40.0), + ), + const SizedBox( + height: 30.0, + ), + const Text( + "Pick a Category", + style: TextStyle( + fontFamily: "Mochiy Pop", + fontSize: 30.0, + color: Colors.white), + ), + const SizedBox(height: 10.0), + DropdownButton( + value: v, + icon: const Icon( + Icons.keyboard_arrow_down, + color: Colors.white, + ), + dropdownColor: Colors.blue[900], + style: const TextStyle( + color: Colors.white, + fontFamily: "Mochiy Pop", + fontSize: 30.0), + items: clist.map((String list) { + return DropdownMenuItem( + value: list, + child: Text(list), + ); + }).toList(), + onChanged: (String? newValue) { + setState(() { + v = newValue!; + }); + }), + const SizedBox( + height: 40.0, + ), + OutlinedButton( + onPressed: () { + get(); + }, + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + overlayColor: + MaterialStateProperty.all(Colors.blue[700])), + child: const Text( + "Get Fact", + style: TextStyle( + color: Colors.white, + fontSize: 20.0, + fontFamily: "Signika"), + )), + const SizedBox( + height: 30.0, + ), + Text( + f ? fact : "", + style: const TextStyle( + fontFamily: "Mochiy Pop", + fontSize: 30.0, + color: Colors.white), + textAlign: TextAlign.center, + ) + ], + ), + ), + ))); + } +} diff --git a/session_3/Assignment 2 Solution/number_fact/linux/.gitignore b/session_3/Assignment 2 Solution/number_fact/linux/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/session_3/Assignment 2 Solution/number_fact/linux/CMakeLists.txt b/session_3/Assignment 2 Solution/number_fact/linux/CMakeLists.txt new file mode 100644 index 00000000..54ec6fc8 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/linux/CMakeLists.txt @@ -0,0 +1,116 @@ +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +set(BINARY_NAME "number_fact") +set(APPLICATION_ID "com.example.number_fact") + +cmake_policy(SET CMP0063 NEW) + +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() + +# Configure build 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. +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() + +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + +# Flutter library and tool build rules. +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}") + +# Application build +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) +apply_standard_settings(${BINARY_NAME}) +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +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) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# 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/session_3/Assignment 2 Solution/number_fact/linux/flutter/CMakeLists.txt b/session_3/Assignment 2 Solution/number_fact/linux/flutter/CMakeLists.txt new file mode 100644 index 00000000..33fd5801 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/linux/flutter/CMakeLists.txt @@ -0,0 +1,87 @@ +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/session_3/Assignment 2 Solution/number_fact/linux/flutter/generated_plugin_registrant.cc b/session_3/Assignment 2 Solution/number_fact/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..e71a16d2 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/session_3/Assignment 2 Solution/number_fact/linux/flutter/generated_plugin_registrant.h b/session_3/Assignment 2 Solution/number_fact/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/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/session_3/Assignment 2 Solution/number_fact/linux/flutter/generated_plugins.cmake b/session_3/Assignment 2 Solution/number_fact/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..51436ae8 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/linux/flutter/generated_plugins.cmake @@ -0,0 +1,15 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_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) diff --git a/session_3/Assignment 2 Solution/number_fact/linux/main.cc b/session_3/Assignment 2 Solution/number_fact/linux/main.cc new file mode 100644 index 00000000..e7c5c543 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/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/session_3/Assignment 2 Solution/number_fact/linux/my_application.cc b/session_3/Assignment 2 Solution/number_fact/linux/my_application.cc new file mode 100644 index 00000000..7c366ed0 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/linux/my_application.cc @@ -0,0 +1,104 @@ +#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, "number_fact"); + 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, "number_fact"); + } + + 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 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_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/session_3/Assignment 2 Solution/number_fact/linux/my_application.h b/session_3/Assignment 2 Solution/number_fact/linux/my_application.h new file mode 100644 index 00000000..72271d5e --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/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/session_3/Assignment 2 Solution/number_fact/pubspec.yaml b/session_3/Assignment 2 Solution/number_fact/pubspec.yaml new file mode 100644 index 00000000..b467fc4f --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/pubspec.yaml @@ -0,0 +1,90 @@ +name: number_fact +description: A number trivia application. + +# 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 used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.3.0 + +environment: + sdk: ">=2.15.1 <3.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 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + http: ^0.13.4 + +dev_dependencies: + flutter_test: + sdk: flutter + + # 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: ^1.0.0 + flutter_native_splash: ^1.3.3 + +# 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. +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: + # - images/a_dot_burr.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: Mochiy Pop + fonts: + - asset: assets/MochiyPopPOne-Regular.ttf + - family: Signika + fonts: + - asset: assets/SignikaNegative-Medium.ttf + weight: 500 + - asset: assets/SignikaNegative-Bold.ttf + weight: 700 + +flutter_native_splash: + background_image: "assets/Splash.png" diff --git a/session_3/Assignment 2 Solution/number_fact/test/widget_test.dart b/session_3/Assignment 2 Solution/number_fact/test/widget_test.dart new file mode 100644 index 00000000..82ffd834 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/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 that Flutter provides. 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:number_fact/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/session_3/Assignment 2 Solution/number_fact/web/favicon.png b/session_3/Assignment 2 Solution/number_fact/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/web/favicon.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-192.png b/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-192.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-512.png b/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-512.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-maskable-192.png b/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-maskable-192.png new file mode 100644 index 00000000..eb9b4d76 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-maskable-192.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-maskable-512.png b/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-maskable-512.png new file mode 100644 index 00000000..d69c5669 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/web/icons/Icon-maskable-512.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/web/index.html b/session_3/Assignment 2 Solution/number_fact/web/index.html new file mode 100644 index 00000000..a62f680a --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/web/index.html @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + number_fact + + + + + + + + \ No newline at end of file diff --git a/session_3/Assignment 2 Solution/number_fact/web/manifest.json b/session_3/Assignment 2 Solution/number_fact/web/manifest.json new file mode 100644 index 00000000..d7311c3b --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "number_fact", + "short_name": "number_fact", + "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/session_3/Assignment 2 Solution/number_fact/web/splash/img/light-background.png b/session_3/Assignment 2 Solution/number_fact/web/splash/img/light-background.png new file mode 100644 index 00000000..1c9e3ff8 Binary files /dev/null and b/session_3/Assignment 2 Solution/number_fact/web/splash/img/light-background.png differ diff --git a/session_3/Assignment 2 Solution/number_fact/web/splash/style.css b/session_3/Assignment 2 Solution/number_fact/web/splash/style.css new file mode 100644 index 00000000..eb3736c0 --- /dev/null +++ b/session_3/Assignment 2 Solution/number_fact/web/splash/style.css @@ -0,0 +1,43 @@ +body, html { + margin:0; + height:100%; + background: #000000; + background-image: url("img/light-background.png"); + background-size: 100% 100%; +} + +.center { + margin: 0; + position: absolute; + top: 50%; + left: 50%; + -ms-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} + +.contain { + display:block; + width:100%; height:100%; + object-fit: contain; +} + +.stretch { + display:block; + width:100%; height:100%; +} + +.cover { + display:block; + width:100%; height:100%; + object-fit: cover; +} + +@media (prefers-color-scheme: dark) { + body { + margin:0; + height:100%; + background: #000000; + background-image: url("img/dark-background.png"); + background-size: 100% 100%; + } +} diff --git a/session_5/moviez/.gitignore b/session_5/moviez/.gitignore new file mode 100644 index 00000000..0fa6b675 --- /dev/null +++ b/session_5/moviez/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/session_5/moviez/.metadata b/session_5/moviez/.metadata new file mode 100644 index 00000000..fd70cabc --- /dev/null +++ b/session_5/moviez/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b + channel: stable + +project_type: app diff --git a/session_5/moviez/README.md b/session_5/moviez/README.md new file mode 100644 index 00000000..a11bd5b9 --- /dev/null +++ b/session_5/moviez/README.md @@ -0,0 +1,16 @@ +# moviez + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/session_5/moviez/analysis_options.yaml b/session_5/moviez/analysis_options.yaml new file mode 100644 index 00000000..61b6c4de --- /dev/null +++ b/session_5/moviez/analysis_options.yaml @@ -0,0 +1,29 @@ +# 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-lang.github.io/linter/lints/index.html. + # + # 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/session_5/moviez/android/.gitignore b/session_5/moviez/android/.gitignore new file mode 100644 index 00000000..6f568019 --- /dev/null +++ b/session_5/moviez/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/session_5/moviez/android/app/build.gradle b/session_5/moviez/android/app/build.gradle new file mode 100644 index 00000000..ac52413b --- /dev/null +++ b/session_5/moviez/android/app/build.gradle @@ -0,0 +1,68 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion flutter.compileSdkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.moviez" + minSdkVersion flutter.minSdkVersion + targetSdkVersion 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 '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/session_5/moviez/android/app/src/debug/AndroidManifest.xml b/session_5/moviez/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..202009a3 --- /dev/null +++ b/session_5/moviez/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/session_5/moviez/android/app/src/main/AndroidManifest.xml b/session_5/moviez/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..85c0600b --- /dev/null +++ b/session_5/moviez/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/session_5/moviez/android/app/src/main/kotlin/com/example/moviez/MainActivity.kt b/session_5/moviez/android/app/src/main/kotlin/com/example/moviez/MainActivity.kt new file mode 100644 index 00000000..5f8273fd --- /dev/null +++ b/session_5/moviez/android/app/src/main/kotlin/com/example/moviez/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.moviez + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/session_5/moviez/android/app/src/main/res/drawable-v21/launch_background.xml b/session_5/moviez/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/session_5/moviez/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/session_5/moviez/android/app/src/main/res/drawable/launch_background.xml b/session_5/moviez/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/session_5/moviez/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/session_5/moviez/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/session_5/moviez/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/session_5/moviez/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/session_5/moviez/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/session_5/moviez/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/session_5/moviez/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/session_5/moviez/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/session_5/moviez/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/session_5/moviez/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/session_5/moviez/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/session_5/moviez/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/session_5/moviez/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/session_5/moviez/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/session_5/moviez/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/session_5/moviez/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/session_5/moviez/android/app/src/main/res/values-night/styles.xml b/session_5/moviez/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..3db14bb5 --- /dev/null +++ b/session_5/moviez/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/session_5/moviez/android/app/src/main/res/values/styles.xml b/session_5/moviez/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..d460d1e9 --- /dev/null +++ b/session_5/moviez/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/session_5/moviez/android/app/src/profile/AndroidManifest.xml b/session_5/moviez/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..202009a3 --- /dev/null +++ b/session_5/moviez/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/session_5/moviez/android/build.gradle b/session_5/moviez/android/build.gradle new file mode 100644 index 00000000..24047dce --- /dev/null +++ b/session_5/moviez/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/session_5/moviez/android/gradle.properties b/session_5/moviez/android/gradle.properties new file mode 100644 index 00000000..94adc3a3 --- /dev/null +++ b/session_5/moviez/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/session_5/moviez/android/gradle/wrapper/gradle-wrapper.properties b/session_5/moviez/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..bc6a58af --- /dev/null +++ b/session_5/moviez/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/session_5/moviez/android/settings.gradle b/session_5/moviez/android/settings.gradle new file mode 100644 index 00000000..44e62bcf --- /dev/null +++ b/session_5/moviez/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/session_5/moviez/ios/.gitignore b/session_5/moviez/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/session_5/moviez/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/session_5/moviez/ios/Flutter/AppFrameworkInfo.plist b/session_5/moviez/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..8d4492f9 --- /dev/null +++ b/session_5/moviez/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 + 9.0 + + diff --git a/session_5/moviez/ios/Flutter/Debug.xcconfig b/session_5/moviez/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/session_5/moviez/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/session_5/moviez/ios/Flutter/Release.xcconfig b/session_5/moviez/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/session_5/moviez/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/session_5/moviez/ios/Runner.xcodeproj/project.pbxproj b/session_5/moviez/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..e2b607cf --- /dev/null +++ b/session_5/moviez/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 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 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 = ""; }; + 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 */ + 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 */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + 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 */ + 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 = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 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 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 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; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + 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; + 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 */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase 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; + 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; + 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 = 9.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.moviez; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 9.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; + 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; + 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 = 9.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.moviez; + 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.moviez; + 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 */ + 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/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/session_5/moviez/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/session_5/moviez/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/session_5/moviez/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..c87d15a3 --- /dev/null +++ b/session_5/moviez/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/session_5/moviez/ios/Runner.xcworkspace/contents.xcworkspacedata b/session_5/moviez/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/session_5/moviez/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/session_5/moviez/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/session_5/moviez/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/session_5/moviez/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/session_5/moviez/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/session_5/moviez/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/session_5/moviez/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/session_5/moviez/ios/Runner/AppDelegate.swift b/session_5/moviez/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..70693e4a --- /dev/null +++ b/session_5/moviez/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@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/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "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" : "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" : "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" + } +} diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..28c6bf03 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..f091b6b0 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cde1211 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..d0ef06e7 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..dcdc2306 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..c8f9ed8f Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..75b2d164 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..c4df70d3 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..6a84f41e Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..d0e1f585 Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/session_5/moviez/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/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/session_5/moviez/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/session_5/moviez/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/session_5/moviez/ios/Runner/Base.lproj/LaunchScreen.storyboard b/session_5/moviez/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/session_5/moviez/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/session_5/moviez/ios/Runner/Base.lproj/Main.storyboard b/session_5/moviez/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/session_5/moviez/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/session_5/moviez/ios/Runner/Info.plist b/session_5/moviez/ios/Runner/Info.plist new file mode 100644 index 00000000..79b9e3ef --- /dev/null +++ b/session_5/moviez/ios/Runner/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Moviez + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + moviez + 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 + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/session_5/moviez/ios/Runner/Runner-Bridging-Header.h b/session_5/moviez/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/session_5/moviez/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/session_5/moviez/lib/Models/Movie.dart b/session_5/moviez/lib/Models/Movie.dart new file mode 100644 index 00000000..71db6c5a --- /dev/null +++ b/session_5/moviez/lib/Models/Movie.dart @@ -0,0 +1,23 @@ +import 'package:hive/hive.dart'; + +part 'Movie.g.dart'; + +@HiveType(typeId: 0) +class Movies { + @HiveField(0) + String title; + @HiveField(1) + String imdb; + @HiveField(2) + String year; + @HiveField(3) + String image; + @HiveField(4) + String movieId; + Movies( + {required this.title, + required this.imdb, + required this.year, + required this.image, + required this.movieId}); +} diff --git a/session_5/moviez/lib/Models/Movie.g.dart b/session_5/moviez/lib/Models/Movie.g.dart new file mode 100644 index 00000000..6d985931 --- /dev/null +++ b/session_5/moviez/lib/Models/Movie.g.dart @@ -0,0 +1,53 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'Movie.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class MoviesAdapter extends TypeAdapter { + @override + final int typeId = 0; + + @override + Movies read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Movies( + title: fields[0] as String, + imdb: fields[1] as String, + year: fields[2] as String, + image: fields[3] as String, + movieId: fields[4] as String, + ); + } + + @override + void write(BinaryWriter writer, Movies obj) { + writer + ..writeByte(5) + ..writeByte(0) + ..write(obj.title) + ..writeByte(1) + ..write(obj.imdb) + ..writeByte(2) + ..write(obj.year) + ..writeByte(3) + ..write(obj.image) + ..writeByte(4) + ..write(obj.movieId); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MoviesAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/session_5/moviez/lib/Models/TVShow.dart b/session_5/moviez/lib/Models/TVShow.dart new file mode 100644 index 00000000..80b56408 --- /dev/null +++ b/session_5/moviez/lib/Models/TVShow.dart @@ -0,0 +1,23 @@ +import 'package:hive/hive.dart'; + +part 'TVShow.g.dart'; + +@HiveType(typeId: 1) +class TVShows { + @HiveField(0) + String title; + @HiveField(1) + String imdb; + @HiveField(2) + String year; + @HiveField(3) + String image; + @HiveField(4) + String showId; + TVShows( + {required this.title, + required this.imdb, + required this.year, + required this.image, + required this.showId}); +} diff --git a/session_5/moviez/lib/Models/TVShow.g.dart b/session_5/moviez/lib/Models/TVShow.g.dart new file mode 100644 index 00000000..0c15ccc6 --- /dev/null +++ b/session_5/moviez/lib/Models/TVShow.g.dart @@ -0,0 +1,53 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'TVShow.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class TVShowsAdapter extends TypeAdapter { + @override + final int typeId = 1; + + @override + TVShows read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return TVShows( + title: fields[0] as String, + imdb: fields[1] as String, + year: fields[2] as String, + image: fields[3] as String, + showId: fields[4] as String, + ); + } + + @override + void write(BinaryWriter writer, TVShows obj) { + writer + ..writeByte(5) + ..writeByte(0) + ..write(obj.title) + ..writeByte(1) + ..write(obj.imdb) + ..writeByte(2) + ..write(obj.year) + ..writeByte(3) + ..write(obj.image) + ..writeByte(4) + ..write(obj.showId); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TVShowsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/session_5/moviez/lib/Screens/MoviePage.dart b/session_5/moviez/lib/Screens/MoviePage.dart new file mode 100644 index 00000000..80a6d716 --- /dev/null +++ b/session_5/moviez/lib/Screens/MoviePage.dart @@ -0,0 +1,144 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:hive/hive.dart'; +import 'package:moviez/Models/Movie.dart'; +import 'package:moviez/Screens/SearchPage.dart'; +import 'package:moviez/Screens/TVPage.dart'; +import 'package:moviez/Widgets/MovieCard.dart'; +import 'package:http/http.dart' as http; + +class MoviePage extends StatefulWidget { + const MoviePage({Key? key}) : super(key: key); + + @override + _MoviePageState createState() => _MoviePageState(); +} + +class _MoviePageState extends State { + bool search = false; + + Future? future; + + Future? getMovies() async { + var box = Hive.box('Movies'); + try { + final response = await http.get( + Uri.parse("https://imdb-api.com/en/API/Top250Movies/k_xh9z4xcu"), + ); + final body = jsonDecode(response.body); + final List moviesbody = body["items"]; + List movies = []; + for (var e in moviesbody) { + movies.add( + Movies( + title: e["title"], + imdb: e["imDbRating"], + year: e["year"], + image: e["image"], + movieId: e['id'], + ), + ); + } + var test = await box.put('MoviesList', movies); + return movies; + } catch (e) { + List lmovies = + box.get('MoviesList', defaultValue: []).cast(); + return lmovies; + } + } + + @override + void initState() { + super.initState(); + future = getMovies(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: search + ? TextField( + style: const TextStyle( + color: Colors.white, + fontSize: 25.0, + fontWeight: FontWeight.bold), + onSubmitted: (value) { + if (value.isNotEmpty) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) { + return SearchPage(title: value); + }, + ), + ); + } + }, + ) + : const Text("Movies App"), + centerTitle: true, + actions: [ + IconButton( + onPressed: () { + search = !search; + setState(() {}); + }, + icon: search ? const Icon(Icons.close) : const Icon(Icons.search), + ), + ], + ), + body: RefreshIndicator( + onRefresh: () async { + setState(() { + getMovies(); + }); + }, + child: Container( + padding: const EdgeInsets.all(10), + child: FutureBuilder( + future: future, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return const Center( + child: Text("Some error occurred. Please try again"), + ); + } else if (snapshot.hasData) { + final movies = snapshot.data; + return ListView.builder( + itemCount: movies.length, + itemBuilder: (context, i) => MovieCard( + movie: movies[i], + ), + ); + } else { + return const Center( + child: Text("No movies found"), + ); + } + } + return const Center(child: CircularProgressIndicator()); + }, + ), + ), + ), + bottomNavigationBar: BottomNavigationBar( + currentIndex: 0, + items: const [ + BottomNavigationBarItem(icon: Icon(Icons.movie), label: "Movies"), + BottomNavigationBarItem(icon: Icon(Icons.live_tv), label: "TV Shows") + ], + onTap: (index) { + if (index == 1) { + Navigator.push(context, MaterialPageRoute(builder: (context) { + return const TVPage(); + })); + } + }, + ), + ); + } +} diff --git a/session_5/moviez/lib/Screens/SearchPage.dart b/session_5/moviez/lib/Screens/SearchPage.dart new file mode 100644 index 00000000..935d2bb2 --- /dev/null +++ b/session_5/moviez/lib/Screens/SearchPage.dart @@ -0,0 +1,77 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:moviez/Models/Movie.dart'; +import 'package:moviez/Widgets/MovieCard.dart'; + +class SearchPage extends StatefulWidget { + final String title; + const SearchPage({Key? key, required this.title}) : super(key: key); + + @override + _SearchPageState createState() => _SearchPageState(); +} + +class _SearchPageState extends State { + Future? searchMovie() async { + final response = await http.get( + Uri.parse( + "https://imdb-api.com/en/API/SearchMovie/k_xh9z4xcu/${widget.title}"), + ); + final body = jsonDecode(response.body); + return body["results"]; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("Search Movies"), + centerTitle: true, + ), + body: FutureBuilder( + future: searchMovie(), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return const Center( + child: Text("Some error occurred. Please try again", + style: TextStyle( + color: Colors.grey, + fontSize: 30.0, + fontWeight: FontWeight.bold)), + ); + } else if (snapshot.hasData) { + final movies = snapshot.data as List; + if (movies != null) { + return ListView.builder( + itemCount: movies.length, + itemBuilder: (context, i) => MovieCard( + movie: Movies( + title: movies[i]["title"], + imdb: '', + year: '', + image: movies[i]["image"], + movieId: movies[i]["id"], + ), + ), + ); + } + } else { + return const Center( + child: Text("No movies found", + style: TextStyle( + color: Colors.grey, + fontSize: 30.0, + fontWeight: FontWeight.bold)), + ); + } + } + + return const Center(child: CircularProgressIndicator()); + }, + ), + ); + } +} diff --git a/session_5/moviez/lib/Screens/TVPage.dart b/session_5/moviez/lib/Screens/TVPage.dart new file mode 100644 index 00000000..769fe864 --- /dev/null +++ b/session_5/moviez/lib/Screens/TVPage.dart @@ -0,0 +1,141 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:hive/hive.dart'; +import 'package:moviez/Models/TVShow.dart'; +import 'package:moviez/Screens/SearchPage.dart'; +import 'package:moviez/Widgets/TVCard.dart'; +import 'package:http/http.dart' as http; + +class TVPage extends StatefulWidget { + const TVPage({Key? key}) : super(key: key); + + @override + _TVPageState createState() => _TVPageState(); +} + +class _TVPageState extends State { + bool search = false; + + Future? future; + + Future? getShows() async { + var box = Hive.box('TVShows'); + try { + final response = await http.get( + Uri.parse("https://imdb-api.com/en/API/Top250TVs/k_xh9z4xcu"), + ); + final body = jsonDecode(response.body); + final List TVsbody = body["items"]; + List movies = []; + for (var e in TVsbody) { + movies.add( + TVShows( + title: e["title"], + imdb: e["imDbRating"], + year: e["year"], + image: e["image"], + showId: e['id'], + ), + ); + } + var test = await box.put('ShowsList', movies); + return movies; + } catch (e) { + List lmovies = + box.get('ShowsList', defaultValue: []).cast(); + return lmovies; + } + } + + @override + void initState() { + super.initState(); + future = getShows(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: search + ? TextField( + style: const TextStyle( + color: Colors.white, + fontSize: 25.0, + fontWeight: FontWeight.bold), + onSubmitted: (value) { + if (value.isNotEmpty) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) { + return SearchPage(title: value); + }, + ), + ); + } + }, + ) + : const Text("TV Shows"), + centerTitle: true, + actions: [ + IconButton( + onPressed: () { + search = !search; + setState(() {}); + }, + icon: search ? const Icon(Icons.close) : const Icon(Icons.search), + ), + ], + ), + body: RefreshIndicator( + onRefresh: () async { + setState(() { + getShows(); + }); + }, + child: Container( + padding: const EdgeInsets.all(10), + child: FutureBuilder( + future: future, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return const Center( + child: Text("Some error occurred. Please try again"), + ); + } else if (snapshot.hasData) { + final shows = snapshot.data; + return ListView.builder( + itemCount: shows.length, + itemBuilder: (context, i) => TVCard( + show: shows[i], + ), + ); + } else { + return const Center( + child: Text("No TV shows found"), + ); + } + } + return const Center(child: CircularProgressIndicator()); + }, + ), + ), + ), + bottomNavigationBar: BottomNavigationBar( + currentIndex: 1, + items: const [ + BottomNavigationBarItem(icon: Icon(Icons.movie), label: "Movies"), + BottomNavigationBarItem(icon: Icon(Icons.live_tv), label: "TV Shows") + ], + onTap: (index) { + if (index == 0) { + Navigator.pop(context); + } + }, + ), + ); + } +} diff --git a/session_5/moviez/lib/Widgets/MovieCard.dart b/session_5/moviez/lib/Widgets/MovieCard.dart new file mode 100644 index 00000000..6db92e3f --- /dev/null +++ b/session_5/moviez/lib/Widgets/MovieCard.dart @@ -0,0 +1,97 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:moviez/Models/Movie.dart'; +import 'package:moviez/Screens/MovieDetail.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class MovieCard extends StatelessWidget { + final Movies movie; + const MovieCard({ + Key? key, + required this.movie, + }) : super(key: key); + + void launchUrl(String url) async { + if (!await launch(url)) throw "Could not launch $url"; + } + + void viewTrailer(id) async { + final url = "https://imdb-api.com/en/API/Trailer/k_xh9z4xcu/" + id; + final response = await http.get( + Uri.parse(url), + ); + final trailerData = jsonDecode(response.body); + launchUrl(trailerData["link"]); + } + + void viewWikipediaPage(id) async { + final url = "https://imdb-api.com/en/API/Wikipedia/k_xh9z4xcu/" + id; + final response = await http.get( + Uri.parse(url), + ); + final wikiData = jsonDecode(response.body); + launchUrl(wikiData["url"]); + } + + @override + Widget build(BuildContext context) { + return SizedBox( + width: double.infinity, + child: Card( + child: ExpansionTile( + leading: Image.network( + movie.image, + errorBuilder: (context, error, stackTrace) => + const Icon(Icons.error), + ), + title: Text( + movie.title, + ), + subtitle: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + movie.imdb != '' + ? Text( + "IMdB Rating: ${movie.imdb}", + ) + : Container(), + movie.year != '' + ? Text( + "Year: ${movie.year}", + ) + : Container(), + ], + ), + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + onPressed: () { + viewTrailer(movie.movieId); + }, + icon: const Icon(Icons.play_arrow), + ), + IconButton( + onPressed: () { + viewWikipediaPage(movie.movieId); + }, + icon: const Icon(Icons.web), + ), + /*IconButton( + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return MovieDetail(movie: movie); + })); + }, + icon: const Icon(Icons.info_outline))*/ + ], + ), + ], + ), + ), + ); + } +} diff --git a/session_5/moviez/lib/Widgets/TVCard.dart b/session_5/moviez/lib/Widgets/TVCard.dart new file mode 100644 index 00000000..78fa4274 --- /dev/null +++ b/session_5/moviez/lib/Widgets/TVCard.dart @@ -0,0 +1,96 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:moviez/Models/TVShow.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class TVCard extends StatelessWidget { + final TVShows show; + const TVCard({ + Key? key, + required this.show, + }) : super(key: key); + + void launchUrl(String url) async { + if (!await launch(url)) throw "Could not launch $url"; + } + + void viewTrailer(id) async { + final url = "https://imdb-api.com/en/API/Trailer/k_xh9z4xcu/" + id; + final response = await http.get( + Uri.parse(url), + ); + final trailerData = jsonDecode(response.body); + launchUrl(trailerData["link"]); + } + + void viewWikipediaPage(id) async { + final url = "https://imdb-api.com/en/API/Wikipedia/k_xh9z4xcu/" + id; + final response = await http.get( + Uri.parse(url), + ); + final wikiData = jsonDecode(response.body); + launchUrl(wikiData["url"]); + } + + @override + Widget build(BuildContext context) { + return SizedBox( + width: double.infinity, + child: Card( + child: ExpansionTile( + leading: Image.network( + show.image, + errorBuilder: (context, error, stackTrace) => + const Icon(Icons.error), + ), + title: Text( + show.title, + ), + subtitle: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + show.imdb != '' + ? Text( + "IMdB Rating: ${show.imdb}", + ) + : Container(), + show.year != '' + ? Text( + "Year: ${show.year}", + ) + : Container(), + ], + ), + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + onPressed: () { + viewTrailer(show.showId); + }, + icon: const Icon(Icons.play_arrow), + ), + IconButton( + onPressed: () { + viewWikipediaPage(show.showId); + }, + icon: const Icon(Icons.web), + ), + /*IconButton( + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return MovieDetail(movie: movie); + })); + }, + icon: const Icon(Icons.info_outline))*/ + ], + ), + ], + ), + ), + ); + } +} diff --git a/session_5/moviez/lib/main.dart b/session_5/moviez/lib/main.dart new file mode 100644 index 00000000..4e471fe1 --- /dev/null +++ b/session_5/moviez/lib/main.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:moviez/Models/TVShow.dart'; +import 'package:moviez/Screens/MoviePage.dart'; +import 'package:hive_flutter/hive_flutter.dart'; +import 'package:moviez/Models/Movie.dart'; + +void main() async { + await Hive.initFlutter(); + Hive.registerAdapter(MoviesAdapter()); + Hive.registerAdapter(TVShowsAdapter()); + var box1 = await Hive.openBox('Movies'); + var box2 = await Hive.openBox('TVShows'); + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Moviez', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: const MoviePage(), + ); + } +} diff --git a/session_5/moviez/linux/.gitignore b/session_5/moviez/linux/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/session_5/moviez/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/session_5/moviez/linux/CMakeLists.txt b/session_5/moviez/linux/CMakeLists.txt new file mode 100644 index 00000000..73650da8 --- /dev/null +++ b/session_5/moviez/linux/CMakeLists.txt @@ -0,0 +1,116 @@ +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +set(BINARY_NAME "moviez") +set(APPLICATION_ID "com.example.moviez") + +cmake_policy(SET CMP0063 NEW) + +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() + +# Configure build 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. +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() + +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + +# Flutter library and tool build rules. +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}") + +# Application build +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) +apply_standard_settings(${BINARY_NAME}) +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +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) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# 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/session_5/moviez/linux/flutter/CMakeLists.txt b/session_5/moviez/linux/flutter/CMakeLists.txt new file mode 100644 index 00000000..33fd5801 --- /dev/null +++ b/session_5/moviez/linux/flutter/CMakeLists.txt @@ -0,0 +1,87 @@ +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/session_5/moviez/linux/flutter/generated_plugin_registrant.cc b/session_5/moviez/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..f6f23bfe --- /dev/null +++ b/session_5/moviez/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); +} diff --git a/session_5/moviez/linux/flutter/generated_plugin_registrant.h b/session_5/moviez/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/session_5/moviez/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/session_5/moviez/linux/flutter/generated_plugins.cmake b/session_5/moviez/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..1fc8ed34 --- /dev/null +++ b/session_5/moviez/linux/flutter/generated_plugins.cmake @@ -0,0 +1,16 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_linux +) + +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) diff --git a/session_5/moviez/linux/main.cc b/session_5/moviez/linux/main.cc new file mode 100644 index 00000000..e7c5c543 --- /dev/null +++ b/session_5/moviez/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/session_5/moviez/linux/my_application.cc b/session_5/moviez/linux/my_application.cc new file mode 100644 index 00000000..e7d27171 --- /dev/null +++ b/session_5/moviez/linux/my_application.cc @@ -0,0 +1,104 @@ +#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, "moviez"); + 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, "moviez"); + } + + 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 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_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/session_5/moviez/linux/my_application.h b/session_5/moviez/linux/my_application.h new file mode 100644 index 00000000..72271d5e --- /dev/null +++ b/session_5/moviez/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/session_5/moviez/pubspec.yaml b/session_5/moviez/pubspec.yaml new file mode 100644 index 00000000..c2c6b46e --- /dev/null +++ b/session_5/moviez/pubspec.yaml @@ -0,0 +1,95 @@ +name: moviez +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 used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.15.1 <3.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 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + http: ^0.13.4 + url_launcher: ^6.0.17 + hive: ^2.0.5 + hive_flutter: ^1.1.0 + +dev_dependencies: + flutter_test: + sdk: flutter + + # 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: ^1.0.0 + build_runner: ^2.1.7 + hive_generator: ^1.1.2 + +# 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. +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: + # - images/a_dot_burr.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/session_5/moviez/test/widget_test.dart b/session_5/moviez/test/widget_test.dart new file mode 100644 index 00000000..3e1d7247 --- /dev/null +++ b/session_5/moviez/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 that Flutter provides. 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:moviez/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/session_5/moviez/web/favicon.png b/session_5/moviez/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/session_5/moviez/web/favicon.png differ diff --git a/session_5/moviez/web/icons/Icon-192.png b/session_5/moviez/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/session_5/moviez/web/icons/Icon-192.png differ diff --git a/session_5/moviez/web/icons/Icon-512.png b/session_5/moviez/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/session_5/moviez/web/icons/Icon-512.png differ diff --git a/session_5/moviez/web/icons/Icon-maskable-192.png b/session_5/moviez/web/icons/Icon-maskable-192.png new file mode 100644 index 00000000..eb9b4d76 Binary files /dev/null and b/session_5/moviez/web/icons/Icon-maskable-192.png differ diff --git a/session_5/moviez/web/icons/Icon-maskable-512.png b/session_5/moviez/web/icons/Icon-maskable-512.png new file mode 100644 index 00000000..d69c5669 Binary files /dev/null and b/session_5/moviez/web/icons/Icon-maskable-512.png differ diff --git a/session_5/moviez/web/index.html b/session_5/moviez/web/index.html new file mode 100644 index 00000000..c1ece745 --- /dev/null +++ b/session_5/moviez/web/index.html @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + moviez + + + + + + + diff --git a/session_5/moviez/web/manifest.json b/session_5/moviez/web/manifest.json new file mode 100644 index 00000000..db6c610b --- /dev/null +++ b/session_5/moviez/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "moviez", + "short_name": "moviez", + "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/session_5/remind_me/.gitignore b/session_5/remind_me/.gitignore new file mode 100644 index 00000000..0fa6b675 --- /dev/null +++ b/session_5/remind_me/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/session_5/remind_me/.metadata b/session_5/remind_me/.metadata new file mode 100644 index 00000000..fd70cabc --- /dev/null +++ b/session_5/remind_me/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b + channel: stable + +project_type: app diff --git a/session_5/remind_me/Assets/App_Demov1.0.0.gif b/session_5/remind_me/Assets/App_Demov1.0.0.gif new file mode 100644 index 00000000..682def4e Binary files /dev/null and b/session_5/remind_me/Assets/App_Demov1.0.0.gif differ diff --git a/session_5/remind_me/Assets/App_Demov1.2.0.gif b/session_5/remind_me/Assets/App_Demov1.2.0.gif new file mode 100644 index 00000000..63bb913e Binary files /dev/null and b/session_5/remind_me/Assets/App_Demov1.2.0.gif differ diff --git a/session_5/remind_me/Assets/App_Demov1.2.1.gif b/session_5/remind_me/Assets/App_Demov1.2.1.gif new file mode 100644 index 00000000..ab2ec814 Binary files /dev/null and b/session_5/remind_me/Assets/App_Demov1.2.1.gif differ diff --git a/session_5/remind_me/README.md b/session_5/remind_me/README.md new file mode 100644 index 00000000..a49c02dc --- /dev/null +++ b/session_5/remind_me/README.md @@ -0,0 +1,7 @@ +# Remind Me + +A simple flutter to-do app v1.2.1 + +# App Demo + + diff --git a/session_5/remind_me/analysis_options.yaml b/session_5/remind_me/analysis_options.yaml new file mode 100644 index 00000000..61b6c4de --- /dev/null +++ b/session_5/remind_me/analysis_options.yaml @@ -0,0 +1,29 @@ +# 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-lang.github.io/linter/lints/index.html. + # + # 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/session_5/remind_me/android/.gitignore b/session_5/remind_me/android/.gitignore new file mode 100644 index 00000000..6f568019 --- /dev/null +++ b/session_5/remind_me/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/session_5/remind_me/android/app/build.gradle b/session_5/remind_me/android/app/build.gradle new file mode 100644 index 00000000..04cddbce --- /dev/null +++ b/session_5/remind_me/android/app/build.gradle @@ -0,0 +1,68 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion flutter.compileSdkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.remind_me" + minSdkVersion flutter.minSdkVersion + targetSdkVersion 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 '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/session_5/remind_me/android/app/src/debug/AndroidManifest.xml b/session_5/remind_me/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..bdbea84e --- /dev/null +++ b/session_5/remind_me/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/session_5/remind_me/android/app/src/main/AndroidManifest.xml b/session_5/remind_me/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..0ad5d76b --- /dev/null +++ b/session_5/remind_me/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/session_5/remind_me/android/app/src/main/kotlin/com/example/remind_me/MainActivity.kt b/session_5/remind_me/android/app/src/main/kotlin/com/example/remind_me/MainActivity.kt new file mode 100644 index 00000000..197c4ff1 --- /dev/null +++ b/session_5/remind_me/android/app/src/main/kotlin/com/example/remind_me/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.remind_me + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/session_5/remind_me/android/app/src/main/res/drawable-v21/launch_background.xml b/session_5/remind_me/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/session_5/remind_me/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/session_5/remind_me/android/app/src/main/res/drawable/launch_background.xml b/session_5/remind_me/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/session_5/remind_me/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/session_5/remind_me/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/session_5/remind_me/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..c1025116 Binary files /dev/null and b/session_5/remind_me/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/session_5/remind_me/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/session_5/remind_me/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..01f7ebe9 Binary files /dev/null and b/session_5/remind_me/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/session_5/remind_me/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/session_5/remind_me/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..f971e114 Binary files /dev/null and b/session_5/remind_me/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/session_5/remind_me/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/session_5/remind_me/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..e705d26f Binary files /dev/null and b/session_5/remind_me/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/session_5/remind_me/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/session_5/remind_me/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..2acd5777 Binary files /dev/null and b/session_5/remind_me/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/session_5/remind_me/android/app/src/main/res/values-night/styles.xml b/session_5/remind_me/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..3db14bb5 --- /dev/null +++ b/session_5/remind_me/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/session_5/remind_me/android/app/src/main/res/values/styles.xml b/session_5/remind_me/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..d460d1e9 --- /dev/null +++ b/session_5/remind_me/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/session_5/remind_me/android/app/src/profile/AndroidManifest.xml b/session_5/remind_me/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..bdbea84e --- /dev/null +++ b/session_5/remind_me/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/session_5/remind_me/android/build.gradle b/session_5/remind_me/android/build.gradle new file mode 100644 index 00000000..24047dce --- /dev/null +++ b/session_5/remind_me/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/session_5/remind_me/android/gradle.properties b/session_5/remind_me/android/gradle.properties new file mode 100644 index 00000000..94adc3a3 --- /dev/null +++ b/session_5/remind_me/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/session_5/remind_me/android/gradle/wrapper/gradle-wrapper.properties b/session_5/remind_me/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..bc6a58af --- /dev/null +++ b/session_5/remind_me/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/session_5/remind_me/android/settings.gradle b/session_5/remind_me/android/settings.gradle new file mode 100644 index 00000000..44e62bcf --- /dev/null +++ b/session_5/remind_me/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/session_5/remind_me/ios/.gitignore b/session_5/remind_me/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/session_5/remind_me/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/session_5/remind_me/ios/Flutter/AppFrameworkInfo.plist b/session_5/remind_me/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..8d4492f9 --- /dev/null +++ b/session_5/remind_me/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 + 9.0 + + diff --git a/session_5/remind_me/ios/Flutter/Debug.xcconfig b/session_5/remind_me/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/session_5/remind_me/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/session_5/remind_me/ios/Flutter/Release.xcconfig b/session_5/remind_me/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/session_5/remind_me/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/session_5/remind_me/ios/Runner.xcodeproj/project.pbxproj b/session_5/remind_me/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..5fb9a618 --- /dev/null +++ b/session_5/remind_me/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,481 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 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 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 = ""; }; + 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 */ + 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 */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + 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 */ + 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 = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 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 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 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; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + 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; + 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 */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase 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; + 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; + 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 = 9.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.remindMe; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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; + 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 = 9.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; + 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; + 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 = 9.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.remindMe; + 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.remindMe; + 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 */ + 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/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/session_5/remind_me/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/session_5/remind_me/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/session_5/remind_me/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..c87d15a3 --- /dev/null +++ b/session_5/remind_me/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/session_5/remind_me/ios/Runner.xcworkspace/contents.xcworkspacedata b/session_5/remind_me/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/session_5/remind_me/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/session_5/remind_me/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/session_5/remind_me/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/session_5/remind_me/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/session_5/remind_me/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/session_5/remind_me/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/session_5/remind_me/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/session_5/remind_me/ios/Runner/AppDelegate.swift b/session_5/remind_me/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..70693e4a --- /dev/null +++ b/session_5/remind_me/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@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/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 00000000..ea5e2c31 Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png new file mode 100644 index 00000000..f7919154 Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png new file mode 100644 index 00000000..a9e5a746 Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png new file mode 100644 index 00000000..c87d061f Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png new file mode 100644 index 00000000..1244c6a8 Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png new file mode 100644 index 00000000..f3351ec1 Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png new file mode 100644 index 00000000..2ec0737a Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png new file mode 100644 index 00000000..2eb8f8d3 Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png new file mode 100644 index 00000000..a209b78f Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png new file mode 100644 index 00000000..52e8d77e Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png new file mode 100644 index 00000000..6af85fa5 Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..73d3b7f6 --- /dev/null +++ b/session_5/remind_me/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1 @@ +{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"}]} \ No newline at end of file diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/session_5/remind_me/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/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/session_5/remind_me/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/session_5/remind_me/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/session_5/remind_me/ios/Runner/Base.lproj/LaunchScreen.storyboard b/session_5/remind_me/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/session_5/remind_me/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/session_5/remind_me/ios/Runner/Base.lproj/Main.storyboard b/session_5/remind_me/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/session_5/remind_me/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/session_5/remind_me/ios/Runner/Info.plist b/session_5/remind_me/ios/Runner/Info.plist new file mode 100644 index 00000000..5c23df6a --- /dev/null +++ b/session_5/remind_me/ios/Runner/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Remind Me + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + remind_me + 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 + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/session_5/remind_me/ios/Runner/Runner-Bridging-Header.h b/session_5/remind_me/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/session_5/remind_me/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/session_5/remind_me/lib/Models/tasks.dart b/session_5/remind_me/lib/Models/tasks.dart new file mode 100644 index 00000000..f5a37491 --- /dev/null +++ b/session_5/remind_me/lib/Models/tasks.dart @@ -0,0 +1,14 @@ +import 'package:hive/hive.dart'; + +part 'tasks.g.dart'; + +@HiveType(typeId: 0) +class Tasks { + @HiveField(0) + String task; + @HiveField(1) + DateTime date; + @HiveField(2) + DateTime time; + Tasks({required this.task, required this.date, required this.time}); +} diff --git a/session_5/remind_me/lib/Models/tasks.g.dart b/session_5/remind_me/lib/Models/tasks.g.dart new file mode 100644 index 00000000..dd600a78 --- /dev/null +++ b/session_5/remind_me/lib/Models/tasks.g.dart @@ -0,0 +1,47 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tasks.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class TasksAdapter extends TypeAdapter { + @override + final int typeId = 0; + + @override + Tasks read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Tasks( + task: fields[0] as String, + date: fields[1] as DateTime, + time: fields[2] as DateTime, + ); + } + + @override + void write(BinaryWriter writer, Tasks obj) { + writer + ..writeByte(3) + ..writeByte(0) + ..write(obj.task) + ..writeByte(1) + ..write(obj.date) + ..writeByte(2) + ..write(obj.time); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TasksAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/session_5/remind_me/lib/Screens/HomePage.dart b/session_5/remind_me/lib/Screens/HomePage.dart new file mode 100644 index 00000000..6a657852 --- /dev/null +++ b/session_5/remind_me/lib/Screens/HomePage.dart @@ -0,0 +1,115 @@ +import 'package:flutter/material.dart'; +import 'package:remind_me/Screens/NewTask.dart'; +import 'package:hive_flutter/hive_flutter.dart'; +import 'package:remind_me/Models/tasks.dart'; +import 'package:intl/intl.dart'; +import 'package:remind_me/Screens/TaskPage.dart'; + +class HomePage extends StatefulWidget { + const HomePage({Key? key}) : super(key: key); + + @override + _HomePageState createState() => _HomePageState(); +} + +class _HomePageState extends State { + var box; + List tasks = []; + void gettasks() { + box = Hive.box('Tasks'); + setState(() { + tasks = box.values.toList(); + }); + } + + @override + void initState() { + gettasks(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("To-Do List"), + centerTitle: true, + ), + body: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: RefreshIndicator( + child: tasks.isEmpty + ? Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: const [ + Text( + "No Tasks Scheduled", + style: TextStyle( + color: Colors.grey, + fontSize: 30.0, + fontWeight: FontWeight.bold), + ) + ], + )) + : ListView.builder( + itemCount: tasks.length, + itemBuilder: (context, p) { + var name = tasks[p].task; + var dld = tasks[p].date; + var dlt = tasks[p].time; + return Card( + child: ListTile( + trailing: IconButton( + onPressed: () async { + await box.deleteAt(p); + gettasks(); + }, + icon: const Icon(Icons.done_outline_outlined)), + title: Text( + name, + style: const TextStyle(fontSize: 20.0), + ), + subtitle: Text( + DateFormat('dd/MM/yyyy').format(dld) + + ", " + + DateFormat('hh:mm a').format(dlt), + style: const TextStyle(fontSize: 15.0), + ), + onTap: () async { + await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => TaskPage( + index: p, + ), + ), + ); + gettasks(); + }, + ), + ); + }), + onRefresh: () { + return Future.delayed(const Duration(seconds: 1), () { + setState(() { + gettasks(); + }); + }); + }, + )), + floatingActionButton: FloatingActionButton( + onPressed: () async { + await Navigator.push( + context, + MaterialPageRoute(builder: (context) { + return const NewTask(); + }), + ); + gettasks(); + }, + child: const Icon(Icons.add), + )); + } +} diff --git a/session_5/remind_me/lib/Screens/NewTask.dart b/session_5/remind_me/lib/Screens/NewTask.dart new file mode 100644 index 00000000..12187f09 --- /dev/null +++ b/session_5/remind_me/lib/Screens/NewTask.dart @@ -0,0 +1,114 @@ +import 'package:flutter/material.dart'; +import 'package:hive/hive.dart'; +import 'package:remind_me/Models/tasks.dart'; +import 'package:syncfusion_flutter_datepicker/datepicker.dart'; +import 'package:flutter_time_picker_spinner/flutter_time_picker_spinner.dart'; + +class NewTask extends StatefulWidget { + const NewTask({Key? key}) : super(key: key); + + @override + _NewTaskState createState() => _NewTaskState(); +} + +class _NewTaskState extends State { + var date = DateTime.now(); + var time = DateTime.now(); + var taskName = TextEditingController(); + + void DatePick(DateRangePickerSelectionChangedArgs args) { + setState(() { + date = args.value; + }); + } + + void AddTask() async { + var b = Hive.box('Tasks'); + var t = Tasks(task: taskName.text, date: date, time: time); + var a = await b.add(t); + Navigator.pop(context); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("New Task"), + centerTitle: true, + ), + body: SingleChildScrollView( + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const SizedBox( + height: 30.0, + ), + const Text( + "Task Name", + style: TextStyle( + fontSize: 30.0, fontWeight: FontWeight.bold), + ), + const SizedBox( + height: 20.0, + ), + TextField( + controller: taskName, + style: TextStyle(fontSize: 35.0), + textAlign: TextAlign.center, + ), + const SizedBox( + height: 30.0, + ), + const Text("Deadline Date", + style: TextStyle( + fontSize: 30.0, fontWeight: FontWeight.bold)), + const SizedBox( + height: 10.0, + ), + SfDateRangePicker( + enablePastDates: false, + onSelectionChanged: DatePick, + initialSelectedDate: date, + ), + const SizedBox( + height: 20.0, + ), + const Text("Deadline Time", + style: TextStyle( + fontSize: 30.0, fontWeight: FontWeight.bold)), + TimePickerSpinner( + isForce2Digits: true, + is24HourMode: false, + onTimeChange: (t) { + setState(() { + time = t; + }); + }, + ), + const SizedBox( + height: 30.0, + ), + TextButton( + onPressed: AddTask, + child: const Text( + "OK", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold), + )), + const SizedBox( + height: 5.0, + ), + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text( + "CANCEL", + style: TextStyle(fontSize: 20.0), + )) + ])), + )); + } +} diff --git a/session_5/remind_me/lib/Screens/TaskPage.dart b/session_5/remind_me/lib/Screens/TaskPage.dart new file mode 100644 index 00000000..3c0758cf --- /dev/null +++ b/session_5/remind_me/lib/Screens/TaskPage.dart @@ -0,0 +1,82 @@ +import 'package:flutter/material.dart'; +import 'package:hive_flutter/hive_flutter.dart'; +import 'package:remind_me/Models/tasks.dart'; +import 'package:intl/intl.dart'; + +class TaskPage extends StatefulWidget { + const TaskPage({Key? key, required this.index}) : super(key: key); + final int index; + + @override + _TaskPageState createState() => _TaskPageState(); +} + +class _TaskPageState extends State { + var b; + late Tasks todo; + + @override + void initState() { + b = Hive.box('Tasks'); + todo = b.getAt(widget.index); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("Task Details"), + centerTitle: true, + ), + body: SingleChildScrollView( + child: Container( + width: MediaQuery.of(context).size.width, + padding: const EdgeInsets.symmetric(horizontal: 20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const SizedBox( + height: 20.0, + ), + const Text( + "Task Name", + style: + TextStyle(fontSize: 30.0, fontWeight: FontWeight.bold), + ), + const SizedBox( + height: 10.0, + ), + Text(todo.task, style: const TextStyle(fontSize: 35.5)), + const SizedBox( + height: 30.0, + ), + const Text( + "Deadline:", + style: + TextStyle(fontSize: 30.0, fontWeight: FontWeight.bold), + ), + const SizedBox(height: 10.0), + Text( + DateFormat('dd/MM/yyyy').format(todo.date) + + ", " + + DateFormat('hh:mm a').format(todo.time), + style: const TextStyle( + fontSize: 35.0, + )), + const SizedBox(height: 30.0), + TextButton( + onPressed: () { + b.deleteAt(widget.index); + Navigator.pop(context); + }, + child: const Text( + "Mark as Completed", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold), + )) + ], + )), + )); + } +} diff --git a/session_5/remind_me/lib/main.dart b/session_5/remind_me/lib/main.dart new file mode 100644 index 00000000..1beb4c9b --- /dev/null +++ b/session_5/remind_me/lib/main.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:remind_me/Screens/HomePage.dart'; +import 'package:hive_flutter/hive_flutter.dart'; +import 'package:remind_me/Models/tasks.dart'; + +Future main() async { + await Hive.initFlutter(); + Hive.registerAdapter(TasksAdapter()); + await Hive.openBox('Tasks'); + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + primarySwatch: Colors.red, + ), + home: const HomePage(), + ); + } +} diff --git a/session_5/remind_me/linux/.gitignore b/session_5/remind_me/linux/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/session_5/remind_me/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/session_5/remind_me/linux/CMakeLists.txt b/session_5/remind_me/linux/CMakeLists.txt new file mode 100644 index 00000000..b49863fb --- /dev/null +++ b/session_5/remind_me/linux/CMakeLists.txt @@ -0,0 +1,116 @@ +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +set(BINARY_NAME "remind_me") +set(APPLICATION_ID "com.example.remind_me") + +cmake_policy(SET CMP0063 NEW) + +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() + +# Configure build 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. +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() + +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + +# Flutter library and tool build rules. +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}") + +# Application build +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) +apply_standard_settings(${BINARY_NAME}) +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +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) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# 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/session_5/remind_me/linux/flutter/CMakeLists.txt b/session_5/remind_me/linux/flutter/CMakeLists.txt new file mode 100644 index 00000000..33fd5801 --- /dev/null +++ b/session_5/remind_me/linux/flutter/CMakeLists.txt @@ -0,0 +1,87 @@ +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/session_5/remind_me/linux/flutter/generated_plugin_registrant.cc b/session_5/remind_me/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..e71a16d2 --- /dev/null +++ b/session_5/remind_me/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/session_5/remind_me/linux/flutter/generated_plugin_registrant.h b/session_5/remind_me/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/session_5/remind_me/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/session_5/remind_me/linux/flutter/generated_plugins.cmake b/session_5/remind_me/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..51436ae8 --- /dev/null +++ b/session_5/remind_me/linux/flutter/generated_plugins.cmake @@ -0,0 +1,15 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_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) diff --git a/session_5/remind_me/linux/main.cc b/session_5/remind_me/linux/main.cc new file mode 100644 index 00000000..e7c5c543 --- /dev/null +++ b/session_5/remind_me/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/session_5/remind_me/linux/my_application.cc b/session_5/remind_me/linux/my_application.cc new file mode 100644 index 00000000..1e18015c --- /dev/null +++ b/session_5/remind_me/linux/my_application.cc @@ -0,0 +1,104 @@ +#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, "remind_me"); + 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, "remind_me"); + } + + 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 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_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/session_5/remind_me/linux/my_application.h b/session_5/remind_me/linux/my_application.h new file mode 100644 index 00000000..72271d5e --- /dev/null +++ b/session_5/remind_me/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/session_5/remind_me/pubspec.yaml b/session_5/remind_me/pubspec.yaml new file mode 100644 index 00000000..8d524486 --- /dev/null +++ b/session_5/remind_me/pubspec.yaml @@ -0,0 +1,95 @@ +name: remind_me +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 used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.2.1 + +environment: + sdk: ">=2.15.1 <3.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 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + hive: ^2.0.5 + hive_flutter: ^1.1.0 + syncfusion_flutter_datepicker: ^19.4.47 + flutter_time_picker_spinner: ^2.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + + # 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: ^1.0.0 + build_runner: ^2.1.7 + hive_generator: ^1.1.2 + +# 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. +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: + # - images/a_dot_burr.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/session_5/remind_me/test/widget_test.dart b/session_5/remind_me/test/widget_test.dart new file mode 100644 index 00000000..82934257 --- /dev/null +++ b/session_5/remind_me/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 that Flutter provides. 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:remind_me/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/session_5/remind_me/web/favicon.png b/session_5/remind_me/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/session_5/remind_me/web/favicon.png differ diff --git a/session_5/remind_me/web/icons/Icon-192.png b/session_5/remind_me/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/session_5/remind_me/web/icons/Icon-192.png differ diff --git a/session_5/remind_me/web/icons/Icon-512.png b/session_5/remind_me/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/session_5/remind_me/web/icons/Icon-512.png differ diff --git a/session_5/remind_me/web/icons/Icon-maskable-192.png b/session_5/remind_me/web/icons/Icon-maskable-192.png new file mode 100644 index 00000000..eb9b4d76 Binary files /dev/null and b/session_5/remind_me/web/icons/Icon-maskable-192.png differ diff --git a/session_5/remind_me/web/icons/Icon-maskable-512.png b/session_5/remind_me/web/icons/Icon-maskable-512.png new file mode 100644 index 00000000..d69c5669 Binary files /dev/null and b/session_5/remind_me/web/icons/Icon-maskable-512.png differ diff --git a/session_5/remind_me/web/index.html b/session_5/remind_me/web/index.html new file mode 100644 index 00000000..039aa8af --- /dev/null +++ b/session_5/remind_me/web/index.html @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + remind_me + + + + + + + diff --git a/session_5/remind_me/web/manifest.json b/session_5/remind_me/web/manifest.json new file mode 100644 index 00000000..c239e757 --- /dev/null +++ b/session_5/remind_me/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "remind_me", + "short_name": "remind_me", + "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" + } + ] +}