Skip to content

Commit

Permalink
Trim app down for prototype work
Browse files Browse the repository at this point in the history
  • Loading branch information
ferndot committed Mar 19, 2020
1 parent 95184e8 commit 1880ed2
Show file tree
Hide file tree
Showing 36 changed files with 61 additions and 1,872 deletions.
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

6 changes: 0 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

// flutter_background_geolocation
Project background_geolocation = project(':flutter_background_geolocation')
apply from: "${background_geolocation.projectDir}/background_geolocation.gradle"

android {
compileSdkVersion rootProject.ext.compileSdkVersion

Expand All @@ -55,8 +51,6 @@ android {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
shrinkResources false
proguardFiles "${background_geolocation.projectDir}/proguard-rules.pro"
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.coronavirus_diary.app">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
tools:replace="android:label"
android:name="io.flutter.app.FlutterApplication"
android:label="coronavirus_diary"
android:icon="@mipmap/ic_launcher">
Expand All @@ -30,5 +28,4 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</manifest>
1 change: 0 additions & 1 deletion dependencies/moor
Submodule moor deleted from 57fa1d
1 change: 0 additions & 1 deletion dependencies/sqflite_sqlcipher
Submodule sqflite_sqlcipher deleted from 50a4ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
16 changes: 0 additions & 16 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.transistorsoft.fetch</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
Expand All @@ -26,18 +22,6 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs access to location when open and in the background.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location when in the background.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to location when open.</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>fetch</string>
<string>location</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
47 changes: 14 additions & 33 deletions lib/src/app.dart
Original file line number Diff line number Diff line change
@@ -1,47 +1,28 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:provider/provider.dart';

import 'blocs/activity/activity.dart';
import 'blocs/preferences/preferences.dart';
import 'data/database/database.dart';
import 'ui/router.dart';
import 'utils/geofencing.dart';

class DiaryApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Provider<AppDatabase>(
create: (context) => AppDatabase(),
dispose: (context, db) => db.close(),
child: MultiBlocProvider(
providers: [
BlocProvider<PreferencesBloc>(
create: (context) {
return PreferencesBloc();
},
),
BlocProvider<ActivityBloc>(
create: (context) {
return ActivityBloc(
database: Provider.of<AppDatabase>(
context,
listen: false,
),
);
},
),
],
child: BlocBuilder<PreferencesBloc, PreferencesState>(
builder: (context, state) {
initGeofencing(state, context.bloc<ActivityBloc>());
return MaterialApp(
title: 'Coronavirus Diary',
routes: appRoutes,
initialRoute: initialRoute,
);
return MultiBlocProvider(
providers: [
BlocProvider<PreferencesBloc>(
create: (context) {
return PreferencesBloc();
},
),
],
child: BlocBuilder<PreferencesBloc, PreferencesState>(
builder: (context, state) {
return MaterialApp(
title: 'Coronavirus Diary',
routes: appRoutes,
initialRoute: initialRoute,
);
},
),
);
}
Expand Down
3 changes: 0 additions & 3 deletions lib/src/blocs/activity/activity.dart

This file was deleted.

56 changes: 0 additions & 56 deletions lib/src/blocs/activity/activity_bloc.dart

This file was deleted.

22 changes: 0 additions & 22 deletions lib/src/blocs/activity/activity_event.dart

This file was deleted.

32 changes: 0 additions & 32 deletions lib/src/blocs/activity/activity_state.dart

This file was deleted.

18 changes: 2 additions & 16 deletions lib/src/blocs/checkup/checkup_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import 'dart:async';

import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:meta/meta.dart';
import 'package:moor/moor.dart';

import 'package:coronavirus_diary/src/data/database/database.dart';

import 'checkup.dart';

class CheckupBloc extends Bloc<CheckupEvent, CheckupState> {
final AppDatabase database;

CheckupBloc({@required this.database});
CheckupBloc();

@override
CheckupState get initialState => CheckupStateNotCreated();
Expand All @@ -26,14 +20,6 @@ class CheckupBloc extends Bloc<CheckupEvent, CheckupState> {
}

Stream<CheckupState> _mapAddCheckupToState(AddCheckup event) async* {
int checkupId = await database.addCheckup(CheckupsCompanion());
yield* _watchCheckup(checkupId);
}

Stream<CheckupState> _watchCheckup(int checkupId) async* {
Stream<Checkup> stream = database.watchCheckup(checkupId);
await for (var checkup in stream) {
yield CheckupStateCreated(checkup);
}
// Send checkup to API and return its ID
}
}
1 change: 0 additions & 1 deletion lib/src/blocs/checkup/checkup_event.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:coronavirus_diary/src/data/database/database.dart';
import 'package:equatable/equatable.dart';

abstract class CheckupEvent extends Equatable {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/blocs/checkup/checkup_state.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:equatable/equatable.dart';

import 'package:coronavirus_diary/src/data/database/database.dart';
import 'package:coronavirus_diary/src/data/models/checkups.dart';

abstract class CheckupState extends Equatable {
const CheckupState();
Expand Down
78 changes: 0 additions & 78 deletions lib/src/data/database/database.dart

This file was deleted.

Loading

0 comments on commit 1880ed2

Please sign in to comment.