iOS App to Record Daily Sun Intake

  Flutter App, Health
suncheck

Why Suncheck

How much sun do you see in a day?

The reason why I feel more depressed or lethargic in Kosi Guk may be because I don’t get enough sunlight. With just 15 minutes of sunlight every day, our brain releases enough serotonin to prevent depression. If we could know how much sunlight we get during the day, wouldn’t we be able to take more control of our mood? With Suncheck, write your own sunlight journal and make your daily life more refreshing and pleasant 🙂

Main Functions

1. Record the sunshine

suncheck

The circle button on the home screen allows you to record the amount of time you receive sunlight. After every 15 minutes, the color of the button changes to a darker color.

When walking motion is detected, or 15 minutes after opening the app, a reminder notification will appear.

2. Check your records

suncheck

Through the calendar screen, you can see my monthly sunlight log and click each circle to see the sunlight received that day, location, vitamin D and electricity amount.

3. Current weather for my real-time location

You can see the real-time weather according to your current location.

Implementation

Serverless Cross-Platform Mobile App

  • It can be distributed to android and ios with one code base, so maintenance and repair can be simplified.
  • Because there is no server, it is more scalable, flexible and cost-efficient than the existing server-client architecture.
  • For the purpose of cross-platform flexibility and cost reduction, we implemented a simple DB locally using SQLite instead of launching a separate database server.
FrameworkClientDatabaseExternal API
FlutteriosSQLiteOpen Weather API
androidSharedPreference

Flutter / Dart Version

  
  Flutter 2.0.5 • channel stable • https://github.com/flutter/flutter.git
  Framework • revision adc687823a (3 months ago) • 2021-04-16 09:40:20 -0700
  Engine • revision b09f014e96
  Tools • Dart 2.12.3
  

List of Flutter Dependency Used

  
  provider: ^4.3.2+3
  weather: ^2.0.1
  geolocator: ^7.2.0+1
  sqflite: ^2.0.0+3
  path: ^1.8.0
  path_provider: ^2.0.2
  intl: ^0.17.0
  shared_preferences: ^2.0.6
  geocoder: ^0.2.1
  avatar_glow: ^2.0.1
  dotted_line: ^3.0.0
  jiffy: ^4.1.0
  flutter_local_notifications: ^5.0.0+1
  timezone: ^0.7.0
  

Sunlight Record Model


class Record {

Record({int id, DateTime date, int energy, String location}) {
  this.id = id;
  this.date = DateTime.parse(DateFormat('yyyy-MM-dd 00:00:00.000').format(date));
  this.energy = energy;
  this.location = location;
}

Map<String, dynamic> toMap() {
  return {'id': id, 'date': date.toString(), 'energy': energy, 'location': location};
}

suncheck