Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,42 @@
# This file should be version controlled and should not be manually edited.

version:
revision: a18f5e84a1045551774a6c12fd40fa4997356931
channel: master
revision: "db50e20168db8fee486b9abf32fc912de3bc5b6a"
channel: "[user-branch]"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
- platform: android
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
- platform: ios
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
- platform: linux
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
- platform: macos
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
- platform: web
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
- platform: windows
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
80 changes: 0 additions & 80 deletions android/app/build.gradle

This file was deleted.

37 changes: 17 additions & 20 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutteruikit">

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>

<!-- 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
android:name="io.flutter.app.FlutterApplication"
android:label="Flutter UIKit"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>

This file was deleted.

29 changes: 0 additions & 29 deletions android/build.gradle

This file was deleted.

4 changes: 3 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
15 changes: 0 additions & 15 deletions android/settings.gradle

This file was deleted.

15 changes: 7 additions & 8 deletions lib/di/dependency_injection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import 'package:flutter_uikit/services/mock/mock_otp_service.dart';
import 'package:flutter_uikit/services/real/real_otp_service.dart';
import 'package:flutter_uikit/services/restclient.dart';

enum Flavor { MOCK, PRO }
enum Flavor { mock, pro }

//Simple DI
class Injector {
static final Injector _singleton = new Injector._internal();
static Flavor _flavor;
static final Injector _singleton = Injector._internal();
static late Flavor _flavor;

static void configure(Flavor flavor) async {
static void configure(Flavor flavor) {
_flavor = flavor;
}

Expand All @@ -20,10 +19,10 @@ class Injector {

IOTPService get otpService {
switch (_flavor) {
case Flavor.MOCK:
case Flavor.mock:
return MockOTPService();
default:
return OTPService(new RestClient());
case Flavor.pro:
return OTPService(RestClient());
}
}
}
16 changes: 11 additions & 5 deletions lib/inherited/login_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import 'package:flutter/material.dart';

class LoginProvider extends InheritedWidget {
final Function validationErrorCallback;
final Widget child;

LoginProvider({this.validationErrorCallback, this.child})
: super(child: child);
const LoginProvider({
super.key,
required this.validationErrorCallback,
required super.child,
});

static LoginProvider of(BuildContext context) =>
context.inheritFromWidgetOfExactType(LoginProvider);
static LoginProvider of(BuildContext context) {
final provider =
context.dependOnInheritedWidgetOfExactType<LoginProvider>();
assert(provider != null, 'LoginProvider not found in context');
return provider!;
}

@override
bool updateShouldNotify(LoginProvider oldWidget) =>
Expand Down
15 changes: 11 additions & 4 deletions lib/inherited/product_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ import 'package:flutter_uikit/logic/bloc/product_bloc.dart';

class ProductProvider extends InheritedWidget {
final ProductBloc productBloc;
final Widget child;

ProductProvider({this.productBloc, this.child}) : super(child: child);
const ProductProvider({
super.key,
required this.productBloc,
required super.child,
});

static ProductProvider of(BuildContext context) =>
context.inheritFromWidgetOfExactType(ProductProvider);
static ProductProvider of(BuildContext context) {
final provider =
context.dependOnInheritedWidgetOfExactType<ProductProvider>();
assert(provider != null, 'ProductProvider not found in context');
return provider!;
}

@override
bool updateShouldNotify(ProductProvider oldWidget) =>
Expand Down
8 changes: 4 additions & 4 deletions lib/logic/bloc/cart_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter_uikit/logic/viewmodel/cart_view_model.dart';
import 'package:flutter_uikit/model/product.dart';

class CartBloc {
CartViewModel _cartViewModel;
late final CartViewModel _cartViewModel;
final additionalController = StreamController<bool>();
final subtractionController = StreamController<bool>();
final countController = StreamController<int>();
Expand All @@ -29,8 +29,8 @@ class CartBloc {
}

void dispose() {
additionalController?.close();
subtractionController?.close();
countController?.close();
additionalController.close();
subtractionController.close();
countController.close();
}
}
16 changes: 8 additions & 8 deletions lib/logic/bloc/credit_card_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ class CreditCardBloc {
nameInputController.stream.listen(onNameInput);
}

onCCInput(String input) {
void onCCInput(String input) {
ccOutputController.add(input.toString());
}

onExpInput(String input) {
void onExpInput(String input) {
expOutputController.add(input);
}

onCvvInput(String input) {
void onCvvInput(String input) {
cvvOutputController.add(input);
}

onNameInput(String input) {
void onNameInput(String input) {
nameOutputController.add(input);
}

Expand All @@ -50,9 +50,9 @@ class CreditCardBloc {
}

void dispose() {
ccInputController?.close();
cvvInputController?.close();
expInputController?.close();
nameInputController?.close();
ccInputController.close();
cvvInputController.close();
expInputController.close();
nameInputController.close();
}
}
Loading