├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── net
│ │ │ │ └── codexdev
│ │ │ │ └── flutter_alarm_clock
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ ├── codex_logo.png
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── raw
│ │ │ └── a_long_cold_sting.wav
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── add_alarm.png
├── alarm_icon.png
├── clock_icon.png
├── fonts
│ ├── Avenir-Book.ttf
│ ├── Avenir-Heavy.ttf
│ ├── Avenir-Light.ttf
│ └── Avenir-Medium.ttf
├── stopwatch_icon.png
└── timer_icon.png
├── flutter_clock_app.png
├── ios
├── .gitignore
├── Flutter
│ ├── .last_build_id
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
└── a_long_cold_sting.wav
├── lib
├── alarm_helper.dart
├── app
│ ├── data
│ │ ├── data.dart
│ │ ├── enums.dart
│ │ ├── models
│ │ │ ├── alarm_info.dart
│ │ │ └── menu_info.dart
│ │ └── theme_data.dart
│ └── modules
│ │ └── views
│ │ ├── alarm_page.dart
│ │ ├── clock_page.dart
│ │ ├── clockview.dart
│ │ └── homepage.dart
└── main.dart
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Symbolication related
37 | app.*.symbols
38 |
39 | # Obfuscation related
40 | app.*.map.json
41 |
42 | # Exceptions to above rules.
43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
44 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: e6b34c2b5c96bb95325269a29a84e83ed8909b5f
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flutter Clock App
2 | Minimal UI | Modern Theme | Full Functional
3 | [](https://discord.com/invite/nWFnTqP)
4 |
5 |
6 |
7 |
8 |
9 | Flutter Custom Painter Tutorial || Clock App (Episode-1)
10 | https://youtu.be/HyAeZKWWuxA
11 |
12 | Flutter Design Tutorial || Clock App (Episode-2)
13 | https://youtu.be/MPc-K8oEbdE
14 |
15 | Flutter Navigation with Provider || Clock App (Episode-3)
16 | https://youtu.be/WMp5FnQ1X_g
17 |
18 | Flutter ListView Tutorial | Clock App (Episode-4)
19 | https://youtu.be/tKtYfuuVHlA
20 |
21 | Flutter Local Notification Tutorial | Clock App (Episode-5)
22 | https://youtu.be/iKxrt4ASR5Y
23 |
24 | SQLite Database in Flutter | Tutorial || Clock App (Episode-6)
25 | https://youtu.be/WqQhJmwp5L4
26 |
27 | Flutter Clock App | Live Coding
28 | https://youtu.be/AqDxcfhgvwE
29 |
30 | If you like my work, support me to create more!
31 | [](https://ko-fi.com/E1E0BVKNS)
32 |
33 | ## Getting Started
34 |
35 | This project is a starting point for a Flutter application.
36 |
37 | A few resources to get you started if this is your first Flutter project:
38 |
39 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
40 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
41 |
42 | For help getting started with Flutter, view our
43 | [online documentation](https://flutter.dev/docs), which offers tutorials,
44 | samples, guidance on mobile development, and a full API reference.
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 |
2 | linter:
3 | rules:
4 |
5 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | kotlinOptions {
37 | jvmTarget = '1.8'
38 | }
39 |
40 | sourceSets {
41 | main.java.srcDirs += 'src/main/kotlin'
42 | }
43 |
44 | defaultConfig {
45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46 | applicationId "net.codexdev.flutter_alarm_clock"
47 | minSdkVersion flutter.minSdkVersion
48 | targetSdkVersion flutter.targetSdkVersion
49 | versionCode flutterVersionCode.toInteger()
50 | versionName flutterVersionName
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68 | }
69 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/net/codexdev/flutter_alarm_clock/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package net.codexdev.flutter_alarm_clock
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/codex_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/android/app/src/main/res/drawable/codex_logo.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/raw/a_long_cold_sting.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/android/app/src/main/res/raw/a_long_cold_sting.wav
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/assets/add_alarm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/add_alarm.png
--------------------------------------------------------------------------------
/assets/alarm_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/alarm_icon.png
--------------------------------------------------------------------------------
/assets/clock_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/clock_icon.png
--------------------------------------------------------------------------------
/assets/fonts/Avenir-Book.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/fonts/Avenir-Book.ttf
--------------------------------------------------------------------------------
/assets/fonts/Avenir-Heavy.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/fonts/Avenir-Heavy.ttf
--------------------------------------------------------------------------------
/assets/fonts/Avenir-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/fonts/Avenir-Light.ttf
--------------------------------------------------------------------------------
/assets/fonts/Avenir-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/fonts/Avenir-Medium.ttf
--------------------------------------------------------------------------------
/assets/stopwatch_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/stopwatch_icon.png
--------------------------------------------------------------------------------
/assets/timer_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/assets/timer_icon.png
--------------------------------------------------------------------------------
/flutter_clock_app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/flutter_clock_app.png
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/.last_build_id:
--------------------------------------------------------------------------------
1 | 3fe181b6cd378bf30386bdfc1eddc9e5
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - flutter_local_notifications (0.0.1):
4 | - Flutter
5 | - FMDB (2.7.5):
6 | - FMDB/standard (= 2.7.5)
7 | - FMDB/standard (2.7.5)
8 | - sqflite (0.0.2):
9 | - Flutter
10 | - FMDB (>= 2.7.5)
11 |
12 | DEPENDENCIES:
13 | - Flutter (from `Flutter`)
14 | - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
15 | - sqflite (from `.symlinks/plugins/sqflite/ios`)
16 |
17 | SPEC REPOS:
18 | trunk:
19 | - FMDB
20 |
21 | EXTERNAL SOURCES:
22 | Flutter:
23 | :path: Flutter
24 | flutter_local_notifications:
25 | :path: ".symlinks/plugins/flutter_local_notifications/ios"
26 | sqflite:
27 | :path: ".symlinks/plugins/sqflite/ios"
28 |
29 | SPEC CHECKSUMS:
30 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
31 | flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
32 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
33 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
34 |
35 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
36 |
37 | COCOAPODS: 1.11.3
38 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 09319FE77B0879828E34B484 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0FFC11261E5A730AF737ADD /* Pods_Runner.framework */; };
11 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXCopyFilesBuildPhase section */
20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
21 | isa = PBXCopyFilesBuildPhase;
22 | buildActionMask = 2147483647;
23 | dstPath = "";
24 | dstSubfolderSpec = 10;
25 | files = (
26 | );
27 | name = "Embed Frameworks";
28 | runOnlyForDeploymentPostprocessing = 0;
29 | };
30 | /* End PBXCopyFilesBuildPhase section */
31 |
32 | /* Begin PBXFileReference section */
33 | 11B03BBB7D813574C1C7A512 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
37 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
38 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
39 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
40 | 9012F3A37A9EB8DDF2986CCE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
41 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
42 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
43 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
48 | D0FFC11261E5A730AF737ADD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
49 | F5F59E78D4714042F8D797AA /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
50 | /* End PBXFileReference section */
51 |
52 | /* Begin PBXFrameworksBuildPhase section */
53 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
54 | isa = PBXFrameworksBuildPhase;
55 | buildActionMask = 2147483647;
56 | files = (
57 | 09319FE77B0879828E34B484 /* Pods_Runner.framework in Frameworks */,
58 | );
59 | runOnlyForDeploymentPostprocessing = 0;
60 | };
61 | /* End PBXFrameworksBuildPhase section */
62 |
63 | /* Begin PBXGroup section */
64 | 9740EEB11CF90186004384FC /* Flutter */ = {
65 | isa = PBXGroup;
66 | children = (
67 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
68 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
69 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
70 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
71 | );
72 | name = Flutter;
73 | sourceTree = "";
74 | };
75 | 97C146E51CF9000F007C117D = {
76 | isa = PBXGroup;
77 | children = (
78 | 9740EEB11CF90186004384FC /* Flutter */,
79 | 97C146F01CF9000F007C117D /* Runner */,
80 | 97C146EF1CF9000F007C117D /* Products */,
81 | B9216AB3517CDFCF0B4D6606 /* Pods */,
82 | CE71DD8300E05A164028D2E9 /* Frameworks */,
83 | );
84 | sourceTree = "";
85 | };
86 | 97C146EF1CF9000F007C117D /* Products */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146EE1CF9000F007C117D /* Runner.app */,
90 | );
91 | name = Products;
92 | sourceTree = "";
93 | };
94 | 97C146F01CF9000F007C117D /* Runner */ = {
95 | isa = PBXGroup;
96 | children = (
97 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
98 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
99 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
100 | 97C147021CF9000F007C117D /* Info.plist */,
101 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
102 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
103 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
104 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
105 | );
106 | path = Runner;
107 | sourceTree = "";
108 | };
109 | B9216AB3517CDFCF0B4D6606 /* Pods */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 9012F3A37A9EB8DDF2986CCE /* Pods-Runner.debug.xcconfig */,
113 | F5F59E78D4714042F8D797AA /* Pods-Runner.release.xcconfig */,
114 | 11B03BBB7D813574C1C7A512 /* Pods-Runner.profile.xcconfig */,
115 | );
116 | name = Pods;
117 | path = Pods;
118 | sourceTree = "";
119 | };
120 | CE71DD8300E05A164028D2E9 /* Frameworks */ = {
121 | isa = PBXGroup;
122 | children = (
123 | D0FFC11261E5A730AF737ADD /* Pods_Runner.framework */,
124 | );
125 | name = Frameworks;
126 | sourceTree = "";
127 | };
128 | /* End PBXGroup section */
129 |
130 | /* Begin PBXNativeTarget section */
131 | 97C146ED1CF9000F007C117D /* Runner */ = {
132 | isa = PBXNativeTarget;
133 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
134 | buildPhases = (
135 | 353DD04E071A071665545EA2 /* [CP] Check Pods Manifest.lock */,
136 | 9740EEB61CF901F6004384FC /* Run Script */,
137 | 97C146EA1CF9000F007C117D /* Sources */,
138 | 97C146EB1CF9000F007C117D /* Frameworks */,
139 | 97C146EC1CF9000F007C117D /* Resources */,
140 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142 | 89A4E74F81F7F684D2AA3898 /* [CP] Embed Pods Frameworks */,
143 | );
144 | buildRules = (
145 | );
146 | dependencies = (
147 | );
148 | name = Runner;
149 | productName = Runner;
150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
151 | productType = "com.apple.product-type.application";
152 | };
153 | /* End PBXNativeTarget section */
154 |
155 | /* Begin PBXProject section */
156 | 97C146E61CF9000F007C117D /* Project object */ = {
157 | isa = PBXProject;
158 | attributes = {
159 | LastUpgradeCheck = 1300;
160 | ORGANIZATIONNAME = "";
161 | TargetAttributes = {
162 | 97C146ED1CF9000F007C117D = {
163 | CreatedOnToolsVersion = 7.3.1;
164 | LastSwiftMigration = 1100;
165 | };
166 | };
167 | };
168 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
169 | compatibilityVersion = "Xcode 9.3";
170 | developmentRegion = en;
171 | hasScannedForEncodings = 0;
172 | knownRegions = (
173 | en,
174 | Base,
175 | );
176 | mainGroup = 97C146E51CF9000F007C117D;
177 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
178 | projectDirPath = "";
179 | projectRoot = "";
180 | targets = (
181 | 97C146ED1CF9000F007C117D /* Runner */,
182 | );
183 | };
184 | /* End PBXProject section */
185 |
186 | /* Begin PBXResourcesBuildPhase section */
187 | 97C146EC1CF9000F007C117D /* Resources */ = {
188 | isa = PBXResourcesBuildPhase;
189 | buildActionMask = 2147483647;
190 | files = (
191 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
193 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | };
198 | /* End PBXResourcesBuildPhase section */
199 |
200 | /* Begin PBXShellScriptBuildPhase section */
201 | 353DD04E071A071665545EA2 /* [CP] Check Pods Manifest.lock */ = {
202 | isa = PBXShellScriptBuildPhase;
203 | buildActionMask = 2147483647;
204 | files = (
205 | );
206 | inputFileListPaths = (
207 | );
208 | inputPaths = (
209 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
210 | "${PODS_ROOT}/Manifest.lock",
211 | );
212 | name = "[CP] Check Pods Manifest.lock";
213 | outputFileListPaths = (
214 | );
215 | outputPaths = (
216 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | shellPath = /bin/sh;
220 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
221 | showEnvVarsInLog = 0;
222 | };
223 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
224 | isa = PBXShellScriptBuildPhase;
225 | buildActionMask = 2147483647;
226 | files = (
227 | );
228 | inputPaths = (
229 | );
230 | name = "Thin Binary";
231 | outputPaths = (
232 | );
233 | runOnlyForDeploymentPostprocessing = 0;
234 | shellPath = /bin/sh;
235 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
236 | };
237 | 89A4E74F81F7F684D2AA3898 /* [CP] Embed Pods Frameworks */ = {
238 | isa = PBXShellScriptBuildPhase;
239 | buildActionMask = 2147483647;
240 | files = (
241 | );
242 | inputFileListPaths = (
243 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
244 | );
245 | name = "[CP] Embed Pods Frameworks";
246 | outputFileListPaths = (
247 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
248 | );
249 | runOnlyForDeploymentPostprocessing = 0;
250 | shellPath = /bin/sh;
251 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
252 | showEnvVarsInLog = 0;
253 | };
254 | 9740EEB61CF901F6004384FC /* Run Script */ = {
255 | isa = PBXShellScriptBuildPhase;
256 | buildActionMask = 2147483647;
257 | files = (
258 | );
259 | inputPaths = (
260 | );
261 | name = "Run Script";
262 | outputPaths = (
263 | );
264 | runOnlyForDeploymentPostprocessing = 0;
265 | shellPath = /bin/sh;
266 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
267 | };
268 | /* End PBXShellScriptBuildPhase section */
269 |
270 | /* Begin PBXSourcesBuildPhase section */
271 | 97C146EA1CF9000F007C117D /* Sources */ = {
272 | isa = PBXSourcesBuildPhase;
273 | buildActionMask = 2147483647;
274 | files = (
275 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
276 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
277 | );
278 | runOnlyForDeploymentPostprocessing = 0;
279 | };
280 | /* End PBXSourcesBuildPhase section */
281 |
282 | /* Begin PBXVariantGroup section */
283 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
284 | isa = PBXVariantGroup;
285 | children = (
286 | 97C146FB1CF9000F007C117D /* Base */,
287 | );
288 | name = Main.storyboard;
289 | sourceTree = "";
290 | };
291 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
292 | isa = PBXVariantGroup;
293 | children = (
294 | 97C147001CF9000F007C117D /* Base */,
295 | );
296 | name = LaunchScreen.storyboard;
297 | sourceTree = "";
298 | };
299 | /* End PBXVariantGroup section */
300 |
301 | /* Begin XCBuildConfiguration section */
302 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
303 | isa = XCBuildConfiguration;
304 | buildSettings = {
305 | ALWAYS_SEARCH_USER_PATHS = NO;
306 | CLANG_ANALYZER_NONNULL = YES;
307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
308 | CLANG_CXX_LIBRARY = "libc++";
309 | CLANG_ENABLE_MODULES = YES;
310 | CLANG_ENABLE_OBJC_ARC = YES;
311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
312 | CLANG_WARN_BOOL_CONVERSION = YES;
313 | CLANG_WARN_COMMA = YES;
314 | CLANG_WARN_CONSTANT_CONVERSION = YES;
315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
317 | CLANG_WARN_EMPTY_BODY = YES;
318 | CLANG_WARN_ENUM_CONVERSION = YES;
319 | CLANG_WARN_INFINITE_RECURSION = YES;
320 | CLANG_WARN_INT_CONVERSION = YES;
321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
326 | CLANG_WARN_STRICT_PROTOTYPES = YES;
327 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
328 | CLANG_WARN_UNREACHABLE_CODE = YES;
329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
331 | COPY_PHASE_STRIP = NO;
332 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
333 | ENABLE_NS_ASSERTIONS = NO;
334 | ENABLE_STRICT_OBJC_MSGSEND = YES;
335 | GCC_C_LANGUAGE_STANDARD = gnu99;
336 | GCC_NO_COMMON_BLOCKS = YES;
337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
339 | GCC_WARN_UNDECLARED_SELECTOR = YES;
340 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
341 | GCC_WARN_UNUSED_FUNCTION = YES;
342 | GCC_WARN_UNUSED_VARIABLE = YES;
343 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
344 | MTL_ENABLE_DEBUG_INFO = NO;
345 | SDKROOT = iphoneos;
346 | SUPPORTED_PLATFORMS = iphoneos;
347 | TARGETED_DEVICE_FAMILY = "1,2";
348 | VALIDATE_PRODUCT = YES;
349 | };
350 | name = Profile;
351 | };
352 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
353 | isa = XCBuildConfiguration;
354 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
355 | buildSettings = {
356 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
357 | CLANG_ENABLE_MODULES = YES;
358 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
359 | DEVELOPMENT_TEAM = 8A2JX5NC8U;
360 | ENABLE_BITCODE = NO;
361 | INFOPLIST_FILE = Runner/Info.plist;
362 | LD_RUNPATH_SEARCH_PATHS = (
363 | "$(inherited)",
364 | "@executable_path/Frameworks",
365 | );
366 | PRODUCT_BUNDLE_IDENTIFIER = net.codexdev.flutterAlarmClock;
367 | PRODUCT_NAME = "$(TARGET_NAME)";
368 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
369 | SWIFT_VERSION = 5.0;
370 | VERSIONING_SYSTEM = "apple-generic";
371 | };
372 | name = Profile;
373 | };
374 | 97C147031CF9000F007C117D /* Debug */ = {
375 | isa = XCBuildConfiguration;
376 | buildSettings = {
377 | ALWAYS_SEARCH_USER_PATHS = NO;
378 | CLANG_ANALYZER_NONNULL = YES;
379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
380 | CLANG_CXX_LIBRARY = "libc++";
381 | CLANG_ENABLE_MODULES = YES;
382 | CLANG_ENABLE_OBJC_ARC = YES;
383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
384 | CLANG_WARN_BOOL_CONVERSION = YES;
385 | CLANG_WARN_COMMA = YES;
386 | CLANG_WARN_CONSTANT_CONVERSION = YES;
387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
389 | CLANG_WARN_EMPTY_BODY = YES;
390 | CLANG_WARN_ENUM_CONVERSION = YES;
391 | CLANG_WARN_INFINITE_RECURSION = YES;
392 | CLANG_WARN_INT_CONVERSION = YES;
393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
398 | CLANG_WARN_STRICT_PROTOTYPES = YES;
399 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
400 | CLANG_WARN_UNREACHABLE_CODE = YES;
401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
402 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
403 | COPY_PHASE_STRIP = NO;
404 | DEBUG_INFORMATION_FORMAT = dwarf;
405 | ENABLE_STRICT_OBJC_MSGSEND = YES;
406 | ENABLE_TESTABILITY = YES;
407 | GCC_C_LANGUAGE_STANDARD = gnu99;
408 | GCC_DYNAMIC_NO_PIC = NO;
409 | GCC_NO_COMMON_BLOCKS = YES;
410 | GCC_OPTIMIZATION_LEVEL = 0;
411 | GCC_PREPROCESSOR_DEFINITIONS = (
412 | "DEBUG=1",
413 | "$(inherited)",
414 | );
415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
417 | GCC_WARN_UNDECLARED_SELECTOR = YES;
418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
419 | GCC_WARN_UNUSED_FUNCTION = YES;
420 | GCC_WARN_UNUSED_VARIABLE = YES;
421 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
422 | MTL_ENABLE_DEBUG_INFO = YES;
423 | ONLY_ACTIVE_ARCH = YES;
424 | SDKROOT = iphoneos;
425 | TARGETED_DEVICE_FAMILY = "1,2";
426 | };
427 | name = Debug;
428 | };
429 | 97C147041CF9000F007C117D /* Release */ = {
430 | isa = XCBuildConfiguration;
431 | buildSettings = {
432 | ALWAYS_SEARCH_USER_PATHS = NO;
433 | CLANG_ANALYZER_NONNULL = YES;
434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
435 | CLANG_CXX_LIBRARY = "libc++";
436 | CLANG_ENABLE_MODULES = YES;
437 | CLANG_ENABLE_OBJC_ARC = YES;
438 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
439 | CLANG_WARN_BOOL_CONVERSION = YES;
440 | CLANG_WARN_COMMA = YES;
441 | CLANG_WARN_CONSTANT_CONVERSION = YES;
442 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
443 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
444 | CLANG_WARN_EMPTY_BODY = YES;
445 | CLANG_WARN_ENUM_CONVERSION = YES;
446 | CLANG_WARN_INFINITE_RECURSION = YES;
447 | CLANG_WARN_INT_CONVERSION = YES;
448 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
449 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
450 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
452 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
453 | CLANG_WARN_STRICT_PROTOTYPES = YES;
454 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
455 | CLANG_WARN_UNREACHABLE_CODE = YES;
456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
457 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
458 | COPY_PHASE_STRIP = NO;
459 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
460 | ENABLE_NS_ASSERTIONS = NO;
461 | ENABLE_STRICT_OBJC_MSGSEND = YES;
462 | GCC_C_LANGUAGE_STANDARD = gnu99;
463 | GCC_NO_COMMON_BLOCKS = YES;
464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
466 | GCC_WARN_UNDECLARED_SELECTOR = YES;
467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
468 | GCC_WARN_UNUSED_FUNCTION = YES;
469 | GCC_WARN_UNUSED_VARIABLE = YES;
470 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
471 | MTL_ENABLE_DEBUG_INFO = NO;
472 | SDKROOT = iphoneos;
473 | SUPPORTED_PLATFORMS = iphoneos;
474 | SWIFT_COMPILATION_MODE = wholemodule;
475 | SWIFT_OPTIMIZATION_LEVEL = "-O";
476 | TARGETED_DEVICE_FAMILY = "1,2";
477 | VALIDATE_PRODUCT = YES;
478 | };
479 | name = Release;
480 | };
481 | 97C147061CF9000F007C117D /* Debug */ = {
482 | isa = XCBuildConfiguration;
483 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
484 | buildSettings = {
485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
486 | CLANG_ENABLE_MODULES = YES;
487 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
488 | DEVELOPMENT_TEAM = 8A2JX5NC8U;
489 | ENABLE_BITCODE = NO;
490 | INFOPLIST_FILE = Runner/Info.plist;
491 | LD_RUNPATH_SEARCH_PATHS = (
492 | "$(inherited)",
493 | "@executable_path/Frameworks",
494 | );
495 | PRODUCT_BUNDLE_IDENTIFIER = net.codexdev.flutterAlarmClock;
496 | PRODUCT_NAME = "$(TARGET_NAME)";
497 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
498 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
499 | SWIFT_VERSION = 5.0;
500 | VERSIONING_SYSTEM = "apple-generic";
501 | };
502 | name = Debug;
503 | };
504 | 97C147071CF9000F007C117D /* Release */ = {
505 | isa = XCBuildConfiguration;
506 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
507 | buildSettings = {
508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
509 | CLANG_ENABLE_MODULES = YES;
510 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
511 | DEVELOPMENT_TEAM = 8A2JX5NC8U;
512 | ENABLE_BITCODE = NO;
513 | INFOPLIST_FILE = Runner/Info.plist;
514 | LD_RUNPATH_SEARCH_PATHS = (
515 | "$(inherited)",
516 | "@executable_path/Frameworks",
517 | );
518 | PRODUCT_BUNDLE_IDENTIFIER = net.codexdev.flutterAlarmClock;
519 | PRODUCT_NAME = "$(TARGET_NAME)";
520 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
521 | SWIFT_VERSION = 5.0;
522 | VERSIONING_SYSTEM = "apple-generic";
523 | };
524 | name = Release;
525 | };
526 | /* End XCBuildConfiguration section */
527 |
528 | /* Begin XCConfigurationList section */
529 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
530 | isa = XCConfigurationList;
531 | buildConfigurations = (
532 | 97C147031CF9000F007C117D /* Debug */,
533 | 97C147041CF9000F007C117D /* Release */,
534 | 249021D3217E4FDB00AE95B9 /* Profile */,
535 | );
536 | defaultConfigurationIsVisible = 0;
537 | defaultConfigurationName = Release;
538 | };
539 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
540 | isa = XCConfigurationList;
541 | buildConfigurations = (
542 | 97C147061CF9000F007C117D /* Debug */,
543 | 97C147071CF9000F007C117D /* Release */,
544 | 249021D4217E4FDB00AE95B9 /* Profile */,
545 | );
546 | defaultConfigurationIsVisible = 0;
547 | defaultConfigurationName = Release;
548 | };
549 | /* End XCConfigurationList section */
550 | };
551 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
552 | }
553 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | 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.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Flutter Alarm Clock
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_alarm_clock
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios/a_long_cold_sting.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/ios/a_long_cold_sting.wav
--------------------------------------------------------------------------------
/lib/alarm_helper.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_alarm_clock/app/data/models/alarm_info.dart';
2 | import 'package:sqflite/sqflite.dart';
3 |
4 | final String tableAlarm = 'alarm';
5 | final String columnId = 'id';
6 | final String columnTitle = 'title';
7 | final String columnDateTime = 'alarmDateTime';
8 | final String columnPending = 'isPending';
9 | final String columnColorIndex = 'gradientColorIndex';
10 |
11 | class AlarmHelper {
12 | static Database? _database;
13 | static AlarmHelper? _alarmHelper;
14 |
15 | AlarmHelper._createInstance();
16 | factory AlarmHelper() {
17 | if (_alarmHelper == null) {
18 | _alarmHelper = AlarmHelper._createInstance();
19 | }
20 | return _alarmHelper!;
21 | }
22 |
23 | Future get database async {
24 | if (_database == null) {
25 | _database = await initializeDatabase();
26 | }
27 | return _database!;
28 | }
29 |
30 | Future initializeDatabase() async {
31 | var dir = await getDatabasesPath();
32 | var path = dir + "alarm.db";
33 |
34 | var database = await openDatabase(
35 | path,
36 | version: 1,
37 | onCreate: (db, version) {
38 | db.execute('''
39 | create table $tableAlarm (
40 | $columnId integer primary key autoincrement,
41 | $columnTitle text not null,
42 | $columnDateTime text not null,
43 | $columnPending integer,
44 | $columnColorIndex integer)
45 | ''');
46 | },
47 | );
48 | return database;
49 | }
50 |
51 | void insertAlarm(AlarmInfo alarmInfo) async {
52 | var db = await this.database;
53 | var result = await db.insert(tableAlarm, alarmInfo.toMap());
54 | print('result : $result');
55 | }
56 |
57 | Future> getAlarms() async {
58 | List _alarms = [];
59 |
60 | var db = await this.database;
61 | var result = await db.query(tableAlarm);
62 | result.forEach((element) {
63 | var alarmInfo = AlarmInfo.fromMap(element);
64 | _alarms.add(alarmInfo);
65 | });
66 |
67 | return _alarms;
68 | }
69 |
70 | Future delete(int? id) async {
71 | var db = await this.database;
72 | return await db.delete(tableAlarm, where: '$columnId = ?', whereArgs: [id]);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/app/data/data.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_alarm_clock/app/data/enums.dart';
2 | import 'package:flutter_alarm_clock/app/data/models/alarm_info.dart';
3 | import 'package:flutter_alarm_clock/app/data/models/menu_info.dart';
4 |
5 | List menuItems = [
6 | MenuInfo(MenuType.clock, title: 'Clock', imageSource: 'assets/clock_icon.png'),
7 | MenuInfo(MenuType.alarm, title: 'Alarm', imageSource: 'assets/alarm_icon.png'),
8 | MenuInfo(MenuType.timer, title: 'Timer', imageSource: 'assets/timer_icon.png'),
9 | MenuInfo(MenuType.stopwatch, title: 'Stopwatch', imageSource: 'assets/stopwatch_icon.png'),
10 | ];
11 |
12 | List alarms = [
13 | AlarmInfo(alarmDateTime: DateTime.now().add(Duration(hours: 1)), title: 'Office', gradientColorIndex: 0),
14 | AlarmInfo(alarmDateTime: DateTime.now().add(Duration(hours: 2)), title: 'Sport', gradientColorIndex: 1),
15 | ];
16 |
--------------------------------------------------------------------------------
/lib/app/data/enums.dart:
--------------------------------------------------------------------------------
1 | enum MenuType { clock, alarm, timer, stopwatch }
2 |
--------------------------------------------------------------------------------
/lib/app/data/models/alarm_info.dart:
--------------------------------------------------------------------------------
1 | class AlarmInfo {
2 | int? id;
3 | String? title;
4 | DateTime? alarmDateTime;
5 | bool? isPending;
6 | int? gradientColorIndex;
7 |
8 | AlarmInfo(
9 | {this.id,
10 | this.title,
11 | this.alarmDateTime,
12 | this.isPending,
13 | this.gradientColorIndex});
14 |
15 | factory AlarmInfo.fromMap(Map json) => AlarmInfo(
16 | id: json["id"],
17 | title: json["title"],
18 | alarmDateTime: DateTime.parse(json["alarmDateTime"]),
19 | isPending: json["isPending"],
20 | gradientColorIndex: json["gradientColorIndex"],
21 | );
22 | Map toMap() => {
23 | "id": id,
24 | "title": title,
25 | "alarmDateTime": alarmDateTime!.toIso8601String(),
26 | "isPending": isPending,
27 | "gradientColorIndex": gradientColorIndex,
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/lib/app/data/models/menu_info.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter_alarm_clock/app/data/enums.dart';
3 |
4 | class MenuInfo extends ChangeNotifier {
5 | MenuType menuType;
6 | String? title;
7 | String? imageSource;
8 |
9 | MenuInfo(this.menuType, {this.title, this.imageSource});
10 |
11 | updateMenu(MenuInfo menuInfo) {
12 | this.menuType = menuInfo.menuType;
13 | this.title = menuInfo.title;
14 | this.imageSource = menuInfo.imageSource;
15 |
16 | //Important
17 | notifyListeners();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/app/data/theme_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class CustomColors {
4 | static Color primaryTextColor = Colors.white;
5 | static Color dividerColor = Colors.white54;
6 | static Color pageBackgroundColor = Color(0xFF2D2F41);
7 | static Color menuBackgroundColor = Color(0xFF242634);
8 |
9 | static Color clockBG = Color(0xFF444974);
10 | static Color clockOutline = Color(0xFFEAECFF);
11 | static Color? secHandColor = Colors.orange[300];
12 | static Color minHandStatColor = Color(0xFF748EF6);
13 | static Color minHandEndColor = Color(0xFF77DDFF);
14 | static Color hourHandStatColor = Color(0xFFC279FB);
15 | static Color hourHandEndColor = Color(0xFFEA74AB);
16 | }
17 |
18 | class GradientColors {
19 | final List colors;
20 | GradientColors(this.colors);
21 |
22 | static List sky = [Color(0xFF6448FE), Color(0xFF5FC6FF)];
23 | static List sunset = [Color(0xFFFE6197), Color(0xFFFFB463)];
24 | static List sea = [Color(0xFF61A3FE), Color(0xFF63FFD5)];
25 | static List mango = [Color(0xFFFFA738), Color(0xFFFFE130)];
26 | static List fire = [Color(0xFFFF5DCD), Color(0xFFFF8484)];
27 | }
28 |
29 | class GradientTemplate {
30 | static List gradientTemplate = [
31 | GradientColors(GradientColors.sky),
32 | GradientColors(GradientColors.sunset),
33 | GradientColors(GradientColors.sea),
34 | GradientColors(GradientColors.mango),
35 | GradientColors(GradientColors.fire),
36 | ];
37 | }
38 |
--------------------------------------------------------------------------------
/lib/app/modules/views/alarm_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_alarm_clock/alarm_helper.dart';
2 | import 'package:flutter_alarm_clock/app/data/theme_data.dart';
3 | import 'package:flutter_alarm_clock/app/data/models/alarm_info.dart';
4 | import 'package:dotted_border/dotted_border.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter_local_notifications/flutter_local_notifications.dart';
7 | import 'package:intl/intl.dart';
8 | import 'package:timezone/timezone.dart' as tz;
9 | import 'package:flutter_alarm_clock/main.dart';
10 |
11 | class AlarmPage extends StatefulWidget {
12 | @override
13 | _AlarmPageState createState() => _AlarmPageState();
14 | }
15 |
16 | class _AlarmPageState extends State {
17 | DateTime? _alarmTime;
18 | late String _alarmTimeString;
19 | bool _isRepeatSelected = false;
20 | AlarmHelper _alarmHelper = AlarmHelper();
21 | Future>? _alarms;
22 | List? _currentAlarms;
23 |
24 | @override
25 | void initState() {
26 | _alarmTime = DateTime.now();
27 | _alarmHelper.initializeDatabase().then((value) {
28 | print('------database intialized');
29 | loadAlarms();
30 | });
31 | super.initState();
32 | }
33 |
34 | void loadAlarms() {
35 | _alarms = _alarmHelper.getAlarms();
36 | if (mounted) setState(() {});
37 | }
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | return Container(
42 | padding: EdgeInsets.symmetric(horizontal: 32, vertical: 64),
43 | child: Column(
44 | crossAxisAlignment: CrossAxisAlignment.start,
45 | children: [
46 | Text(
47 | 'Alarm',
48 | style:
49 | TextStyle(fontFamily: 'avenir', fontWeight: FontWeight.w700, color: CustomColors.primaryTextColor, fontSize: 24),
50 | ),
51 | Expanded(
52 | child: FutureBuilder>(
53 | future: _alarms,
54 | builder: (context, snapshot) {
55 | if (snapshot.hasData) {
56 | _currentAlarms = snapshot.data;
57 | return ListView(
58 | children: snapshot.data!.map((alarm) {
59 | var alarmTime = DateFormat('hh:mm aa').format(alarm.alarmDateTime!);
60 | var gradientColor = GradientTemplate.gradientTemplate[alarm.gradientColorIndex!].colors;
61 | return Container(
62 | margin: const EdgeInsets.only(bottom: 32),
63 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
64 | decoration: BoxDecoration(
65 | gradient: LinearGradient(
66 | colors: gradientColor,
67 | begin: Alignment.centerLeft,
68 | end: Alignment.centerRight,
69 | ),
70 | boxShadow: [
71 | BoxShadow(
72 | color: gradientColor.last.withOpacity(0.4),
73 | blurRadius: 8,
74 | spreadRadius: 2,
75 | offset: Offset(4, 4),
76 | ),
77 | ],
78 | borderRadius: BorderRadius.all(Radius.circular(24)),
79 | ),
80 | child: Column(
81 | crossAxisAlignment: CrossAxisAlignment.start,
82 | children: [
83 | Row(
84 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
85 | children: [
86 | Row(
87 | children: [
88 | Icon(
89 | Icons.label,
90 | color: Colors.white,
91 | size: 24,
92 | ),
93 | SizedBox(width: 8),
94 | Text(
95 | alarm.title!,
96 | style: TextStyle(color: Colors.white, fontFamily: 'avenir'),
97 | ),
98 | ],
99 | ),
100 | Switch(
101 | onChanged: (bool value) {},
102 | value: true,
103 | activeColor: Colors.white,
104 | ),
105 | ],
106 | ),
107 | Text(
108 | 'Mon-Fri',
109 | style: TextStyle(color: Colors.white, fontFamily: 'avenir'),
110 | ),
111 | Row(
112 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
113 | children: [
114 | Text(
115 | alarmTime,
116 | style: TextStyle(
117 | color: Colors.white, fontFamily: 'avenir', fontSize: 24, fontWeight: FontWeight.w700),
118 | ),
119 | IconButton(
120 | icon: Icon(Icons.delete),
121 | color: Colors.white,
122 | onPressed: () {
123 | deleteAlarm(alarm.id);
124 | }),
125 | ],
126 | ),
127 | ],
128 | ),
129 | );
130 | }).followedBy([
131 | if (_currentAlarms!.length < 5)
132 | DottedBorder(
133 | strokeWidth: 2,
134 | color: CustomColors.clockOutline,
135 | borderType: BorderType.RRect,
136 | radius: Radius.circular(24),
137 | dashPattern: [5, 4],
138 | child: Container(
139 | width: double.infinity,
140 | decoration: BoxDecoration(
141 | color: CustomColors.clockBG,
142 | borderRadius: BorderRadius.all(Radius.circular(24)),
143 | ),
144 | child: MaterialButton(
145 | padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
146 | onPressed: () {
147 | _alarmTimeString = DateFormat('HH:mm').format(DateTime.now());
148 | showModalBottomSheet(
149 | useRootNavigator: true,
150 | context: context,
151 | clipBehavior: Clip.antiAlias,
152 | shape: RoundedRectangleBorder(
153 | borderRadius: BorderRadius.vertical(
154 | top: Radius.circular(24),
155 | ),
156 | ),
157 | builder: (context) {
158 | return StatefulBuilder(
159 | builder: (context, setModalState) {
160 | return Container(
161 | padding: const EdgeInsets.all(32),
162 | child: Column(
163 | children: [
164 | TextButton(
165 | onPressed: () async {
166 | var selectedTime = await showTimePicker(
167 | context: context,
168 | initialTime: TimeOfDay.now(),
169 | );
170 | if (selectedTime != null) {
171 | final now = DateTime.now();
172 | var selectedDateTime = DateTime(
173 | now.year, now.month, now.day, selectedTime.hour, selectedTime.minute);
174 | _alarmTime = selectedDateTime;
175 | setModalState(() {
176 | _alarmTimeString = DateFormat('HH:mm').format(selectedDateTime);
177 | });
178 | }
179 | },
180 | child: Text(
181 | _alarmTimeString,
182 | style: TextStyle(fontSize: 32),
183 | ),
184 | ),
185 | ListTile(
186 | title: Text('Repeat'),
187 | trailing: Switch(
188 | onChanged: (value) {
189 | setModalState(() {
190 | _isRepeatSelected = value;
191 | });
192 | },
193 | value: _isRepeatSelected,
194 | ),
195 | ),
196 | ListTile(
197 | title: Text('Sound'),
198 | trailing: Icon(Icons.arrow_forward_ios),
199 | ),
200 | ListTile(
201 | title: Text('Title'),
202 | trailing: Icon(Icons.arrow_forward_ios),
203 | ),
204 | FloatingActionButton.extended(
205 | onPressed: () {
206 | onSaveAlarm(_isRepeatSelected);
207 | },
208 | icon: Icon(Icons.alarm),
209 | label: Text('Save'),
210 | ),
211 | ],
212 | ),
213 | );
214 | },
215 | );
216 | },
217 | );
218 | // scheduleAlarm();
219 | },
220 | child: Column(
221 | children: [
222 | Image.asset(
223 | 'assets/add_alarm.png',
224 | scale: 1.5,
225 | ),
226 | SizedBox(height: 8),
227 | Text(
228 | 'Add Alarm',
229 | style: TextStyle(color: Colors.white, fontFamily: 'avenir'),
230 | ),
231 | ],
232 | ),
233 | ),
234 | ),
235 | )
236 | else
237 | Center(
238 | child: Text(
239 | 'Only 5 alarms allowed!',
240 | style: TextStyle(color: Colors.white),
241 | )),
242 | ]).toList(),
243 | );
244 | }
245 | return Center(
246 | child: Text(
247 | 'Loading..',
248 | style: TextStyle(color: Colors.white),
249 | ),
250 | );
251 | },
252 | ),
253 | ),
254 | ],
255 | ),
256 | );
257 | }
258 |
259 | void scheduleAlarm(DateTime scheduledNotificationDateTime, AlarmInfo alarmInfo, {required bool isRepeating}) async {
260 | var androidPlatformChannelSpecifics = AndroidNotificationDetails(
261 | 'alarm_notif',
262 | 'alarm_notif',
263 | channelDescription: 'Channel for Alarm notification',
264 | icon: 'codex_logo',
265 | sound: RawResourceAndroidNotificationSound('a_long_cold_sting'),
266 | largeIcon: DrawableResourceAndroidBitmap('codex_logo'),
267 | );
268 |
269 | var iOSPlatformChannelSpecifics = IOSNotificationDetails(
270 | sound: 'a_long_cold_sting.wav',
271 | presentAlert: true,
272 | presentBadge: true,
273 | presentSound: true,
274 | );
275 | var platformChannelSpecifics = NotificationDetails(
276 | android: androidPlatformChannelSpecifics,
277 | iOS: iOSPlatformChannelSpecifics,
278 | );
279 |
280 | if (isRepeating)
281 | await flutterLocalNotificationsPlugin.showDailyAtTime(
282 | 0,
283 | 'Office',
284 | alarmInfo.title,
285 | Time(
286 | scheduledNotificationDateTime.hour,
287 | scheduledNotificationDateTime.minute,
288 | scheduledNotificationDateTime.second,
289 | ),
290 | platformChannelSpecifics,
291 | );
292 | else
293 | await flutterLocalNotificationsPlugin.zonedSchedule(
294 | 0,
295 | 'Office',
296 | alarmInfo.title,
297 | tz.TZDateTime.from(scheduledNotificationDateTime, tz.local),
298 | platformChannelSpecifics,
299 | androidAllowWhileIdle: true,
300 | uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime,
301 | );
302 | }
303 |
304 | void onSaveAlarm(bool _isRepeating) {
305 | DateTime? scheduleAlarmDateTime;
306 | if (_alarmTime!.isAfter(DateTime.now()))
307 | scheduleAlarmDateTime = _alarmTime;
308 | else
309 | scheduleAlarmDateTime = _alarmTime!.add(Duration(days: 1));
310 |
311 | var alarmInfo = AlarmInfo(
312 | alarmDateTime: scheduleAlarmDateTime,
313 | gradientColorIndex: _currentAlarms!.length,
314 | title: 'alarm',
315 | );
316 | _alarmHelper.insertAlarm(alarmInfo);
317 | if (scheduleAlarmDateTime != null) {
318 | scheduleAlarm(scheduleAlarmDateTime, alarmInfo, isRepeating: _isRepeating);
319 | }
320 | Navigator.pop(context);
321 | loadAlarms();
322 | }
323 |
324 | void deleteAlarm(int? id) {
325 | _alarmHelper.delete(id);
326 | //unsubscribe for notification
327 | loadAlarms();
328 | }
329 | }
330 |
--------------------------------------------------------------------------------
/lib/app/modules/views/clock_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_alarm_clock/app/data/theme_data.dart';
4 | import 'package:intl/intl.dart';
5 |
6 | import 'clockview.dart';
7 |
8 | class ClockPage extends StatefulWidget {
9 | @override
10 | _ClockPageState createState() => _ClockPageState();
11 | }
12 |
13 | class _ClockPageState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | var now = DateTime.now();
17 |
18 | var formattedDate = DateFormat('EEE, d MMM').format(now);
19 | var timezoneString = now.timeZoneOffset.toString().split('.').first;
20 | var offsetSign = '';
21 | if (!timezoneString.startsWith('-')) offsetSign = '+';
22 |
23 | return Container(
24 | padding: EdgeInsets.symmetric(horizontal: 32, vertical: 64),
25 | child: Column(
26 | crossAxisAlignment: CrossAxisAlignment.start,
27 | children: [
28 | Flexible(
29 | flex: 1,
30 | fit: FlexFit.tight,
31 | child: Text(
32 | 'Clock',
33 | style: TextStyle(
34 | fontFamily: 'avenir', fontWeight: FontWeight.w700, color: CustomColors.primaryTextColor, fontSize: 24),
35 | ),
36 | ),
37 | Flexible(
38 | flex: 2,
39 | child: Column(
40 | crossAxisAlignment: CrossAxisAlignment.start,
41 | children: [
42 | DigitalClockWidget(),
43 | Text(
44 | formattedDate,
45 | style: TextStyle(
46 | fontFamily: 'avenir', fontWeight: FontWeight.w300, color: CustomColors.primaryTextColor, fontSize: 20),
47 | ),
48 | ],
49 | ),
50 | ),
51 | Flexible(
52 | flex: 4,
53 | fit: FlexFit.tight,
54 | child: Align(
55 | alignment: Alignment.center,
56 | child: ClockView(
57 | size: MediaQuery.of(context).size.height / 4,
58 | ),
59 | ),
60 | ),
61 | Flexible(
62 | flex: 2,
63 | fit: FlexFit.tight,
64 | child: Column(
65 | crossAxisAlignment: CrossAxisAlignment.start,
66 | children: [
67 | Text(
68 | 'Timezone',
69 | style: TextStyle(
70 | fontFamily: 'avenir', fontWeight: FontWeight.w500, color: CustomColors.primaryTextColor, fontSize: 24),
71 | ),
72 | SizedBox(height: 16),
73 | Row(
74 | children: [
75 | Icon(
76 | Icons.language,
77 | color: CustomColors.primaryTextColor,
78 | ),
79 | SizedBox(width: 16),
80 | Text(
81 | 'UTC' + offsetSign + timezoneString,
82 | style: TextStyle(fontFamily: 'avenir', color: CustomColors.primaryTextColor, fontSize: 14),
83 | ),
84 | ],
85 | ),
86 | ],
87 | ),
88 | ),
89 | ],
90 | ),
91 | );
92 | }
93 | }
94 |
95 | class DigitalClockWidget extends StatefulWidget {
96 | const DigitalClockWidget({
97 | Key? key,
98 | }) : super(key: key);
99 | @override
100 | State createState() {
101 | return DigitalClockWidgetState();
102 | }
103 | }
104 |
105 | class DigitalClockWidgetState extends State {
106 | var formattedTime = DateFormat('HH:mm').format(DateTime.now());
107 | late Timer timer;
108 |
109 | @override
110 | void initState() {
111 | this.timer = Timer.periodic(Duration(seconds: 1), (timer) {
112 | var perviousMinute = DateTime.now().add(Duration(seconds: -1)).minute;
113 | var currentMinute = DateTime.now().minute;
114 | if (perviousMinute != currentMinute)
115 | setState(() {
116 | formattedTime = DateFormat('HH:mm').format(DateTime.now());
117 | });
118 | });
119 | super.initState();
120 | }
121 |
122 | @override
123 | void dispose() {
124 | this.timer.cancel();
125 | super.dispose();
126 | }
127 |
128 | @override
129 | Widget build(BuildContext context) {
130 | print('=====>digital clock updated');
131 | return Text(
132 | formattedTime,
133 | style: TextStyle(fontFamily: 'avenir', color: CustomColors.primaryTextColor, fontSize: 64),
134 | );
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/lib/app/modules/views/clockview.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:math';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_alarm_clock/app/data/theme_data.dart';
5 |
6 | class ClockView extends StatefulWidget {
7 | final double? size;
8 |
9 | const ClockView({Key? key, this.size}) : super(key: key);
10 |
11 | @override
12 | _ClockViewState createState() => _ClockViewState();
13 | }
14 |
15 | class _ClockViewState extends State {
16 | late Timer timer;
17 |
18 | @override
19 | void initState() {
20 | this.timer = Timer.periodic(Duration(seconds: 1), (timer) {
21 | setState(() {});
22 | });
23 | super.initState();
24 | }
25 |
26 | @override
27 | void dispose() {
28 | this.timer.cancel();
29 | super.dispose();
30 | }
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | return Align(
35 | alignment: Alignment.topCenter,
36 | child: Container(
37 | width: widget.size,
38 | height: widget.size,
39 | child: Transform.rotate(
40 | angle: -pi / 2,
41 | child: CustomPaint(
42 | painter: ClockPainter(),
43 | ),
44 | ),
45 | ),
46 | );
47 | }
48 | }
49 |
50 | class ClockPainter extends CustomPainter {
51 | var dateTime = DateTime.now();
52 |
53 | //60sec - 360, 1 sec - 6degrees
54 | //60min - 360, 1 min - 6degrees
55 | //12hours - 360, 1 hour - 30degrees, 60min - 30degrees, 1 min - 0.5degrees
56 |
57 | @override
58 | void paint(Canvas canvas, Size size) {
59 | var centerX = size.width / 2;
60 | var centerY = size.height / 2;
61 | var center = Offset(centerX, centerY);
62 | var radius = min(centerX, centerY);
63 |
64 | var fillBrush = Paint()..color = CustomColors.clockBG;
65 | var outlineBrush = Paint()
66 | ..color = CustomColors.clockOutline
67 | ..style = PaintingStyle.stroke
68 | ..strokeWidth = size.width / 20;
69 | var centerDotBrush = Paint()..color = CustomColors.clockOutline;
70 |
71 | var secHandBrush = Paint()
72 | ..color = CustomColors.secHandColor!
73 | ..style = PaintingStyle.stroke
74 | ..strokeCap = StrokeCap.round
75 | ..strokeWidth = size.width / 60;
76 |
77 | var minHandBrush = Paint()
78 | ..shader = RadialGradient(colors: [CustomColors.minHandStatColor, CustomColors.minHandEndColor])
79 | .createShader(Rect.fromCircle(center: center, radius: radius))
80 | ..style = PaintingStyle.stroke
81 | ..strokeCap = StrokeCap.round
82 | ..strokeWidth = size.width / 30;
83 |
84 | var hourHandBrush = Paint()
85 | ..shader = RadialGradient(colors: [CustomColors.hourHandStatColor, CustomColors.hourHandEndColor])
86 | .createShader(Rect.fromCircle(center: center, radius: radius))
87 | ..style = PaintingStyle.stroke
88 | ..strokeCap = StrokeCap.round
89 | ..strokeWidth = size.width / 24;
90 |
91 | var dashBrush = Paint()
92 | ..color = CustomColors.clockOutline
93 | ..style = PaintingStyle.stroke
94 | ..strokeWidth = 1;
95 |
96 | canvas.drawCircle(center, radius * 0.75, fillBrush);
97 | canvas.drawCircle(center, radius * 0.75, outlineBrush);
98 |
99 | var hourHandX = centerX + radius * 0.4 * cos((dateTime.hour * 30 + dateTime.minute * 0.5) * pi / 180);
100 | var hourHandY = centerY + radius * 0.4 * sin((dateTime.hour * 30 + dateTime.minute * 0.5) * pi / 180);
101 | canvas.drawLine(center, Offset(hourHandX, hourHandY), hourHandBrush);
102 |
103 | var minHandX = centerX + radius * 0.6 * cos(dateTime.minute * 6 * pi / 180);
104 | var minHandY = centerY + radius * 0.6 * sin(dateTime.minute * 6 * pi / 180);
105 | canvas.drawLine(center, Offset(minHandX, minHandY), minHandBrush);
106 |
107 | var secHandX = centerX + radius * 0.6 * cos(dateTime.second * 6 * pi / 180);
108 | var secHandY = centerY + radius * 0.6 * sin(dateTime.second * 6 * pi / 180);
109 | canvas.drawLine(center, Offset(secHandX, secHandY), secHandBrush);
110 |
111 | canvas.drawCircle(center, radius * 0.12, centerDotBrush);
112 |
113 | var outerRadius = radius;
114 | var innerRadius = radius * 0.9;
115 | for (var i = 0; i < 360; i += 12) {
116 | var x1 = centerX + outerRadius * cos(i * pi / 180);
117 | var y1 = centerY + outerRadius * sin(i * pi / 180);
118 |
119 | var x2 = centerX + innerRadius * cos(i * pi / 180);
120 | var y2 = centerY + innerRadius * sin(i * pi / 180);
121 | canvas.drawLine(Offset(x1, y1), Offset(x2, y2), dashBrush);
122 | }
123 | }
124 |
125 | @override
126 | bool shouldRepaint(CustomPainter oldDelegate) {
127 | return true;
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/lib/app/modules/views/homepage.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_alarm_clock/app/data/data.dart';
3 | import 'package:flutter_alarm_clock/app/data/enums.dart';
4 | import 'package:flutter_alarm_clock/app/data/models/menu_info.dart';
5 | import 'package:flutter_alarm_clock/app/data/theme_data.dart';
6 | import 'package:flutter_alarm_clock/app/modules/views/alarm_page.dart';
7 | import 'package:flutter_alarm_clock/app/modules/views/clock_page.dart';
8 | import 'package:provider/provider.dart';
9 |
10 | class HomePage extends StatefulWidget {
11 | @override
12 | _HomePageState createState() => _HomePageState();
13 | }
14 |
15 | class _HomePageState extends State {
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | backgroundColor: CustomColors.pageBackgroundColor,
20 | body: Row(
21 | children: [
22 | Column(
23 | mainAxisAlignment: MainAxisAlignment.center,
24 | children: menuItems.map((currentMenuInfo) => buildMenuButton(currentMenuInfo)).toList(),
25 | ),
26 | VerticalDivider(
27 | color: CustomColors.dividerColor,
28 | width: 1,
29 | ),
30 | Expanded(
31 | child: Consumer(
32 | builder: (BuildContext context, MenuInfo value, Widget? child) {
33 | if (value.menuType == MenuType.clock)
34 | return ClockPage();
35 | else if (value.menuType == MenuType.alarm)
36 | return AlarmPage();
37 | else
38 | return Container(
39 | child: RichText(
40 | text: TextSpan(
41 | style: TextStyle(fontSize: 20),
42 | children: [
43 | TextSpan(text: 'Upcoming Tutorial\n'),
44 | TextSpan(
45 | text: value.title,
46 | style: TextStyle(fontSize: 48),
47 | ),
48 | ],
49 | ),
50 | ),
51 | );
52 | },
53 | ),
54 | ),
55 | ],
56 | ),
57 | );
58 | }
59 |
60 | Widget buildMenuButton(MenuInfo currentMenuInfo) {
61 | return Consumer(
62 | builder: (BuildContext context, MenuInfo value, Widget? child) {
63 | return MaterialButton(
64 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(topRight: Radius.circular(32))),
65 | padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 0),
66 | color: currentMenuInfo.menuType == value.menuType ? CustomColors.menuBackgroundColor : CustomColors.pageBackgroundColor,
67 | onPressed: () {
68 | var menuInfo = Provider.of(context, listen: false);
69 | menuInfo.updateMenu(currentMenuInfo);
70 | },
71 | child: Column(
72 | children: [
73 | Image.asset(
74 | currentMenuInfo.imageSource!,
75 | scale: 1.5,
76 | ),
77 | SizedBox(height: 16),
78 | Text(
79 | currentMenuInfo.title ?? '',
80 | style: TextStyle(fontFamily: 'avenir', color: CustomColors.primaryTextColor, fontSize: 14),
81 | ),
82 | ],
83 | ),
84 | );
85 | },
86 | );
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_local_notifications/flutter_local_notifications.dart';
3 | import 'package:provider/provider.dart';
4 | import 'app/data/enums.dart';
5 | import 'app/data/models/menu_info.dart';
6 | import 'app/modules/views/homepage.dart';
7 |
8 | final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
9 |
10 | void main() async {
11 | WidgetsFlutterBinding.ensureInitialized();
12 |
13 | var initializationSettingsAndroid = AndroidInitializationSettings('codex_logo');
14 | var initializationSettingsIOS = IOSInitializationSettings(
15 | requestAlertPermission: true,
16 | requestBadgePermission: true,
17 | requestSoundPermission: true,
18 | onDidReceiveLocalNotification: (int id, String? title, String? body, String? payload) async {});
19 | var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
20 | await flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: (String? payload) async {
21 | if (payload != null) {
22 | debugPrint('notification payload: ' + payload);
23 | }
24 | });
25 | runApp(
26 | MaterialApp(
27 | title: 'Flutter Demo',
28 | theme: ThemeData(
29 | primarySwatch: Colors.blue,
30 | visualDensity: VisualDensity.adaptivePlatformDensity,
31 | ),
32 | home: ChangeNotifierProvider(
33 | create: (context) => MenuInfo(MenuType.clock),
34 | child: HomePage(),
35 | ),
36 | ),
37 | );
38 | }
39 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | args:
5 | dependency: transitive
6 | description:
7 | name: args
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.3.1"
11 | async:
12 | dependency: transitive
13 | description:
14 | name: async
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.8.2"
18 | boolean_selector:
19 | dependency: transitive
20 | description:
21 | name: boolean_selector
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.1.0"
25 | characters:
26 | dependency: transitive
27 | description:
28 | name: characters
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.2.0"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.3.1"
39 | clock:
40 | dependency: transitive
41 | description:
42 | name: clock
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.1.0"
46 | collection:
47 | dependency: transitive
48 | description:
49 | name: collection
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.15.0"
53 | cupertino_icons:
54 | dependency: "direct main"
55 | description:
56 | name: cupertino_icons
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.0.5"
60 | dbus:
61 | dependency: transitive
62 | description:
63 | name: dbus
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "0.7.3"
67 | dotted_border:
68 | dependency: "direct main"
69 | description:
70 | name: dotted_border
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "2.0.0+2"
74 | fake_async:
75 | dependency: transitive
76 | description:
77 | name: fake_async
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "1.2.0"
81 | ffi:
82 | dependency: transitive
83 | description:
84 | name: ffi
85 | url: "https://pub.dartlang.org"
86 | source: hosted
87 | version: "1.2.1"
88 | file:
89 | dependency: transitive
90 | description:
91 | name: file
92 | url: "https://pub.dartlang.org"
93 | source: hosted
94 | version: "6.1.2"
95 | flutter:
96 | dependency: "direct main"
97 | description: flutter
98 | source: sdk
99 | version: "0.0.0"
100 | flutter_lints:
101 | dependency: "direct dev"
102 | description:
103 | name: flutter_lints
104 | url: "https://pub.dartlang.org"
105 | source: hosted
106 | version: "1.0.4"
107 | flutter_local_notifications:
108 | dependency: "direct main"
109 | description:
110 | name: flutter_local_notifications
111 | url: "https://pub.dartlang.org"
112 | source: hosted
113 | version: "9.5.3+1"
114 | flutter_local_notifications_linux:
115 | dependency: transitive
116 | description:
117 | name: flutter_local_notifications_linux
118 | url: "https://pub.dartlang.org"
119 | source: hosted
120 | version: "0.4.2"
121 | flutter_local_notifications_platform_interface:
122 | dependency: transitive
123 | description:
124 | name: flutter_local_notifications_platform_interface
125 | url: "https://pub.dartlang.org"
126 | source: hosted
127 | version: "5.0.0"
128 | flutter_test:
129 | dependency: "direct dev"
130 | description: flutter
131 | source: sdk
132 | version: "0.0.0"
133 | intl:
134 | dependency: "direct main"
135 | description:
136 | name: intl
137 | url: "https://pub.dartlang.org"
138 | source: hosted
139 | version: "0.17.0"
140 | lints:
141 | dependency: transitive
142 | description:
143 | name: lints
144 | url: "https://pub.dartlang.org"
145 | source: hosted
146 | version: "1.0.1"
147 | matcher:
148 | dependency: transitive
149 | description:
150 | name: matcher
151 | url: "https://pub.dartlang.org"
152 | source: hosted
153 | version: "0.12.11"
154 | material_color_utilities:
155 | dependency: transitive
156 | description:
157 | name: material_color_utilities
158 | url: "https://pub.dartlang.org"
159 | source: hosted
160 | version: "0.1.3"
161 | meta:
162 | dependency: transitive
163 | description:
164 | name: meta
165 | url: "https://pub.dartlang.org"
166 | source: hosted
167 | version: "1.7.0"
168 | nested:
169 | dependency: transitive
170 | description:
171 | name: nested
172 | url: "https://pub.dartlang.org"
173 | source: hosted
174 | version: "1.0.0"
175 | path:
176 | dependency: transitive
177 | description:
178 | name: path
179 | url: "https://pub.dartlang.org"
180 | source: hosted
181 | version: "1.8.0"
182 | path_drawing:
183 | dependency: transitive
184 | description:
185 | name: path_drawing
186 | url: "https://pub.dartlang.org"
187 | source: hosted
188 | version: "1.0.0"
189 | path_parsing:
190 | dependency: transitive
191 | description:
192 | name: path_parsing
193 | url: "https://pub.dartlang.org"
194 | source: hosted
195 | version: "1.0.0"
196 | petitparser:
197 | dependency: transitive
198 | description:
199 | name: petitparser
200 | url: "https://pub.dartlang.org"
201 | source: hosted
202 | version: "4.4.0"
203 | platform:
204 | dependency: transitive
205 | description:
206 | name: platform
207 | url: "https://pub.dartlang.org"
208 | source: hosted
209 | version: "3.1.0"
210 | plugin_platform_interface:
211 | dependency: transitive
212 | description:
213 | name: plugin_platform_interface
214 | url: "https://pub.dartlang.org"
215 | source: hosted
216 | version: "2.1.2"
217 | process:
218 | dependency: transitive
219 | description:
220 | name: process
221 | url: "https://pub.dartlang.org"
222 | source: hosted
223 | version: "4.2.4"
224 | provider:
225 | dependency: "direct main"
226 | description:
227 | name: provider
228 | url: "https://pub.dartlang.org"
229 | source: hosted
230 | version: "6.0.3"
231 | sky_engine:
232 | dependency: transitive
233 | description: flutter
234 | source: sdk
235 | version: "0.0.99"
236 | source_span:
237 | dependency: transitive
238 | description:
239 | name: source_span
240 | url: "https://pub.dartlang.org"
241 | source: hosted
242 | version: "1.8.1"
243 | sqflite:
244 | dependency: "direct main"
245 | description:
246 | name: sqflite
247 | url: "https://pub.dartlang.org"
248 | source: hosted
249 | version: "2.0.2+1"
250 | sqflite_common:
251 | dependency: transitive
252 | description:
253 | name: sqflite_common
254 | url: "https://pub.dartlang.org"
255 | source: hosted
256 | version: "2.2.1+1"
257 | stack_trace:
258 | dependency: transitive
259 | description:
260 | name: stack_trace
261 | url: "https://pub.dartlang.org"
262 | source: hosted
263 | version: "1.10.0"
264 | stream_channel:
265 | dependency: transitive
266 | description:
267 | name: stream_channel
268 | url: "https://pub.dartlang.org"
269 | source: hosted
270 | version: "2.1.0"
271 | string_scanner:
272 | dependency: transitive
273 | description:
274 | name: string_scanner
275 | url: "https://pub.dartlang.org"
276 | source: hosted
277 | version: "1.1.0"
278 | synchronized:
279 | dependency: transitive
280 | description:
281 | name: synchronized
282 | url: "https://pub.dartlang.org"
283 | source: hosted
284 | version: "3.0.0+2"
285 | term_glyph:
286 | dependency: transitive
287 | description:
288 | name: term_glyph
289 | url: "https://pub.dartlang.org"
290 | source: hosted
291 | version: "1.2.0"
292 | test_api:
293 | dependency: transitive
294 | description:
295 | name: test_api
296 | url: "https://pub.dartlang.org"
297 | source: hosted
298 | version: "0.4.8"
299 | timezone:
300 | dependency: transitive
301 | description:
302 | name: timezone
303 | url: "https://pub.dartlang.org"
304 | source: hosted
305 | version: "0.8.0"
306 | typed_data:
307 | dependency: transitive
308 | description:
309 | name: typed_data
310 | url: "https://pub.dartlang.org"
311 | source: hosted
312 | version: "1.3.0"
313 | vector_math:
314 | dependency: transitive
315 | description:
316 | name: vector_math
317 | url: "https://pub.dartlang.org"
318 | source: hosted
319 | version: "2.1.1"
320 | xdg_directories:
321 | dependency: transitive
322 | description:
323 | name: xdg_directories
324 | url: "https://pub.dartlang.org"
325 | source: hosted
326 | version: "0.2.0+1"
327 | xml:
328 | dependency: transitive
329 | description:
330 | name: xml
331 | url: "https://pub.dartlang.org"
332 | source: hosted
333 | version: "5.3.1"
334 | sdks:
335 | dart: ">=2.16.2 <3.0.0"
336 | flutter: ">=2.2.0"
337 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_alarm_clock
2 | version: 1.0.0+1
3 | publish_to: none
4 | description: A new Flutter project.
5 | environment:
6 | sdk: ">=2.16.2 <3.0.0"
7 |
8 | dependencies:
9 | cupertino_icons: ^1.0.2
10 | flutter:
11 | sdk: flutter
12 |
13 | #pub.dev packages
14 | sqflite: ^2.0.2+1
15 | flutter_local_notifications: ^9.5.3+1
16 | dotted_border: ^2.0.0+2
17 | provider: ^6.0.3
18 | intl: ^0.17.0
19 |
20 | dev_dependencies:
21 | flutter_lints: ^1.0.0
22 | flutter_test:
23 | sdk: flutter
24 |
25 | flutter:
26 | uses-material-design: true
27 | assets:
28 | - assets/
29 | fonts:
30 | - family: avenir
31 | fonts:
32 | - asset: assets/fonts/Avenir-Book.ttf
33 | - asset: assets/fonts/Avenir-Heavy.ttf
34 | weight: 700
35 | - asset: assets/fonts/Avenir-Medium.ttf
36 | weight: 500
37 | - asset: assets/fonts/Avenir-Light.ttf
38 | weight: 300
39 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/test/widget_test.dart
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | flutter_alarm_clock
33 |
34 |
35 |
36 |
39 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "flutter_alarm_clock",
3 | "short_name": "flutter_alarm_clock",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(flutter_alarm_clock LANGUAGES CXX)
3 |
4 | set(BINARY_NAME "flutter_alarm_clock")
5 |
6 | cmake_policy(SET CMP0063 NEW)
7 |
8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
9 |
10 | # Configure build options.
11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
12 | if(IS_MULTICONFIG)
13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
14 | CACHE STRING "" FORCE)
15 | else()
16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
17 | set(CMAKE_BUILD_TYPE "Debug" CACHE
18 | STRING "Flutter build mode" FORCE)
19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
20 | "Debug" "Profile" "Release")
21 | endif()
22 | endif()
23 |
24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
28 |
29 | # Use Unicode for all projects.
30 | add_definitions(-DUNICODE -D_UNICODE)
31 |
32 | # Compilation settings that should be applied to most targets.
33 | function(APPLY_STANDARD_SETTINGS TARGET)
34 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
36 | target_compile_options(${TARGET} PRIVATE /EHsc)
37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
39 | endfunction()
40 |
41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
42 |
43 | # Flutter library and tool build rules.
44 | add_subdirectory(${FLUTTER_MANAGED_DIR})
45 |
46 | # Application build
47 | add_subdirectory("runner")
48 |
49 | # Generated plugin build rules, which manage building the plugins and adding
50 | # them to the application.
51 | include(flutter/generated_plugins.cmake)
52 |
53 |
54 | # === Installation ===
55 | # Support files are copied into place next to the executable, so that it can
56 | # run in place. This is done instead of making a separate bundle (as on Linux)
57 | # so that building and running from within Visual Studio will work.
58 | set(BUILD_BUNDLE_DIR "$")
59 | # Make the "install" step default, as it's required to run.
60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
63 | endif()
64 |
65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
67 |
68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
69 | COMPONENT Runtime)
70 |
71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
72 | COMPONENT Runtime)
73 |
74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
75 | COMPONENT Runtime)
76 |
77 | if(PLUGIN_BUNDLED_LIBRARIES)
78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
80 | COMPONENT Runtime)
81 | endif()
82 |
83 | # Fully re-copy the assets directory on each build to avoid having stale files
84 | # from a previous install.
85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
86 | install(CODE "
87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
88 | " COMPONENT Runtime)
89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
91 |
92 | # Install the AOT library on non-Debug builds only.
93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
94 | CONFIGURATIONS Profile;Release
95 | COMPONENT Runtime)
96 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 |
3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
4 |
5 | # Configuration provided via flutter tool.
6 | include(${EPHEMERAL_DIR}/generated_config.cmake)
7 |
8 | # TODO: Move the rest of this into files in ephemeral. See
9 | # https://github.com/flutter/flutter/issues/57146.
10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
11 |
12 | # === Flutter Library ===
13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
14 |
15 | # Published to parent scope for install step.
16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
20 |
21 | list(APPEND FLUTTER_LIBRARY_HEADERS
22 | "flutter_export.h"
23 | "flutter_windows.h"
24 | "flutter_messenger.h"
25 | "flutter_plugin_registrar.h"
26 | "flutter_texture_registrar.h"
27 | )
28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
29 | add_library(flutter INTERFACE)
30 | target_include_directories(flutter INTERFACE
31 | "${EPHEMERAL_DIR}"
32 | )
33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
34 | add_dependencies(flutter flutter_assemble)
35 |
36 | # === Wrapper ===
37 | list(APPEND CPP_WRAPPER_SOURCES_CORE
38 | "core_implementations.cc"
39 | "standard_codec.cc"
40 | )
41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
43 | "plugin_registrar.cc"
44 | )
45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
46 | list(APPEND CPP_WRAPPER_SOURCES_APP
47 | "flutter_engine.cc"
48 | "flutter_view_controller.cc"
49 | )
50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
51 |
52 | # Wrapper sources needed for a plugin.
53 | add_library(flutter_wrapper_plugin STATIC
54 | ${CPP_WRAPPER_SOURCES_CORE}
55 | ${CPP_WRAPPER_SOURCES_PLUGIN}
56 | )
57 | apply_standard_settings(flutter_wrapper_plugin)
58 | set_target_properties(flutter_wrapper_plugin PROPERTIES
59 | POSITION_INDEPENDENT_CODE ON)
60 | set_target_properties(flutter_wrapper_plugin PROPERTIES
61 | CXX_VISIBILITY_PRESET hidden)
62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
63 | target_include_directories(flutter_wrapper_plugin PUBLIC
64 | "${WRAPPER_ROOT}/include"
65 | )
66 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
67 |
68 | # Wrapper sources needed for the runner.
69 | add_library(flutter_wrapper_app STATIC
70 | ${CPP_WRAPPER_SOURCES_CORE}
71 | ${CPP_WRAPPER_SOURCES_APP}
72 | )
73 | apply_standard_settings(flutter_wrapper_app)
74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
75 | target_include_directories(flutter_wrapper_app PUBLIC
76 | "${WRAPPER_ROOT}/include"
77 | )
78 | add_dependencies(flutter_wrapper_app flutter_assemble)
79 |
80 | # === Flutter tool backend ===
81 | # _phony_ is a non-existent file to force this command to run every time,
82 | # since currently there's no way to get a full input/output list from the
83 | # flutter tool.
84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
86 | add_custom_command(
87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
89 | ${CPP_WRAPPER_SOURCES_APP}
90 | ${PHONY_OUTPUT}
91 | COMMAND ${CMAKE_COMMAND} -E env
92 | ${FLUTTER_TOOL_ENVIRONMENT}
93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
94 | windows-x64 $
95 | VERBATIM
96 | )
97 | add_custom_target(flutter_assemble DEPENDS
98 | "${FLUTTER_LIBRARY}"
99 | ${FLUTTER_LIBRARY_HEADERS}
100 | ${CPP_WRAPPER_SOURCES_CORE}
101 | ${CPP_WRAPPER_SOURCES_PLUGIN}
102 | ${CPP_WRAPPER_SOURCES_APP}
103 | )
104 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | set(PLUGIN_BUNDLED_LIBRARIES)
9 |
10 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
15 | endforeach(plugin)
16 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | add_executable(${BINARY_NAME} WIN32
5 | "flutter_window.cpp"
6 | "main.cpp"
7 | "utils.cpp"
8 | "win32_window.cpp"
9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
10 | "Runner.rc"
11 | "runner.exe.manifest"
12 | )
13 | apply_standard_settings(${BINARY_NAME})
14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
17 | add_dependencies(${BINARY_NAME} flutter_assemble)
18 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #ifdef FLUTTER_BUILD_NUMBER
64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0
67 | #endif
68 |
69 | #ifdef FLUTTER_BUILD_NAME
70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "net.codexdev" "\0"
93 | VALUE "FileDescription", "flutter_alarm_clock" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "flutter_alarm_clock" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2022 net.codexdev. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "flutter_alarm_clock.exe" "\0"
98 | VALUE "ProductName", "flutter_alarm_clock" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 | return true;
30 | }
31 |
32 | void FlutterWindow::OnDestroy() {
33 | if (flutter_controller_) {
34 | flutter_controller_ = nullptr;
35 | }
36 |
37 | Win32Window::OnDestroy();
38 | }
39 |
40 | LRESULT
41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
42 | WPARAM const wparam,
43 | LPARAM const lparam) noexcept {
44 | // Give Flutter, including plugins, an opportunity to handle window messages.
45 | if (flutter_controller_) {
46 | std::optional result =
47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
48 | lparam);
49 | if (result) {
50 | return *result;
51 | }
52 | }
53 |
54 | switch (message) {
55 | case WM_FONTCHANGE:
56 | flutter_controller_->engine()->ReloadSystemFonts();
57 | break;
58 | }
59 |
60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
61 | }
62 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.CreateAndShow(L"flutter_alarm_clock", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afzalali15/flutter_alarm_clock/9049fd713edfad23f3f03146ef3e541fe80ecf25/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr);
51 | if (target_length == 0) {
52 | return std::string();
53 | }
54 | std::string utf8_string;
55 | utf8_string.resize(target_length);
56 | int converted_length = ::WideCharToMultiByte(
57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
58 | -1, utf8_string.data(),
59 | target_length, nullptr, nullptr);
60 | if (converted_length == 0) {
61 | return std::string();
62 | }
63 | return utf8_string;
64 | }
65 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.cpp:
--------------------------------------------------------------------------------
1 | #include "win32_window.h"
2 |
3 | #include
4 |
5 | #include "resource.h"
6 |
7 | namespace {
8 |
9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
10 |
11 | // The number of Win32Window objects that currently exist.
12 | static int g_active_window_count = 0;
13 |
14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);
15 |
16 | // Scale helper to convert logical scaler values to physical using passed in
17 | // scale factor
18 | int Scale(int source, double scale_factor) {
19 | return static_cast(source * scale_factor);
20 | }
21 |
22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.
23 | // This API is only needed for PerMonitor V1 awareness mode.
24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) {
25 | HMODULE user32_module = LoadLibraryA("User32.dll");
26 | if (!user32_module) {
27 | return;
28 | }
29 | auto enable_non_client_dpi_scaling =
30 | reinterpret_cast(
31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
32 | if (enable_non_client_dpi_scaling != nullptr) {
33 | enable_non_client_dpi_scaling(hwnd);
34 | FreeLibrary(user32_module);
35 | }
36 | }
37 |
38 | } // namespace
39 |
40 | // Manages the Win32Window's window class registration.
41 | class WindowClassRegistrar {
42 | public:
43 | ~WindowClassRegistrar() = default;
44 |
45 | // Returns the singleton registar instance.
46 | static WindowClassRegistrar* GetInstance() {
47 | if (!instance_) {
48 | instance_ = new WindowClassRegistrar();
49 | }
50 | return instance_;
51 | }
52 |
53 | // Returns the name of the window class, registering the class if it hasn't
54 | // previously been registered.
55 | const wchar_t* GetWindowClass();
56 |
57 | // Unregisters the window class. Should only be called if there are no
58 | // instances of the window.
59 | void UnregisterWindowClass();
60 |
61 | private:
62 | WindowClassRegistrar() = default;
63 |
64 | static WindowClassRegistrar* instance_;
65 |
66 | bool class_registered_ = false;
67 | };
68 |
69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;
70 |
71 | const wchar_t* WindowClassRegistrar::GetWindowClass() {
72 | if (!class_registered_) {
73 | WNDCLASS window_class{};
74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);
75 | window_class.lpszClassName = kWindowClassName;
76 | window_class.style = CS_HREDRAW | CS_VREDRAW;
77 | window_class.cbClsExtra = 0;
78 | window_class.cbWndExtra = 0;
79 | window_class.hInstance = GetModuleHandle(nullptr);
80 | window_class.hIcon =
81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));
82 | window_class.hbrBackground = 0;
83 | window_class.lpszMenuName = nullptr;
84 | window_class.lpfnWndProc = Win32Window::WndProc;
85 | RegisterClass(&window_class);
86 | class_registered_ = true;
87 | }
88 | return kWindowClassName;
89 | }
90 |
91 | void WindowClassRegistrar::UnregisterWindowClass() {
92 | UnregisterClass(kWindowClassName, nullptr);
93 | class_registered_ = false;
94 | }
95 |
96 | Win32Window::Win32Window() {
97 | ++g_active_window_count;
98 | }
99 |
100 | Win32Window::~Win32Window() {
101 | --g_active_window_count;
102 | Destroy();
103 | }
104 |
105 | bool Win32Window::CreateAndShow(const std::wstring& title,
106 | const Point& origin,
107 | const Size& size) {
108 | Destroy();
109 |
110 | const wchar_t* window_class =
111 | WindowClassRegistrar::GetInstance()->GetWindowClass();
112 |
113 | const POINT target_point = {static_cast(origin.x),
114 | static_cast(origin.y)};
115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);
116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
117 | double scale_factor = dpi / 96.0;
118 |
119 | HWND window = CreateWindow(
120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor),
123 | nullptr, nullptr, GetModuleHandle(nullptr), this);
124 |
125 | if (!window) {
126 | return false;
127 | }
128 |
129 | return OnCreate();
130 | }
131 |
132 | // static
133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window,
134 | UINT const message,
135 | WPARAM const wparam,
136 | LPARAM const lparam) noexcept {
137 | if (message == WM_NCCREATE) {
138 | auto window_struct = reinterpret_cast(lparam);
139 | SetWindowLongPtr(window, GWLP_USERDATA,
140 | reinterpret_cast(window_struct->lpCreateParams));
141 |
142 | auto that = static_cast(window_struct->lpCreateParams);
143 | EnableFullDpiSupportIfAvailable(window);
144 | that->window_handle_ = window;
145 | } else if (Win32Window* that = GetThisFromHandle(window)) {
146 | return that->MessageHandler(window, message, wparam, lparam);
147 | }
148 |
149 | return DefWindowProc(window, message, wparam, lparam);
150 | }
151 |
152 | LRESULT
153 | Win32Window::MessageHandler(HWND hwnd,
154 | UINT const message,
155 | WPARAM const wparam,
156 | LPARAM const lparam) noexcept {
157 | switch (message) {
158 | case WM_DESTROY:
159 | window_handle_ = nullptr;
160 | Destroy();
161 | if (quit_on_close_) {
162 | PostQuitMessage(0);
163 | }
164 | return 0;
165 |
166 | case WM_DPICHANGED: {
167 | auto newRectSize = reinterpret_cast(lparam);
168 | LONG newWidth = newRectSize->right - newRectSize->left;
169 | LONG newHeight = newRectSize->bottom - newRectSize->top;
170 |
171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,
172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
173 |
174 | return 0;
175 | }
176 | case WM_SIZE: {
177 | RECT rect = GetClientArea();
178 | if (child_content_ != nullptr) {
179 | // Size and position the child window.
180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
181 | rect.bottom - rect.top, TRUE);
182 | }
183 | return 0;
184 | }
185 |
186 | case WM_ACTIVATE:
187 | if (child_content_ != nullptr) {
188 | SetFocus(child_content_);
189 | }
190 | return 0;
191 | }
192 |
193 | return DefWindowProc(window_handle_, message, wparam, lparam);
194 | }
195 |
196 | void Win32Window::Destroy() {
197 | OnDestroy();
198 |
199 | if (window_handle_) {
200 | DestroyWindow(window_handle_);
201 | window_handle_ = nullptr;
202 | }
203 | if (g_active_window_count == 0) {
204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass();
205 | }
206 | }
207 |
208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
209 | return reinterpret_cast(
210 | GetWindowLongPtr(window, GWLP_USERDATA));
211 | }
212 |
213 | void Win32Window::SetChildContent(HWND content) {
214 | child_content_ = content;
215 | SetParent(content, window_handle_);
216 | RECT frame = GetClientArea();
217 |
218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
219 | frame.bottom - frame.top, true);
220 |
221 | SetFocus(child_content_);
222 | }
223 |
224 | RECT Win32Window::GetClientArea() {
225 | RECT frame;
226 | GetClientRect(window_handle_, &frame);
227 | return frame;
228 | }
229 |
230 | HWND Win32Window::GetHandle() {
231 | return window_handle_;
232 | }
233 |
234 | void Win32Window::SetQuitOnClose(bool quit_on_close) {
235 | quit_on_close_ = quit_on_close;
236 | }
237 |
238 | bool Win32Window::OnCreate() {
239 | // No-op; provided for subclasses.
240 | return true;
241 | }
242 |
243 | void Win32Window::OnDestroy() {
244 | // No-op; provided for subclasses.
245 | }
246 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates and shows a win32 window with |title| and position and size using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size to will treat the width height passed in to this function
35 | // as logical pixels and scale to appropriate for the default monitor. Returns
36 | // true if the window was created successfully.
37 | bool CreateAndShow(const std::wstring& title,
38 | const Point& origin,
39 | const Size& size);
40 |
41 | // Release OS resources associated with window.
42 | void Destroy();
43 |
44 | // Inserts |content| into the window tree.
45 | void SetChildContent(HWND content);
46 |
47 | // Returns the backing Window handle to enable clients to set icon and other
48 | // window properties. Returns nullptr if the window has been destroyed.
49 | HWND GetHandle();
50 |
51 | // If true, closing this window will quit the application.
52 | void SetQuitOnClose(bool quit_on_close);
53 |
54 | // Return a RECT representing the bounds of the current client area.
55 | RECT GetClientArea();
56 |
57 | protected:
58 | // Processes and route salient window messages for mouse handling,
59 | // size change and DPI. Delegates handling of these to member overloads that
60 | // inheriting classes can handle.
61 | virtual LRESULT MessageHandler(HWND window,
62 | UINT const message,
63 | WPARAM const wparam,
64 | LPARAM const lparam) noexcept;
65 |
66 | // Called when CreateAndShow is called, allowing subclass window-related
67 | // setup. Subclasses should return false if setup fails.
68 | virtual bool OnCreate();
69 |
70 | // Called when Destroy is called.
71 | virtual void OnDestroy();
72 |
73 | private:
74 | friend class WindowClassRegistrar;
75 |
76 | // OS callback called by message pump. Handles the WM_NCCREATE message which
77 | // is passed when the non-client area is being created and enables automatic
78 | // non-client DPI scaling so that the non-client area automatically
79 | // responsponds to changes in DPI. All other messages are handled by
80 | // MessageHandler.
81 | static LRESULT CALLBACK WndProc(HWND const window,
82 | UINT const message,
83 | WPARAM const wparam,
84 | LPARAM const lparam) noexcept;
85 |
86 | // Retrieves a class instance pointer for |window|
87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
88 |
89 | bool quit_on_close_ = false;
90 |
91 | // window handle for top level window.
92 | HWND window_handle_ = nullptr;
93 |
94 | // window handle for hosted content.
95 | HWND child_content_ = nullptr;
96 | };
97 |
98 | #endif // RUNNER_WIN32_WINDOW_H_
99 |
--------------------------------------------------------------------------------