done
@ -1,3 +1,6 @@
|
|||||||
|
import java.util.Properties
|
||||||
|
import java.io.FileInputStream
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("kotlin-android")
|
id("kotlin-android")
|
||||||
@ -5,6 +8,13 @@ plugins {
|
|||||||
id("dev.flutter.flutter-gradle-plugin")
|
id("dev.flutter.flutter-gradle-plugin")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val keystoreProperties = Properties()
|
||||||
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.example.e_receipt_mobile"
|
namespace = "com.example.e_receipt_mobile"
|
||||||
compileSdk = flutter.compileSdkVersion
|
compileSdk = flutter.compileSdkVersion
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:label="e_receipt_mobile"
|
android:label="E Receipt"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 50 KiB |
@ -1 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
#include "Generated.xcconfig"
|
#include "Generated.xcconfig"
|
||||||
|
|||||||
@ -1 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
#include "Generated.xcconfig"
|
#include "Generated.xcconfig"
|
||||||
|
|||||||
43
ios/Podfile
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# Uncomment this line to define a global platform for your project
|
||||||
|
# platform :ios, '13.0'
|
||||||
|
|
||||||
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||||
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||||
|
|
||||||
|
project 'Runner', {
|
||||||
|
'Debug' => :debug,
|
||||||
|
'Profile' => :release,
|
||||||
|
'Release' => :release,
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutter_root
|
||||||
|
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
|
||||||
|
unless File.exist?(generated_xcode_build_settings_path)
|
||||||
|
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
||||||
|
end
|
||||||
|
|
||||||
|
File.foreach(generated_xcode_build_settings_path) do |line|
|
||||||
|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
||||||
|
return matches[1].strip if matches
|
||||||
|
end
|
||||||
|
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
|
||||||
|
end
|
||||||
|
|
||||||
|
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
||||||
|
|
||||||
|
flutter_ios_podfile_setup
|
||||||
|
|
||||||
|
target 'Runner' do
|
||||||
|
use_frameworks!
|
||||||
|
|
||||||
|
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
||||||
|
target 'RunnerTests' do
|
||||||
|
inherit! :search_paths
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
post_install do |installer|
|
||||||
|
installer.pods_project.targets.each do |target|
|
||||||
|
flutter_additional_ios_build_settings(target)
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -5,7 +5,6 @@ import 'package:e_receipt_mobile/presentation/home/merchant_paging_view_model.da
|
|||||||
import 'package:e_receipt_mobile/presentation/home/widgets/home_drawer.dart';
|
import 'package:e_receipt_mobile/presentation/home/widgets/home_drawer.dart';
|
||||||
import 'package:e_receipt_mobile/presentation/home/widgets/merchant_header.dart';
|
import 'package:e_receipt_mobile/presentation/home/widgets/merchant_header.dart';
|
||||||
import 'package:e_receipt_mobile/presentation/home/widgets/merchant_list_view.dart';
|
import 'package:e_receipt_mobile/presentation/home/widgets/merchant_list_view.dart';
|
||||||
import 'package:e_receipt_mobile/presentation/settings/settings_screen.dart';
|
|
||||||
import 'package:e_receipt_mobile/presentation/terminal/terminal_selection_screen.dart';
|
import 'package:e_receipt_mobile/presentation/terminal/terminal_selection_screen.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
@ -38,29 +37,10 @@ class HomeScreen extends ConsumerWidget {
|
|||||||
),
|
),
|
||||||
drawer: HomeDrawer(
|
drawer: HomeDrawer(
|
||||||
user: user,
|
user: user,
|
||||||
onProfile: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
_showProfile(context, user);
|
|
||||||
},
|
|
||||||
onReports: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
_showComingSoon(context, 'Reports');
|
|
||||||
},
|
|
||||||
onSettings: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
Navigator.of(context).push(
|
|
||||||
MaterialPageRoute<void>(builder: (_) => const SettingsScreen()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
onHelp: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
_showComingSoon(context, 'Help');
|
|
||||||
},
|
|
||||||
onLogout: () async {
|
onLogout: () async {
|
||||||
if (logoutState.isLoading) {
|
if (logoutState.isLoading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final shouldLogout = await showDialog<bool>(
|
final shouldLogout = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
@ -215,37 +195,7 @@ class HomeScreen extends ConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showComingSoon(BuildContext context, String feature) {
|
|
||||||
ScaffoldMessenger.of(
|
|
||||||
context,
|
|
||||||
).showSnackBar(SnackBar(content: Text('$feature is coming soon')));
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showProfile(BuildContext context, LoginUser user) {
|
|
||||||
showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: const Text('Profile'),
|
|
||||||
content: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text('Username: ${user.username}'),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Text('Role: ${user.role}'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
|
||||||
child: const Text('Close'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _openTerminalSelection(
|
void _openTerminalSelection(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
|
|||||||
@ -5,19 +5,11 @@ import 'package:flutter/material.dart';
|
|||||||
class HomeDrawer extends StatelessWidget {
|
class HomeDrawer extends StatelessWidget {
|
||||||
const HomeDrawer({
|
const HomeDrawer({
|
||||||
required this.user,
|
required this.user,
|
||||||
required this.onProfile,
|
|
||||||
required this.onReports,
|
|
||||||
required this.onSettings,
|
|
||||||
required this.onHelp,
|
|
||||||
required this.onLogout,
|
required this.onLogout,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final LoginUser user;
|
final LoginUser user;
|
||||||
final VoidCallback onProfile;
|
|
||||||
final VoidCallback onReports;
|
|
||||||
final VoidCallback onSettings;
|
|
||||||
final VoidCallback onHelp;
|
|
||||||
final VoidCallback onLogout;
|
final VoidCallback onLogout;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -29,33 +21,7 @@ class HomeDrawer extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_DrawerHeader(user: user),
|
_DrawerHeader(user: user),
|
||||||
Expanded(
|
const Spacer(),
|
||||||
child: ListView(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
||||||
children: [
|
|
||||||
_DrawerItem(
|
|
||||||
icon: Icons.person_outline,
|
|
||||||
label: 'Profile',
|
|
||||||
onTap: onProfile,
|
|
||||||
),
|
|
||||||
_DrawerItem(
|
|
||||||
icon: Icons.analytics_outlined,
|
|
||||||
label: 'Reports',
|
|
||||||
onTap: onReports,
|
|
||||||
),
|
|
||||||
_DrawerItem(
|
|
||||||
icon: Icons.settings_outlined,
|
|
||||||
label: 'Settings',
|
|
||||||
onTap: onSettings,
|
|
||||||
),
|
|
||||||
_DrawerItem(
|
|
||||||
icon: Icons.help_outline,
|
|
||||||
label: 'Help',
|
|
||||||
onTap: onHelp,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Divider(
|
Divider(
|
||||||
height: 1,
|
height: 1,
|
||||||
thickness: 1,
|
thickness: 1,
|
||||||
|
|||||||
@ -236,10 +236,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
|
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.19"
|
version: "0.12.18"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -473,10 +473,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
|
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.10"
|
version: "0.7.9"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -14,9 +14,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is hused as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.0+1
|
version: 2.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.10.7
|
sdk: ^3.10.7
|
||||||
|
|||||||