├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── clock_challenge
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── 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
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── 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
├── lib
├── helpers
│ ├── clocktheme.dart
│ ├── digitalnumbersides.dart
│ └── utils.dart
├── main.dart
├── services
│ ├── clockanimationservice.dart
│ └── clockthemeservice.dart
└── widgets
│ ├── clockthemeanimation.dart
│ ├── clockthemeanimationwrapper.dart
│ ├── clockthemecolorselection.dart
│ ├── clockwidget.dart
│ ├── digitalclock.dart
│ ├── digitalclockbg.dart
│ ├── digitalclockoptions.dart
│ └── digitalclockwidget.dart
├── pubspec.lock
├── pubspec.yaml
└── web
├── favicon.png
├── icons
├── Icon-192.png
├── Icon-512.png
├── Icon-maskable-192.png
└── Icon-maskable-512.png
├── index.html
└── manifest.json
/.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 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/.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: 3595343e20a61ff16d14e8ecc25f364276bb1b8b
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # clock_challenge
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/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 30
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 "com.example.clock_challenge"
47 | minSdkVersion 16
48 | targetSdkVersion 30
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 |
6 |
13 |
17 |
21 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/clock_challenge/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.clock_challenge
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/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/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.3.50'
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 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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 "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
97 | );
98 | path = Runner;
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXNativeTarget section */
104 | 97C146ED1CF9000F007C117D /* Runner */ = {
105 | isa = PBXNativeTarget;
106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107 | buildPhases = (
108 | 9740EEB61CF901F6004384FC /* Run Script */,
109 | 97C146EA1CF9000F007C117D /* Sources */,
110 | 97C146EB1CF9000F007C117D /* Frameworks */,
111 | 97C146EC1CF9000F007C117D /* Resources */,
112 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
114 | );
115 | buildRules = (
116 | );
117 | dependencies = (
118 | );
119 | name = Runner;
120 | productName = Runner;
121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
122 | productType = "com.apple.product-type.application";
123 | };
124 | /* End PBXNativeTarget section */
125 |
126 | /* Begin PBXProject section */
127 | 97C146E61CF9000F007C117D /* Project object */ = {
128 | isa = PBXProject;
129 | attributes = {
130 | LastUpgradeCheck = 1020;
131 | ORGANIZATIONNAME = "";
132 | TargetAttributes = {
133 | 97C146ED1CF9000F007C117D = {
134 | CreatedOnToolsVersion = 7.3.1;
135 | LastSwiftMigration = 1100;
136 | };
137 | };
138 | };
139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
140 | compatibilityVersion = "Xcode 9.3";
141 | developmentRegion = en;
142 | hasScannedForEncodings = 0;
143 | knownRegions = (
144 | en,
145 | Base,
146 | );
147 | mainGroup = 97C146E51CF9000F007C117D;
148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
149 | projectDirPath = "";
150 | projectRoot = "";
151 | targets = (
152 | 97C146ED1CF9000F007C117D /* Runner */,
153 | );
154 | };
155 | /* End PBXProject section */
156 |
157 | /* Begin PBXResourcesBuildPhase section */
158 | 97C146EC1CF9000F007C117D /* Resources */ = {
159 | isa = PBXResourcesBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
166 | );
167 | runOnlyForDeploymentPostprocessing = 0;
168 | };
169 | /* End PBXResourcesBuildPhase section */
170 |
171 | /* Begin PBXShellScriptBuildPhase section */
172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173 | isa = PBXShellScriptBuildPhase;
174 | buildActionMask = 2147483647;
175 | files = (
176 | );
177 | inputPaths = (
178 | );
179 | name = "Thin Binary";
180 | outputPaths = (
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | shellPath = /bin/sh;
184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
185 | };
186 | 9740EEB61CF901F6004384FC /* Run Script */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputPaths = (
192 | );
193 | name = "Run Script";
194 | outputPaths = (
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | shellPath = /bin/sh;
198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199 | };
200 | /* End PBXShellScriptBuildPhase section */
201 |
202 | /* Begin PBXSourcesBuildPhase section */
203 | 97C146EA1CF9000F007C117D /* Sources */ = {
204 | isa = PBXSourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXSourcesBuildPhase section */
213 |
214 | /* Begin PBXVariantGroup section */
215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
216 | isa = PBXVariantGroup;
217 | children = (
218 | 97C146FB1CF9000F007C117D /* Base */,
219 | );
220 | name = Main.storyboard;
221 | sourceTree = "";
222 | };
223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C147001CF9000F007C117D /* Base */,
227 | );
228 | name = LaunchScreen.storyboard;
229 | sourceTree = "";
230 | };
231 | /* End PBXVariantGroup section */
232 |
233 | /* Begin XCBuildConfiguration section */
234 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
235 | isa = XCBuildConfiguration;
236 | buildSettings = {
237 | ALWAYS_SEARCH_USER_PATHS = NO;
238 | CLANG_ANALYZER_NONNULL = YES;
239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
240 | CLANG_CXX_LIBRARY = "libc++";
241 | CLANG_ENABLE_MODULES = YES;
242 | CLANG_ENABLE_OBJC_ARC = YES;
243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
244 | CLANG_WARN_BOOL_CONVERSION = YES;
245 | CLANG_WARN_COMMA = YES;
246 | CLANG_WARN_CONSTANT_CONVERSION = YES;
247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
249 | CLANG_WARN_EMPTY_BODY = YES;
250 | CLANG_WARN_ENUM_CONVERSION = YES;
251 | CLANG_WARN_INFINITE_RECURSION = YES;
252 | CLANG_WARN_INT_CONVERSION = YES;
253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
258 | CLANG_WARN_STRICT_PROTOTYPES = YES;
259 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
260 | CLANG_WARN_UNREACHABLE_CODE = YES;
261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
263 | COPY_PHASE_STRIP = NO;
264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
265 | ENABLE_NS_ASSERTIONS = NO;
266 | ENABLE_STRICT_OBJC_MSGSEND = YES;
267 | GCC_C_LANGUAGE_STANDARD = gnu99;
268 | GCC_NO_COMMON_BLOCKS = YES;
269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
271 | GCC_WARN_UNDECLARED_SELECTOR = YES;
272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273 | GCC_WARN_UNUSED_FUNCTION = YES;
274 | GCC_WARN_UNUSED_VARIABLE = YES;
275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
276 | MTL_ENABLE_DEBUG_INFO = NO;
277 | SDKROOT = iphoneos;
278 | SUPPORTED_PLATFORMS = iphoneos;
279 | TARGETED_DEVICE_FAMILY = "1,2";
280 | VALIDATE_PRODUCT = YES;
281 | };
282 | name = Profile;
283 | };
284 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
285 | isa = XCBuildConfiguration;
286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
287 | buildSettings = {
288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289 | CLANG_ENABLE_MODULES = YES;
290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
291 | ENABLE_BITCODE = NO;
292 | INFOPLIST_FILE = Runner/Info.plist;
293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
294 | PRODUCT_BUNDLE_IDENTIFIER = com.example.clockChallenge;
295 | PRODUCT_NAME = "$(TARGET_NAME)";
296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
297 | SWIFT_VERSION = 5.0;
298 | VERSIONING_SYSTEM = "apple-generic";
299 | };
300 | name = Profile;
301 | };
302 | 97C147031CF9000F007C117D /* Debug */ = {
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;
333 | ENABLE_STRICT_OBJC_MSGSEND = YES;
334 | ENABLE_TESTABILITY = YES;
335 | GCC_C_LANGUAGE_STANDARD = gnu99;
336 | GCC_DYNAMIC_NO_PIC = NO;
337 | GCC_NO_COMMON_BLOCKS = YES;
338 | GCC_OPTIMIZATION_LEVEL = 0;
339 | GCC_PREPROCESSOR_DEFINITIONS = (
340 | "DEBUG=1",
341 | "$(inherited)",
342 | );
343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
345 | GCC_WARN_UNDECLARED_SELECTOR = YES;
346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347 | GCC_WARN_UNUSED_FUNCTION = YES;
348 | GCC_WARN_UNUSED_VARIABLE = YES;
349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
350 | MTL_ENABLE_DEBUG_INFO = YES;
351 | ONLY_ACTIVE_ARCH = YES;
352 | SDKROOT = iphoneos;
353 | TARGETED_DEVICE_FAMILY = "1,2";
354 | };
355 | name = Debug;
356 | };
357 | 97C147041CF9000F007C117D /* Release */ = {
358 | isa = XCBuildConfiguration;
359 | buildSettings = {
360 | ALWAYS_SEARCH_USER_PATHS = NO;
361 | CLANG_ANALYZER_NONNULL = YES;
362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
363 | CLANG_CXX_LIBRARY = "libc++";
364 | CLANG_ENABLE_MODULES = YES;
365 | CLANG_ENABLE_OBJC_ARC = YES;
366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
367 | CLANG_WARN_BOOL_CONVERSION = YES;
368 | CLANG_WARN_COMMA = YES;
369 | CLANG_WARN_CONSTANT_CONVERSION = YES;
370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
372 | CLANG_WARN_EMPTY_BODY = YES;
373 | CLANG_WARN_ENUM_CONVERSION = YES;
374 | CLANG_WARN_INFINITE_RECURSION = YES;
375 | CLANG_WARN_INT_CONVERSION = YES;
376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
381 | CLANG_WARN_STRICT_PROTOTYPES = YES;
382 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
383 | CLANG_WARN_UNREACHABLE_CODE = YES;
384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
386 | COPY_PHASE_STRIP = NO;
387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
388 | ENABLE_NS_ASSERTIONS = NO;
389 | ENABLE_STRICT_OBJC_MSGSEND = YES;
390 | GCC_C_LANGUAGE_STANDARD = gnu99;
391 | GCC_NO_COMMON_BLOCKS = YES;
392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
394 | GCC_WARN_UNDECLARED_SELECTOR = YES;
395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
396 | GCC_WARN_UNUSED_FUNCTION = YES;
397 | GCC_WARN_UNUSED_VARIABLE = YES;
398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
399 | MTL_ENABLE_DEBUG_INFO = NO;
400 | SDKROOT = iphoneos;
401 | SUPPORTED_PLATFORMS = iphoneos;
402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
403 | TARGETED_DEVICE_FAMILY = "1,2";
404 | VALIDATE_PRODUCT = YES;
405 | };
406 | name = Release;
407 | };
408 | 97C147061CF9000F007C117D /* Debug */ = {
409 | isa = XCBuildConfiguration;
410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
411 | buildSettings = {
412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
413 | CLANG_ENABLE_MODULES = YES;
414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
415 | ENABLE_BITCODE = NO;
416 | INFOPLIST_FILE = Runner/Info.plist;
417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
418 | PRODUCT_BUNDLE_IDENTIFIER = com.example.clockChallenge;
419 | PRODUCT_NAME = "$(TARGET_NAME)";
420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
422 | SWIFT_VERSION = 5.0;
423 | VERSIONING_SYSTEM = "apple-generic";
424 | };
425 | name = Debug;
426 | };
427 | 97C147071CF9000F007C117D /* Release */ = {
428 | isa = XCBuildConfiguration;
429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
430 | buildSettings = {
431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
432 | CLANG_ENABLE_MODULES = YES;
433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
434 | ENABLE_BITCODE = NO;
435 | INFOPLIST_FILE = Runner/Info.plist;
436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
437 | PRODUCT_BUNDLE_IDENTIFIER = com.example.clockChallenge;
438 | PRODUCT_NAME = "$(TARGET_NAME)";
439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
440 | SWIFT_VERSION = 5.0;
441 | VERSIONING_SYSTEM = "apple-generic";
442 | };
443 | name = Release;
444 | };
445 | /* End XCBuildConfiguration section */
446 |
447 | /* Begin XCConfigurationList section */
448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
449 | isa = XCConfigurationList;
450 | buildConfigurations = (
451 | 97C147031CF9000F007C117D /* Debug */,
452 | 97C147041CF9000F007C117D /* Release */,
453 | 249021D3217E4FDB00AE95B9 /* Profile */,
454 | );
455 | defaultConfigurationIsVisible = 0;
456 | defaultConfigurationName = Release;
457 | };
458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
459 | isa = XCConfigurationList;
460 | buildConfigurations = (
461 | 97C147061CF9000F007C117D /* Debug */,
462 | 97C147071CF9000F007C117D /* Release */,
463 | 249021D4217E4FDB00AE95B9 /* Profile */,
464 | );
465 | defaultConfigurationIsVisible = 0;
466 | defaultConfigurationName = Release;
467 | };
468 | /* End XCConfigurationList section */
469 | };
470 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
471 | }
472 |
--------------------------------------------------------------------------------
/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 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | clock_challenge
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/helpers/clocktheme.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class ClockTheme {
4 | Color? main;
5 | Color? shadow1;
6 | Color? shadow2;
7 | Color? color1;
8 | Color? color2;
9 | Color? color3;
10 | Color? color4;
11 | Color? color5;
12 | Color? colorShadow;
13 |
14 | ClockTheme({
15 | this.main,
16 | this.shadow1,
17 | this.shadow2,
18 | this.color1,
19 | this.color2,
20 | this.color3,
21 | this.color4,
22 | this.color5,
23 | this.colorShadow
24 | });
25 | }
--------------------------------------------------------------------------------
/lib/helpers/digitalnumbersides.dart:
--------------------------------------------------------------------------------
1 | enum DigitalNumberSides {
2 | topHorizontal,
3 | centerHorizontal,
4 | bottomHorizontal,
5 | topRight,
6 | bottomRight,
7 | topLeft,
8 | bottomLeft,
9 | centerTop,
10 | centerBottom
11 | }
--------------------------------------------------------------------------------
/lib/helpers/utils.dart:
--------------------------------------------------------------------------------
1 | import 'package:clock_challenge/helpers/clocktheme.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class Utils {
5 |
6 | static ClockThemes clockTheme = ClockThemes.green;
7 |
8 | static Map themes = {
9 | ClockThemes.green : ClockTheme(
10 | shadow1: const Color(0xFF0A340C).withOpacity(0.2),
11 | shadow2: Colors.green,
12 | main: Colors.green,
13 | color1: const Color(0xFF102310),
14 | color2: const Color(0xFF1E4620),
15 | color3: const Color(0xFF2D6930),
16 | color4: const Color(0xFF3D8C40),
17 | color5: const Color(0xFF4DAF50),
18 | colorShadow: const Color(0xFF0A340C).withOpacity(0.5)
19 | ),
20 | ClockThemes.fuchsia : ClockTheme(
21 | shadow1: const Color(0xFF6E0A4B).withOpacity(0.2),
22 | shadow2: const Color(0xFFE342AB),
23 | color1: const Color(0xFF6E0A4B),
24 | color2: const Color(0xFFAA1B78),
25 | color3: const Color(0xFFCC2191),
26 | color4: const Color(0xFFE342AB),
27 | color5: const Color(0xFFFA4DBE),
28 | main: const Color(0xFFFA4DBE),
29 | colorShadow: const Color(0xFF6E0A4B).withOpacity(0.5)
30 | ),
31 | ClockThemes.blue : ClockTheme(
32 | shadow1: const Color(0xFF00557B).withOpacity(0.2),
33 | shadow2: const Color(0xFF00B1FF),
34 | color1: const Color(0xFF00354D),
35 | color2: const Color(0xFF00557B),
36 | color3: const Color(0xFF0076AA),
37 | color4: const Color(0xFF008FCE),
38 | color5: const Color(0xFF00B1FF),
39 | main: const Color(0xFF00B1FF),
40 | colorShadow: const Color(0xFF00354D).withOpacity(0.5)
41 | ),
42 | ClockThemes.valentine : ClockTheme(
43 | shadow1: const Color(0xFF880C0C).withOpacity(0.2),
44 | shadow2: const Color(0xFFCC1515),
45 | color1: const Color(0xFF880C0C),
46 | color2: const Color(0xFFAC0E0E),
47 | color3: const Color(0xFFCC1515),
48 | color4: const Color(0xFFE61B1B),
49 | color5: const Color(0xFFFD2A2A),
50 | main: const Color(0xFFFD2A2A),
51 | colorShadow: const Color(0xFF880C0C).withOpacity(0.5)
52 | )
53 | };
54 |
55 | static ClockTheme getTheme() {
56 | return themes[clockTheme]!;
57 | }
58 |
59 | static Color getColorFromTheme(ClockThemes theme) {
60 | return themes[theme]!.main!;
61 | }
62 | }
63 |
64 | enum ClockThemes {
65 | green,
66 | blue,
67 | fuchsia,
68 | valentine
69 | }
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:clock_challenge/services/clockanimationservice.dart';
2 | import 'package:clock_challenge/services/clockthemeservice.dart';
3 | import 'package:clock_challenge/widgets/clockthemeanimationwrapper.dart';
4 | import 'package:clock_challenge/widgets/digitalclock.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:provider/provider.dart';
7 |
8 | void main() {
9 | runApp(
10 | MultiProvider(
11 | providers: [
12 | ChangeNotifierProvider(
13 | create: (_) => ClockThemeService()
14 | ),
15 | ChangeNotifierProvider(
16 | create: (_) => ClockAnimationService()
17 | )
18 | ],
19 | child: const MyApp()
20 | )
21 | );
22 | }
23 |
24 | class MyApp extends StatelessWidget {
25 | const MyApp({Key? key}) : super(key: key);
26 |
27 | // This widget is the root of your application.
28 | @override
29 | Widget build(BuildContext context) {
30 | return MaterialApp(
31 | title: 'Flutter Clock',
32 | debugShowCheckedModeBanner: false,
33 | home: Stack(
34 | children: [
35 | const DigitalClock(),
36 | ClockThemeAnimationWrapper(),
37 | ]
38 | )
39 | );
40 | }
41 | }
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/lib/services/clockanimationservice.dart:
--------------------------------------------------------------------------------
1 | import 'package:clock_challenge/helpers/utils.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class ClockAnimationService extends ChangeNotifier {
5 |
6 | Map animationThemes = {
7 | ClockThemes.valentine: Icons.favorite,
8 | ClockThemes.blue: Icons.ac_unit,
9 | ClockThemes.fuchsia: Icons.trip_origin
10 | };
11 |
12 | bool showClockAnimation = false;
13 | IconData? themeIcon;
14 |
15 | void setClockAnimationTheme(ClockThemes clockTheme) {
16 | resetAnimation();
17 |
18 | if (animationThemes.containsKey(clockTheme)) {
19 | showClockAnimation = true;
20 | themeIcon = animationThemes[clockTheme];
21 | }
22 | else {
23 | showClockAnimation = false;
24 | themeIcon = null;
25 | }
26 |
27 | notifyListeners();
28 | }
29 |
30 | void resetAnimation() {
31 | showClockAnimation = false;
32 | themeIcon = null;
33 | notifyListeners();
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/lib/services/clockthemeservice.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:clock_challenge/helpers/utils.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class ClockThemeService extends ChangeNotifier {
6 |
7 | bool showColorSelection = false;
8 |
9 | void updateTheme(ClockThemes theme) {
10 | Utils.clockTheme = theme;
11 | notifyListeners();
12 | }
13 |
14 | void toggleColorSelection() {
15 | showColorSelection = !showColorSelection;
16 | notifyListeners();
17 | }
18 | }
--------------------------------------------------------------------------------
/lib/widgets/clockthemeanimation.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:clock_challenge/services/clockanimationservice.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class ClockThemeAnimation extends StatefulWidget {
8 |
9 | @override
10 | State createState() => _ClockThemeAnimationState();
11 | }
12 |
13 | class _ClockThemeAnimationState extends State with TickerProviderStateMixin {
14 | AnimationController? controller;
15 |
16 | List controllers = [];
17 | List animatedItems = [];
18 |
19 | @override
20 | void initState() {
21 | super.initState();
22 | }
23 |
24 | void processContent(IconData? icon) {
25 | animatedItems = [];
26 |
27 | if (icon != null) {
28 | for(var i = 0; i < 16; i++) {
29 |
30 | int nextInt = (Random().nextInt(5) + 5);
31 | AnimationController controller = AnimationController(
32 | duration: Duration(seconds: nextInt),
33 | vsync: this)..repeat();
34 |
35 | double iconSize = Random().nextDouble() * 80 + 40;
36 | double opacity = Random().nextDouble() * 0.5 + 0.25;
37 | var transitionWidget = SlideTransition(
38 | position: Tween(
39 | begin: Offset(i * 1.0, -1.0),
40 | end: Offset(i * 1.0, nextInt * 1.5)).animate(
41 | CurvedAnimation(parent: controller,
42 | curve: Curves.linear
43 | )
44 | ),
45 | child: Opacity(
46 | opacity: opacity,
47 | child: Icon(
48 | icon,
49 | color: Colors.white, size: iconSize
50 | ),
51 | )
52 | );
53 |
54 | animatedItems.add(transitionWidget);
55 | controllers.add(controller);
56 | }
57 | }
58 | }
59 |
60 | @override
61 | Widget build(BuildContext context) {
62 | ClockAnimationService cService = Provider.of(context);
63 | processContent(cService.themeIcon);
64 |
65 | return Stack(
66 | children: animatedItems,
67 | );
68 | }
69 |
70 | @override
71 | void dispose() {
72 | controllers.forEach((element) {
73 | element.dispose();
74 | });
75 | super.dispose();
76 | }
77 | }
--------------------------------------------------------------------------------
/lib/widgets/clockthemeanimationwrapper.dart:
--------------------------------------------------------------------------------
1 | import 'package:clock_challenge/services/clockanimationservice.dart';
2 | import 'package:clock_challenge/widgets/clockthemeanimation.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:provider/provider.dart';
5 |
6 | class ClockThemeAnimationWrapper extends StatefulWidget {
7 | @override
8 | State createState() => _ClockThemeAnimationWrapperState();
9 | }
10 |
11 | class _ClockThemeAnimationWrapperState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 |
15 | return Consumer(
16 | builder: (context, animService, child) {
17 | return ClockThemeAnimation();
18 | }
19 | );
20 | }
21 | }
--------------------------------------------------------------------------------
/lib/widgets/clockthemecolorselection.dart:
--------------------------------------------------------------------------------
1 | import 'package:clock_challenge/helpers/utils.dart';
2 | import 'package:clock_challenge/services/clockanimationservice.dart';
3 | import 'package:clock_challenge/services/clockthemeservice.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class ClockThemeColorSelection extends StatelessWidget {
8 | @override
9 | Widget build(BuildContext context) {
10 |
11 | ClockAnimationService animService = Provider.of(context, listen: false);
12 |
13 | return Consumer(
14 | builder: (context, cService, child) {
15 | List options = [
16 | AnimatedContainer(
17 | duration: const Duration(milliseconds: 250),
18 | curve: Curves.easeInOut,
19 | margin: const EdgeInsets.all(10),
20 | padding: const EdgeInsets.all(5),
21 | decoration: BoxDecoration(
22 | border: Border.all(
23 | color: Utils.clockTheme == ClockThemes.green ? Utils.getColorFromTheme(ClockThemes.green) : Colors.transparent,
24 | width: 3
25 | ),
26 | borderRadius: BorderRadius.circular(50)
27 | ),
28 | child: ClipOval(
29 | child: Material(
30 | color: Utils.getColorFromTheme(ClockThemes.green),
31 | child: InkWell(
32 | highlightColor: Colors.white.withOpacity(0.1),
33 | splashColor: Colors.white.withOpacity(0.3),
34 | onTap: () {
35 | cService.updateTheme(ClockThemes.green);
36 | animService.setClockAnimationTheme(ClockThemes.green);
37 | },
38 | child: const SizedBox(
39 | width: 30,
40 | height: 30,
41 | ),
42 | )
43 | ),
44 | ),
45 | ),
46 | AnimatedContainer(
47 | duration: const Duration(milliseconds: 250),
48 | curve: Curves.easeInOut,
49 | margin: const EdgeInsets.all(10),
50 | padding: const EdgeInsets.all(5),
51 | decoration: BoxDecoration(
52 | border: Border.all(
53 | color: Utils.clockTheme == ClockThemes.fuchsia ? Utils.getColorFromTheme(ClockThemes.fuchsia) : Colors.transparent,
54 | width: 3
55 | ),
56 | borderRadius: BorderRadius.circular(50)
57 | ),
58 | child: ClipOval(
59 | child: Material(
60 | color: Utils.getColorFromTheme(ClockThemes.fuchsia),
61 | child: InkWell(
62 | highlightColor: Colors.white.withOpacity(0.1),
63 | splashColor: Colors.white.withOpacity(0.3),
64 | onTap: () {
65 | cService.updateTheme(ClockThemes.fuchsia);
66 | animService.setClockAnimationTheme(ClockThemes.fuchsia);
67 |
68 | },
69 | child: const SizedBox(
70 | width: 30,
71 | height: 30,
72 | ),
73 | )
74 | ),
75 | ),
76 | ),
77 | AnimatedContainer(
78 | duration: const Duration(milliseconds: 250),
79 | curve: Curves.easeInOut,
80 | margin: const EdgeInsets.all(10),
81 | padding: const EdgeInsets.all(5),
82 | decoration: BoxDecoration(
83 | border: Border.all(
84 | color: Utils.clockTheme == ClockThemes.blue ? Utils.getColorFromTheme(ClockThemes.blue) : Colors.transparent,
85 | width: 3
86 | ),
87 | borderRadius: BorderRadius.circular(50)
88 | ),
89 | child: ClipOval(
90 | child: Material(
91 | color: Utils.getColorFromTheme(ClockThemes.blue),
92 | child: InkWell(
93 | highlightColor: Colors.white.withOpacity(0.1),
94 | splashColor: Colors.white.withOpacity(0.3),
95 | onTap: () {
96 | cService.updateTheme(ClockThemes.blue);
97 | animService.setClockAnimationTheme(ClockThemes.blue);
98 | },
99 | child: const SizedBox(
100 | width: 30,
101 | height: 30,
102 | child: Icon(Icons.ac_unit, color: Colors.white, size: 20),
103 | ),
104 | )
105 | ),
106 | ),
107 | ),
108 | AnimatedContainer(
109 | duration: const Duration(milliseconds: 250),
110 | curve: Curves.easeInOut,
111 | margin: const EdgeInsets.all(10),
112 | padding: const EdgeInsets.all(5),
113 | decoration: BoxDecoration(
114 | border: Border.all(
115 | color: Utils.clockTheme == ClockThemes.valentine ? Utils.getColorFromTheme(ClockThemes.valentine) : Colors.transparent,
116 | width: 3
117 | ),
118 | borderRadius: BorderRadius.circular(50)
119 | ),
120 | child: ClipOval(
121 | child: Material(
122 | color: Utils.getColorFromTheme(ClockThemes.valentine),
123 | child: InkWell(
124 | highlightColor: Colors.white.withOpacity(0.1),
125 | splashColor: Colors.white.withOpacity(0.3),
126 | onTap: () {
127 | cService.updateTheme(ClockThemes.valentine);
128 | animService.setClockAnimationTheme(ClockThemes.valentine);
129 | },
130 | child: const SizedBox(
131 | width: 30,
132 | height: 30,
133 | child: Icon(Icons.favorite, color: Colors.white, size: 20),
134 | ),
135 | )
136 | ),
137 | ),
138 | ),
139 | ];
140 |
141 | Widget colorSelection = MediaQuery.of(context).orientation == Orientation.portrait ?
142 | Row(
143 | mainAxisAlignment: MainAxisAlignment.center,
144 | children: [
145 | Container(
146 | margin: const EdgeInsets.only(bottom: 40),
147 | child: Row(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: options
150 | ),
151 | padding: const EdgeInsets.all(5),
152 | decoration: BoxDecoration(
153 | color: Colors.black.withOpacity(0.5),
154 | borderRadius: BorderRadius.circular(50)
155 | ),
156 | )
157 | ]
158 | ) :
159 | Column(
160 | mainAxisAlignment: MainAxisAlignment.center,
161 | children: [
162 | Container(
163 | margin: const EdgeInsets.only(right: 40),
164 | child: Column(
165 | mainAxisAlignment: MainAxisAlignment.center,
166 | children: options
167 | ),
168 | padding: const EdgeInsets.all(5),
169 | decoration: BoxDecoration(
170 | color: Colors.black.withOpacity(0.5),
171 | borderRadius: BorderRadius.circular(50)
172 | ),
173 | )
174 | ]
175 | );
176 |
177 | return AnimatedScale(
178 | scale: cService.showColorSelection ? 1 : 0.8,
179 | duration: const Duration(milliseconds: 250),
180 | child: AnimatedOpacity(
181 | opacity: cService.showColorSelection ? 1 : 0,
182 | duration: const Duration(milliseconds: 250),
183 | curve: Curves.easeInOut,
184 | child: colorSelection,
185 | )
186 | );
187 | }
188 | );
189 | }
190 |
191 | }
--------------------------------------------------------------------------------
/lib/widgets/clockwidget.dart:
--------------------------------------------------------------------------------
1 | // represents the animation for each individual digit
2 | // represented as a series of blocks with animations
3 | import 'package:clock_challenge/helpers/clocktheme.dart';
4 | import 'package:clock_challenge/helpers/digitalnumbersides.dart';
5 | import 'package:clock_challenge/helpers/utils.dart';
6 | import 'package:clock_challenge/services/clockanimationservice.dart';
7 | import 'package:clock_challenge/services/clockthemeservice.dart';
8 | import 'package:flutter/material.dart';
9 | import 'package:provider/provider.dart';
10 |
11 | class ClockWidget extends StatefulWidget {
12 | final bool isTimeIndicator;
13 | final bool isTimeEllapsing;
14 | final ValueNotifier? widgetNumber;
15 |
16 | const ClockWidget({Key? key, this.widgetNumber, this.isTimeIndicator = false, this.isTimeEllapsing = true}) : super(key: key);
17 |
18 | @override
19 | ClockWidgetState createState() => ClockWidgetState();
20 | }
21 |
22 | class ClockWidgetState extends State {
23 | static const double digitalWidthHeight = 40.0;
24 | static const int fastDuration = 100;
25 | static const int slowDuration = 500;
26 |
27 |
28 |
29 | // this is the mapping that reprents which digits get to have a side displayed
30 | // based on the composition of the digit widget
31 | // i.e. number 0 gets the top, bottom, top left, top right, bottom left and bottom right container displayed
32 | // while number one only gets the center top and center bottom container displayed
33 | Map> digitalNumberSidesMapping = {
34 | DigitalNumberSides.topHorizontal: [0, 2, 3, 5, 6, 7, 8, 9],
35 | DigitalNumberSides.centerHorizontal: [2, 3, 4, 5, 6, 8, 9],
36 | DigitalNumberSides.bottomHorizontal: [0, 2, 3, 5, 6, 8, 9],
37 | DigitalNumberSides.topRight: [0, 2, 3, 4, 7, 8, 9],
38 | DigitalNumberSides.bottomRight: [0, 3, 4, 5, 6, 7, 8, 9],
39 | DigitalNumberSides.topLeft: [0, 4, 5, 6, 8, 9],
40 | DigitalNumberSides.bottomLeft: [0, 2, 6, 8],
41 | DigitalNumberSides.centerTop: [1],
42 | DigitalNumberSides.centerBottom: [1],
43 | };
44 |
45 | // this mapping is to whether turn on or off one of the digit sides
46 | Map digitalNumberSideVisible = {
47 | DigitalNumberSides.topHorizontal: false,
48 | DigitalNumberSides.centerHorizontal: false,
49 | DigitalNumberSides.centerTop: false,
50 | DigitalNumberSides.centerBottom: false,
51 | DigitalNumberSides.bottomHorizontal: false,
52 | DigitalNumberSides.topRight: false,
53 | DigitalNumberSides.bottomRight: false,
54 | DigitalNumberSides.topLeft: false,
55 | DigitalNumberSides.bottomLeft: false
56 | };
57 |
58 | @override
59 | void initState() {
60 | super.initState();
61 | onExecuteAnimations();
62 |
63 | // upon a number changing, trigger its corresponding animation(s)
64 | widget.widgetNumber!.addListener(() {
65 | onExecuteAnimations();
66 | });
67 | }
68 |
69 | void onExecuteAnimations() {
70 | digitalNumberSidesMapping.keys.forEach((side) {
71 | if (mounted) {
72 | setState(() {
73 | digitalNumberSideVisible[side] =
74 | digitalNumberSidesMapping[side]!.contains(widget.widgetNumber!.value);
75 | });
76 | }
77 | });
78 | }
79 |
80 | @override
81 | Widget build(BuildContext context) {
82 |
83 | return Consumer(
84 | builder: (context, service, child) {
85 | ClockTheme clockTheme = Utils.getTheme();
86 | BoxDecoration numberBoxDecoration = BoxDecoration(
87 | color: Colors.white,
88 | borderRadius: BorderRadius.circular(50),
89 | boxShadow: [
90 | BoxShadow(
91 | blurRadius: 20,
92 | color: clockTheme.shadow1!,
93 | offset: Offset.zero),
94 | BoxShadow(
95 | blurRadius: 20,
96 | color: clockTheme.shadow2!,
97 | offset: Offset.zero
98 | )
99 | ],
100 | gradient: LinearGradient(
101 | begin: Alignment.topCenter,
102 | end: Alignment.bottomCenter,
103 | colors: [Colors.white, Colors.white.withOpacity(0.5)]));
104 |
105 | Widget digitSidesContainer =
106 | Container(width: digitalWidthHeight, height: 120, decoration: numberBoxDecoration);
107 |
108 | Widget digitHorizontalContainer =
109 | Container(height: digitalWidthHeight, decoration: numberBoxDecoration);
110 |
111 | return widget.isTimeIndicator
112 | ? Consumer(
113 | builder: (context, animService, child) {
114 |
115 | Widget timeIndicatorWidget = animService.themeIcon != null ?
116 | SizedBox(
117 | width: digitalWidthHeight,
118 | height: digitalWidthHeight,
119 | child: Icon(animService.themeIcon, color: Colors.white, size: 40))
120 | :
121 | Container(
122 | width: digitalWidthHeight,
123 | height: digitalWidthHeight,
124 | decoration: numberBoxDecoration
125 | );
126 |
127 | return Container(
128 | width: digitalWidthHeight,
129 | height: 200,
130 | margin: const EdgeInsets.all(10),
131 | child: Column(
132 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
133 | children: [
134 | AnimatedContainer(
135 | width: !widget.isTimeEllapsing ? digitalWidthHeight : 0,
136 | duration: const Duration(milliseconds: 500),
137 | curve: Curves.bounceOut,
138 | child: timeIndicatorWidget
139 | ),
140 | AnimatedContainer(
141 | width: widget.isTimeEllapsing ? digitalWidthHeight : 0,
142 | duration: const Duration(milliseconds: 500),
143 | curve: Curves.bounceOut,
144 | child: timeIndicatorWidget
145 | )
146 | ]
147 | )
148 | );
149 | },
150 | )
151 | : ValueListenableBuilder(
152 | valueListenable: widget.widgetNumber!,
153 | builder: (context, value, child) {
154 | return Container(
155 | margin: const EdgeInsets.all(10),
156 | width: 120,
157 | height: 200,
158 | color: Colors.transparent,
159 | child: Stack(children: [
160 | Align(
161 | alignment: Alignment.topCenter,
162 | child: AnimatedContainer(
163 | height: digitalNumberSideVisible[
164 | DigitalNumberSides.topHorizontal]!
165 | ? digitalWidthHeight
166 | : 0.0,
167 | duration: Duration(
168 | milliseconds: digitalNumberSideVisible[
169 | DigitalNumberSides.topHorizontal]!
170 | ? slowDuration
171 | : fastDuration),
172 | curve: Curves.bounceOut,
173 | child: digitHorizontalContainer)),
174 | Align(
175 | alignment: Alignment.center,
176 | child: AnimatedContainer(
177 | height: digitalNumberSideVisible[
178 | DigitalNumberSides.centerHorizontal]!
179 | ? digitalWidthHeight
180 | : 0.0,
181 | duration: Duration(
182 | milliseconds: digitalNumberSideVisible[
183 | DigitalNumberSides.centerHorizontal]!
184 | ? slowDuration
185 | : fastDuration),
186 | curve: Curves.bounceOut,
187 | child: digitHorizontalContainer)),
188 | Align(
189 | alignment: Alignment.bottomCenter,
190 | child: AnimatedContainer(
191 | height: digitalNumberSideVisible[
192 | DigitalNumberSides.bottomHorizontal]!
193 | ? digitalWidthHeight
194 | : 0.0,
195 | duration: Duration(
196 | milliseconds: digitalNumberSideVisible[
197 | DigitalNumberSides.bottomHorizontal]!
198 | ? slowDuration
199 | : fastDuration),
200 | curve: Curves.bounceOut,
201 | child: digitHorizontalContainer)),
202 | Align(
203 | alignment: Alignment.topRight,
204 | child: AnimatedContainer(
205 | width: digitalNumberSideVisible[
206 | DigitalNumberSides.topRight]!
207 | ? digitalWidthHeight
208 | : 0.0,
209 | duration: Duration(
210 | milliseconds: digitalNumberSideVisible[
211 | DigitalNumberSides.topRight]!
212 | ? slowDuration
213 | : fastDuration),
214 | curve: Curves.bounceOut,
215 | child: digitSidesContainer)),
216 | Align(
217 | alignment: Alignment.bottomRight,
218 | child: AnimatedContainer(
219 | width: digitalNumberSideVisible[
220 | DigitalNumberSides.bottomRight]!
221 | ? digitalWidthHeight
222 | : 0.0,
223 | duration: Duration(
224 | milliseconds: digitalNumberSideVisible[
225 | DigitalNumberSides.bottomRight]!
226 | ? slowDuration
227 | : fastDuration),
228 | curve: Curves.bounceOut,
229 | child: digitSidesContainer)),
230 | Align(
231 | alignment: Alignment.topCenter,
232 | child: AnimatedContainer(
233 | width: digitalNumberSideVisible[
234 | DigitalNumberSides.centerTop]!
235 | ? digitalWidthHeight
236 | : 0.0,
237 | duration: Duration(
238 | milliseconds: digitalNumberSideVisible[
239 | DigitalNumberSides.centerTop]!
240 | ? slowDuration
241 | : fastDuration),
242 | curve: Curves.bounceOut,
243 | child: digitSidesContainer)),
244 | Align(
245 | alignment: Alignment.bottomCenter,
246 | child: AnimatedContainer(
247 | width: digitalNumberSideVisible[
248 | DigitalNumberSides.centerBottom]!
249 | ? digitalWidthHeight
250 | : 0.0,
251 | duration: Duration(
252 | milliseconds: digitalNumberSideVisible[
253 | DigitalNumberSides.centerBottom]!
254 | ? slowDuration
255 | : fastDuration),
256 | curve: Curves.bounceOut,
257 | child: digitSidesContainer)),
258 | Align(
259 | alignment: Alignment.topLeft,
260 | child: AnimatedContainer(
261 | width: digitalNumberSideVisible[
262 | DigitalNumberSides.topLeft]!
263 | ? digitalWidthHeight
264 | : 0.0,
265 | duration: Duration(
266 | milliseconds: digitalNumberSideVisible[
267 | DigitalNumberSides.topLeft]!
268 | ? slowDuration
269 | : fastDuration),
270 | curve: Curves.bounceOut,
271 | child: digitSidesContainer)),
272 | Align(
273 | alignment: Alignment.bottomLeft,
274 | child: AnimatedContainer(
275 | width: digitalNumberSideVisible[
276 | DigitalNumberSides.bottomLeft]!
277 | ? digitalWidthHeight
278 | : 0.0,
279 | duration: Duration(
280 | milliseconds: digitalNumberSideVisible[
281 | DigitalNumberSides.bottomLeft]!
282 | ? slowDuration
283 | : fastDuration),
284 | curve: Curves.bounceOut,
285 | child: digitSidesContainer))
286 | ]));
287 | },
288 | );
289 | }
290 | );
291 | }
292 | }
293 |
--------------------------------------------------------------------------------
/lib/widgets/digitalclock.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'package:clock_challenge/services/clockanimationservice.dart';
3 | import 'package:clock_challenge/widgets/clockthemeanimation.dart';
4 | import 'package:clock_challenge/widgets/clockthemeanimationwrapper.dart';
5 | import 'package:clock_challenge/widgets/digitalclockbg.dart';
6 | import 'package:clock_challenge/widgets/digitalclockwidget.dart';
7 | import 'package:flutter/material.dart';
8 | import 'package:intl/intl.dart';
9 | import 'package:provider/provider.dart';
10 |
11 | /// A basic digital clock.
12 | ///
13 | /// You can do better than this!
14 | class DigitalClock extends StatefulWidget {
15 | const DigitalClock({Key? key}) : super(key: key);
16 |
17 | @override
18 | _DigitalClockState createState() => _DigitalClockState();
19 | }
20 |
21 | class _DigitalClockState extends State {
22 | DateTime _dateTime = DateTime.now();
23 | late Timer _timer;
24 | late String hour;
25 | late String minute;
26 | late String second;
27 | bool timeIndicator = true;
28 |
29 | @override
30 | void initState() {
31 | super.initState();
32 | _updateTime();
33 | _updateModel();
34 | }
35 |
36 | @override
37 | void dispose() {
38 | _timer.cancel();
39 | super.dispose();
40 | }
41 |
42 | void _updateModel() {
43 | setState(() {
44 | // Cause the clock to rebuild when the model changes.
45 | });
46 | }
47 |
48 | void _updateTime() {
49 | setState(() {
50 | _dateTime = DateTime.now();
51 |
52 | _timer = Timer(
53 | const Duration(seconds: 1) - Duration(milliseconds: _dateTime.millisecond),
54 | _updateTime,
55 | );
56 |
57 | hour = DateFormat('hh')
58 | .format(_dateTime);
59 | minute = DateFormat('mm').format(_dateTime);
60 | second = DateFormat('ss').format(_dateTime);
61 | timeIndicator = !timeIndicator;
62 | });
63 | }
64 |
65 | @override
66 | Widget build(BuildContext context) {
67 |
68 | return Scaffold(
69 | backgroundColor: Colors.black,
70 | body: Stack(
71 | children: [
72 | const DigitalClockBg(),
73 | Center(
74 | child: DigitalClockWidget(
75 | hours: hour,
76 | minutes: minute,
77 | seconds: second,
78 | isTimeEllapsing: timeIndicator,
79 | )
80 | )
81 | ],
82 | )
83 | );
84 | }
85 | }
86 |
87 |
--------------------------------------------------------------------------------
/lib/widgets/digitalclockbg.dart:
--------------------------------------------------------------------------------
1 | import 'package:clock_challenge/helpers/clocktheme.dart';
2 | import 'package:clock_challenge/helpers/utils.dart';
3 | import 'package:clock_challenge/services/clockthemeservice.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class DigitalClockBg extends StatelessWidget {
8 | const DigitalClockBg({Key? key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 |
13 | return Consumer(
14 | builder: (context, service, child) {
15 | ClockTheme theme = Utils.getTheme();
16 | return Stack(
17 | children: [
18 | Container(
19 | color: theme.color1,
20 | width: MediaQuery.of(context).size.width
21 | ),
22 | Container(
23 | decoration: BoxDecoration(
24 | color: theme.color2,
25 | borderRadius: const BorderRadius.only(
26 | topRight: Radius.circular(50),
27 | bottomRight: Radius.circular(50)
28 | ),
29 | boxShadow: [
30 | BoxShadow(
31 | blurRadius: 30,
32 | color: theme.colorShadow!,
33 | offset: Offset.zero
34 | )
35 | ]
36 | ),
37 | width: MediaQuery.of(context).size.width * 0.8
38 | ),
39 | Container(
40 | decoration: BoxDecoration(
41 | color: theme.color3,
42 | borderRadius: const BorderRadius.only(
43 | topRight: Radius.circular(50),
44 | bottomRight: Radius.circular(50)
45 | ),
46 | boxShadow: [
47 | BoxShadow(
48 | blurRadius: 30,
49 | color: theme.colorShadow!,
50 | offset: Offset.zero
51 | )
52 | ],
53 | ),
54 | width: MediaQuery.of(context).size.width * 0.6
55 | ),
56 | Container(
57 | decoration: BoxDecoration(
58 | color: theme.color4,
59 | boxShadow: [
60 | BoxShadow(
61 | blurRadius: 30,
62 | color: theme.colorShadow!,
63 | offset: Offset.zero
64 | )
65 | ],
66 | borderRadius: const BorderRadius.only(
67 | topRight: Radius.circular(50),
68 | bottomRight: Radius.circular(50)
69 | )
70 | ),
71 | width: MediaQuery.of(context).size.width * 0.4
72 | ),
73 | Container(
74 | decoration: BoxDecoration(
75 | color: theme.color5,
76 | borderRadius: const BorderRadius.only(
77 | topRight: Radius.circular(50),
78 | bottomRight: Radius.circular(50)
79 | ),
80 | boxShadow: [
81 | BoxShadow(
82 | blurRadius: 30,
83 | color: theme.colorShadow!,
84 | offset: Offset.zero
85 | )
86 | ]
87 | ),
88 | width: MediaQuery.of(context).size.width * 0.2
89 | )
90 | ]
91 | );
92 | }
93 | );
94 | }
95 |
96 | }
--------------------------------------------------------------------------------
/lib/widgets/digitalclockoptions.dart:
--------------------------------------------------------------------------------
1 | import 'package:clock_challenge/helpers/clocktheme.dart';
2 | import 'package:clock_challenge/helpers/utils.dart';
3 | import 'package:clock_challenge/services/clockthemeservice.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class DigitalClockOptions extends StatelessWidget {
8 | @override
9 | Widget build(BuildContext context) {
10 |
11 | return Consumer(
12 | builder: (context, cService, child) {
13 | ClockTheme clockTheme = Utils.getTheme();
14 |
15 | List options = [
16 | Container(
17 | child: const Icon(Icons.timer, color: Colors.white, size: 30),
18 | decoration: BoxDecoration(
19 | boxShadow:[
20 | BoxShadow(color: clockTheme.shadow2!, blurRadius: 20, offset: Offset.zero)
21 | ]
22 | ),
23 | ),
24 | Container(
25 | child: const Icon(Icons.wb_sunny, color: Colors.white, size: 30),
26 | decoration: BoxDecoration(
27 | boxShadow:[
28 | BoxShadow(color: clockTheme.shadow2!, blurRadius: 20, offset: Offset.zero)
29 | ]
30 | ),
31 | ),
32 | GestureDetector(
33 | onTap: () {
34 | cService.toggleColorSelection();
35 | },
36 | child: Container(
37 | child: const Icon(Icons.palette, color: Colors.white, size: 30),
38 | decoration: BoxDecoration(
39 | boxShadow:[
40 | BoxShadow(color: clockTheme.shadow2!, blurRadius: 20, offset: Offset.zero)
41 | ]
42 | ),
43 | ),
44 | ),
45 | Container(
46 | child: const Icon(Icons.thermostat, color: Colors.white, size: 30),
47 | decoration: BoxDecoration(
48 | boxShadow:[
49 | BoxShadow(color: clockTheme.shadow2!, blurRadius: 20, offset: Offset.zero)
50 | ]
51 | ),
52 | ),
53 | Container(
54 | child: const Icon(Icons.calendar_today, color: Colors.white, size: 30),
55 | decoration: BoxDecoration(
56 | boxShadow:[
57 | BoxShadow(color: clockTheme.shadow2!, blurRadius: 20, offset: Offset.zero)
58 | ]
59 | ),
60 | )
61 | ];
62 |
63 | return MediaQuery.of(context).orientation == Orientation.portrait ?
64 | Row(
65 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
66 | children: options,
67 | ) :
68 | Column(
69 | crossAxisAlignment: CrossAxisAlignment.end,
70 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
71 | children: options,
72 | );
73 | }
74 | );
75 | }
76 |
77 | }
--------------------------------------------------------------------------------
/lib/widgets/digitalclockwidget.dart:
--------------------------------------------------------------------------------
1 |
2 | // This is the wrapper class around my digital clock
3 | import 'package:clock_challenge/helpers/clocktheme.dart';
4 | import 'package:clock_challenge/helpers/utils.dart';
5 | import 'package:clock_challenge/widgets/clockthemecolorselection.dart';
6 | import 'package:clock_challenge/widgets/clockwidget.dart';
7 | import 'package:clock_challenge/widgets/digitalclockoptions.dart';
8 | import 'package:flutter/material.dart';
9 |
10 | class DigitalClockWidget extends StatefulWidget {
11 | final String? hours;
12 | final String? minutes;
13 | final String? seconds;
14 | final bool? isTimeEllapsing;
15 |
16 | const DigitalClockWidget({Key? key, this.hours, this.minutes, this.seconds, this.isTimeEllapsing = true}) : super(key: key);
17 |
18 | @override
19 | DigitalClockWidgetState createState() => DigitalClockWidgetState();
20 | }
21 |
22 | class DigitalClockWidgetState extends State {
23 | ValueNotifier vNumber1 = ValueNotifier(0);
24 | ValueNotifier vNumber2 = ValueNotifier(0);
25 | ValueNotifier vNumber3 = ValueNotifier(0);
26 | ValueNotifier vNumber4 = ValueNotifier(0);
27 | ValueNotifier vNumber5 = ValueNotifier(0);
28 | ValueNotifier vNumber6 = ValueNotifier(0);
29 |
30 | @override
31 | void initState() {
32 | super.initState();
33 | }
34 |
35 | @override
36 | Widget build(BuildContext context) {
37 |
38 | ClockTheme clockTheme = Utils.getTheme();
39 |
40 | // parsing the digits out of the provided inputs
41 | var firstHourDigit = widget.hours![0];
42 | var secondHourDigit = widget.hours![1];
43 | var thirdValue = widget.minutes![0];
44 | var fourthValue = widget.minutes![1];
45 | var fifthValue = widget.seconds![0];
46 | var sixthValue = widget.seconds![1];
47 |
48 | vNumber1.value = int.parse(firstHourDigit);
49 | vNumber2.value = int.parse(secondHourDigit);
50 | vNumber3.value = int.parse(thirdValue);
51 | vNumber4.value = int.parse(fourthValue);
52 | vNumber5.value = int.parse(fifthValue);
53 | vNumber6.value = int.parse(sixthValue);
54 |
55 |
56 | return Stack(
57 | children: [
58 | Transform.scale(
59 | scale: 0.9,
60 | child: Center(
61 | child: MediaQuery.of(context).orientation == Orientation.landscape ?
62 | Stack(
63 | children: [
64 | Align(
65 | alignment: Alignment.centerLeft,
66 | child: Row(
67 | mainAxisAlignment: MainAxisAlignment.center,
68 | crossAxisAlignment: CrossAxisAlignment.center,
69 | children: [
70 | ClockWidget(widgetNumber: vNumber1),
71 | ClockWidget(widgetNumber: vNumber2),
72 | ClockWidget(
73 | widgetNumber: ValueNotifier(0), isTimeIndicator: true, isTimeEllapsing: widget.isTimeEllapsing!,),
74 | ClockWidget(widgetNumber: vNumber3),
75 | ClockWidget(widgetNumber: vNumber4),
76 | const SizedBox(width: 200),
77 | ]
78 | ),
79 | ),
80 | Align(
81 | alignment: Alignment.centerRight,
82 | child: Transform.scale(
83 | scale: 0.4,
84 | origin: const Offset(20.0, -10.0),
85 | alignment: Alignment.bottomRight,
86 | child: Row(
87 | children: [
88 | const SizedBox(width: 300),
89 | ClockWidget(widgetNumber: vNumber5),
90 | ClockWidget(widgetNumber: vNumber6),
91 | ],
92 | )
93 | )
94 | )
95 | ],
96 | ) :
97 | Padding(
98 | padding: const EdgeInsets.all(30.0),
99 | child: Column(
100 | mainAxisAlignment: MainAxisAlignment.center,
101 | children: [
102 | Row(
103 | children: [
104 | ClockWidget(widgetNumber: vNumber1),
105 | ClockWidget(widgetNumber: vNumber2)
106 | ]
107 | ),
108 | Row(
109 | children: [
110 | ClockWidget(widgetNumber: vNumber3),
111 | ClockWidget(widgetNumber: vNumber4)
112 | ],
113 | ),
114 | Row(
115 | children: [
116 | ClockWidget(widgetNumber: vNumber5),
117 | ClockWidget(widgetNumber: vNumber6)
118 | ],
119 | )
120 | ],
121 | ),
122 | )
123 | ),
124 | ),
125 | Padding(
126 | padding: const EdgeInsets.all(40.0),
127 | child: Align(
128 | alignment: MediaQuery.of(context).orientation == Orientation.portrait ? Alignment.bottomCenter : Alignment.centerRight,
129 | child: DigitalClockOptions()
130 | ),
131 | ),
132 | Padding(
133 | padding: const EdgeInsets.all(40.0),
134 | child: Align(
135 | alignment: MediaQuery.of(context).orientation == Orientation.portrait ? Alignment.bottomCenter : Alignment.centerRight,
136 | child: ClockThemeColorSelection()
137 | )
138 | )
139 | ],
140 | );
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.8.1"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.1.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.3.1"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.15.0"
46 | cupertino_icons:
47 | dependency: "direct main"
48 | description:
49 | name: cupertino_icons
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.0.4"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.2.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_lints:
66 | dependency: "direct dev"
67 | description:
68 | name: flutter_lints
69 | url: "https://pub.dartlang.org"
70 | source: hosted
71 | version: "1.0.4"
72 | flutter_test:
73 | dependency: "direct dev"
74 | description: flutter
75 | source: sdk
76 | version: "0.0.0"
77 | intl:
78 | dependency: "direct main"
79 | description:
80 | name: intl
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "0.17.0"
84 | lints:
85 | dependency: transitive
86 | description:
87 | name: lints
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.0.1"
91 | matcher:
92 | dependency: transitive
93 | description:
94 | name: matcher
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "0.12.10"
98 | meta:
99 | dependency: transitive
100 | description:
101 | name: meta
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "1.7.0"
105 | nested:
106 | dependency: transitive
107 | description:
108 | name: nested
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "1.0.0"
112 | path:
113 | dependency: transitive
114 | description:
115 | name: path
116 | url: "https://pub.dartlang.org"
117 | source: hosted
118 | version: "1.8.0"
119 | provider:
120 | dependency: "direct main"
121 | description:
122 | name: provider
123 | url: "https://pub.dartlang.org"
124 | source: hosted
125 | version: "6.0.1"
126 | sky_engine:
127 | dependency: transitive
128 | description: flutter
129 | source: sdk
130 | version: "0.0.99"
131 | source_span:
132 | dependency: transitive
133 | description:
134 | name: source_span
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.8.1"
138 | stack_trace:
139 | dependency: transitive
140 | description:
141 | name: stack_trace
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "1.10.0"
145 | stream_channel:
146 | dependency: transitive
147 | description:
148 | name: stream_channel
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "2.1.0"
152 | string_scanner:
153 | dependency: transitive
154 | description:
155 | name: string_scanner
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "1.1.0"
159 | term_glyph:
160 | dependency: transitive
161 | description:
162 | name: term_glyph
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "1.2.0"
166 | test_api:
167 | dependency: transitive
168 | description:
169 | name: test_api
170 | url: "https://pub.dartlang.org"
171 | source: hosted
172 | version: "0.4.2"
173 | typed_data:
174 | dependency: transitive
175 | description:
176 | name: typed_data
177 | url: "https://pub.dartlang.org"
178 | source: hosted
179 | version: "1.3.0"
180 | vector_math:
181 | dependency: transitive
182 | description:
183 | name: vector_math
184 | url: "https://pub.dartlang.org"
185 | source: hosted
186 | version: "2.1.0"
187 | sdks:
188 | dart: ">=2.12.0 <3.0.0"
189 | flutter: ">=1.16.0"
190 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: clock_challenge
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.12.0 <3.0.0"
22 |
23 | # Dependencies specify other packages that your package needs in order to work.
24 | # To automatically upgrade your package dependencies to the latest versions
25 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
26 | # dependencies can be manually updated by changing the version numbers below to
27 | # the latest version available on pub.dev. To see which dependencies have newer
28 | # versions available, run `flutter pub outdated`.
29 | dependencies:
30 | flutter:
31 | sdk: flutter
32 |
33 |
34 | # The following adds the Cupertino Icons font to your application.
35 | # Use with the CupertinoIcons class for iOS style icons.
36 | cupertino_icons: ^1.0.2
37 | intl: ^0.17.0
38 | provider: ^6.0.1
39 |
40 | dev_dependencies:
41 | flutter_test:
42 | sdk: flutter
43 |
44 | # The "flutter_lints" package below contains a set of recommended lints to
45 | # encourage good coding practices. The lint set provided by the package is
46 | # activated in the `analysis_options.yaml` file located at the root of your
47 | # package. See that file for information about deactivating specific lint
48 | # rules and activating additional ones.
49 | flutter_lints: ^1.0.0
50 |
51 | # For information on the generic Dart part of this file, see the
52 | # following page: https://dart.dev/tools/pub/pubspec
53 |
54 | # The following section is specific to Flutter.
55 | flutter:
56 |
57 | # The following line ensures that the Material Icons font is
58 | # included with your application, so that you can use the icons in
59 | # the material Icons class.
60 | uses-material-design: true
61 |
62 | # To add assets to your application, add an assets section, like this:
63 | # assets:
64 | # - images/a_dot_burr.jpeg
65 | # - images/a_dot_ham.jpeg
66 |
67 | # An image asset can refer to one or more resolution-specific "variants", see
68 | # https://flutter.dev/assets-and-images/#resolution-aware.
69 |
70 | # For details regarding adding assets from package dependencies, see
71 | # https://flutter.dev/assets-and-images/#from-packages
72 |
73 | # To add custom fonts to your application, add a fonts section here,
74 | # in this "flutter" section. Each entry in this list should have a
75 | # "family" key with the font family name, and a "fonts" key with a
76 | # list giving the asset and other descriptors for the font. For
77 | # example:
78 | # fonts:
79 | # - family: Schyler
80 | # fonts:
81 | # - asset: fonts/Schyler-Regular.ttf
82 | # - asset: fonts/Schyler-Italic.ttf
83 | # style: italic
84 | # - family: Trajan Pro
85 | # fonts:
86 | # - asset: fonts/TrajanPro.ttf
87 | # - asset: fonts/TrajanPro_Bold.ttf
88 | # weight: 700
89 | #
90 | # For details regarding fonts from package dependencies,
91 | # see https://flutter.dev/custom-fonts/#from-packages
92 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/romanejaquez/flutter_clock_challenge/8b71d93a6768f34178ba84c3f0895cc1b40fb067/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 | clock_challenge
30 |
31 |
32 |
33 |
36 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "clock_challenge",
3 | "short_name": "clock_challenge",
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 |
--------------------------------------------------------------------------------