diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies
new file mode 100644
index 0000000..438bff8
--- /dev/null
+++ b/.flutter-plugins-dependencies
@@ -0,0 +1 @@
+{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences","path":"/Users/shafiqruslan/Documents/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.6/","dependencies":[]}],"android":[{"name":"shared_preferences","path":"/Users/shafiqruslan/Documents/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.6/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/shafiqruslan/Documents/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/shafiqruslan/Documents/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/shafiqruslan/Documents/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.0.0/","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/shafiqruslan/Documents/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.1/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/shafiqruslan/Documents/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.0.0/","dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/Users/shafiqruslan/Documents/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.0/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2021-07-01 19:44:53.554537","version":"2.2.2"}
\ No newline at end of file
diff --git a/android/app/build.gradle b/android/app/build.gradle
index dbf5997..93268b0 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -38,7 +38,7 @@ android {
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
@@ -56,6 +56,6 @@ flutter {
dependencies {
testImplementation 'junit:junit:4.12'
- androidTestImplementation 'com.android.support.test:runner:1.0.2'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
diff --git a/android/app/local.properties b/android/app/local.properties
new file mode 100644
index 0000000..13d7bfb
--- /dev/null
+++ b/android/app/local.properties
@@ -0,0 +1,8 @@
+## This file must *NOT* be checked into Version Control Systems,
+# as it contains information specific to your local configuration.
+#
+# Location of the SDK. This is only used by Gradle.
+# For customization when using a Version Control System, please read the
+# header note.
+#Thu Jul 01 15:33:13 MYT 2021
+sdk.dir=/Users/shafiqruslan/Library/Android/sdk
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index a7491e5..b7ad7f8 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -7,7 +7,6 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
-
-
+
diff --git a/android/app/src/main/java/com/example/flutter_todo/MainActivity.java b/android/app/src/main/java/com/example/flutter_todo/MainActivity.java
index db305c8..c178ef2 100644
--- a/android/app/src/main/java/com/example/flutter_todo/MainActivity.java
+++ b/android/app/src/main/java/com/example/flutter_todo/MainActivity.java
@@ -1,13 +1,7 @@
package com.example.flutter_todo;
-import android.os.Bundle;
-import io.flutter.app.FlutterActivity;
-import io.flutter.plugins.GeneratedPluginRegistrant;
+import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- GeneratedPluginRegistrant.registerWith(this);
- }
+
}
diff --git a/android/gradle.properties b/android/gradle.properties
index 2bd6f4f..bb04111 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,2 +1,4 @@
+android.enableJetifier=true
+android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/android/settings_aar.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh
index 89c0e03..b2662c6 100755
--- a/ios/Flutter/flutter_export_environment.sh
+++ b/ios/Flutter/flutter_export_environment.sh
@@ -1,11 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
-export "FLUTTER_ROOT=/Users/devin/flutter"
-export "FLUTTER_APPLICATION_PATH=/Users/devin/Desktop/Sites/flutter-todo"
-export "FLUTTER_TARGET=/Users/devin/Desktop/Sites/flutter-todo/lib/main.dart"
+export "FLUTTER_ROOT=/Users/shafiqruslan/Documents/FlutterSDK"
+export "FLUTTER_APPLICATION_PATH=/Users/shafiqruslan/Documents/FlutterProjects/boilerplate/flutter_todo"
+export "COCOAPODS_PARALLEL_CODE_SIGN=true"
+export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
-export "FLUTTER_FRAMEWORK_DIR=/Users/devin/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=0.4.0"
export "FLUTTER_BUILD_NUMBER=0.4.0"
-export "TRACK_WIDGET_CREATION=true"
+export "DART_OBFUSCATION=false"
+export "TRACK_WIDGET_CREATION=false"
+export "TREE_SHAKE_ICONS=false"
+export "PACKAGE_CONFIG=.packages"
diff --git a/lib/main.dart b/lib/main.dart
index c789bc4..b05ef6f 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -13,7 +13,7 @@ import 'package:flutter_todo/views/todos.dart';
void main() {
runApp(
ChangeNotifierProvider(
- builder: (context) => AuthProvider(),
+ create: (context) => AuthProvider(),
child: MaterialApp(
initialRoute: '/',
routes: {
@@ -30,7 +30,6 @@ void main() {
class Router extends StatelessWidget {
@override
Widget build(BuildContext context) {
-
final authProvider = Provider.of(context);
return Consumer(
@@ -42,7 +41,7 @@ class Router extends StatelessWidget {
return LogIn();
case Status.Authenticated:
return ChangeNotifierProvider(
- builder: (context) => TodoProvider(authProvider),
+ create: (context) => TodoProvider(authProvider),
child: Todos(),
);
default:
@@ -51,4 +50,4 @@ class Router extends StatelessWidget {
},
);
}
-}
\ No newline at end of file
+}
diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart
index 180e9c8..f8709c0 100644
--- a/lib/providers/auth.dart
+++ b/lib/providers/auth.dart
@@ -8,7 +8,6 @@ import 'package:flutter_todo/widgets/notification_text.dart';
enum Status { Uninitialized, Authenticated, Authenticating, Unauthenticated }
class AuthProvider with ChangeNotifier {
-
Status _status = Status.Uninitialized;
String _token;
NotificationText _notification;
@@ -35,14 +34,17 @@ class AuthProvider with ChangeNotifier {
_notification = null;
notifyListeners();
- final url = "$api/login";
+ final url = Uri.parse("$api/login");
Map body = {
'email': email,
'password': password,
};
- final response = await http.post(url, body: body,);
+ final response = await http.post(
+ url,
+ body: body,
+ );
if (response.statusCode == 200) {
Map apiResponse = json.decode(response.body);
@@ -66,8 +68,9 @@ class AuthProvider with ChangeNotifier {
return false;
}
- Future