Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
efe2517
init.
Mahsa-Alamshahi Nov 15, 2022
56de9f7
Packages added.
Mahsa-Alamshahi Nov 15, 2022
a5c6179
GetIt dependency added.
Mahsa-Alamshahi Nov 15, 2022
4faaecd
Floor dependency added.
Mahsa-Alamshahi Nov 15, 2022
15ac2ba
Database added.
Mahsa-Alamshahi Nov 15, 2022
c055e7c
Customer list bloc files added.
Mahsa-Alamshahi Nov 15, 2022
d31e356
Getting all customers repository done.
Mahsa-Alamshahi Nov 15, 2022
1627779
Getting all customers usecase done.
Mahsa-Alamshahi Nov 15, 2022
10a0453
Getting all customers state done.
Mahsa-Alamshahi Nov 15, 2022
4176790
Getting all customers event done.
Mahsa-Alamshahi Nov 15, 2022
f550bd9
Getting all customers bloc completed.
Mahsa-Alamshahi Nov 15, 2022
86f98b6
Getting all customers completed.
Mahsa-Alamshahi Nov 15, 2022
030f88b
Getting all customers completed.
Mahsa-Alamshahi Nov 15, 2022
6996431
Add customer repository added.
Mahsa-Alamshahi Nov 15, 2022
9779d42
Add customer usecase added.
Mahsa-Alamshahi Nov 15, 2022
edf9510
Add customer bloc completed.
Mahsa-Alamshahi Nov 16, 2022
225b0b9
Add customer completed.
Mahsa-Alamshahi Nov 16, 2022
f2fbe5a
Delete customer repository completed.
Mahsa-Alamshahi Nov 16, 2022
f284c0b
Update customer repository completed.
Mahsa-Alamshahi Nov 16, 2022
3bea9c3
Add customer page UI changed.
Mahsa-Alamshahi Nov 16, 2022
af4c899
Customer list UI changed.
Mahsa-Alamshahi Nov 17, 2022
c895179
Customer list UI changed.
Mahsa-Alamshahi Nov 17, 2022
8f8ae1c
Date picker added.
Mahsa-Alamshahi Nov 17, 2022
7959e98
Unique fields added.
Mahsa-Alamshahi Nov 17, 2022
c7154d7
Update customer bugs fixed.
Mahsa-Alamshahi Nov 18, 2022
ae6886f
Some bugs fixed.
Mahsa-Alamshahi Nov 18, 2022
df53381
Phone number added.
Mahsa-Alamshahi Nov 18, 2022
4891c87
Phone number validation done.
Mahsa-Alamshahi Nov 18, 2022
9dfa2b3
Comleted.
Mahsa-Alamshahi Nov 19, 2022
165ef5c
Bugs fixed.
Mahsa-Alamshahi Nov 19, 2022
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
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.mc_crud_test"
minSdkVersion flutter.minSdkVersion
minSdkVersion 18 //flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<application
android:label="mc_crud_test"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<item android:drawable="@drawable/ic_launcher_foreground" />

<!-- You can insert your own image assets here -->
<!-- <item>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/customer_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/add_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/edit_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/main_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"filename" : "LaunchImage.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"filename" : "LaunchImage@2x.jpg",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"filename" : "LaunchImage@3x.jpg",
"scale" : "3x"
}
],
Expand Down
Diff not rendered.
Diff not rendered.
Diff not rendered.
92 changes: 92 additions & 0 deletions lib/config/app_theme.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import 'dart:ui';

import 'package:flutter/material.dart';

const Color primaryDarkColor = Color.fromARGB(255, 89, 85, 77);
const Color secondaryLightColor = Color.fromARGB(255, 33, 226, 218);
const Color secondaryDarkColor = Color.fromARGB(255, 191, 184, 170);
Color shadowColor = Colors.grey.shade700;

ThemeData appTheme() {
// Const Colors

return ThemeData(
brightness: Brightness.light,
primaryColor: primaryDarkColor,
shadowColor: shadowColor,
primaryColorDark: Colors.black87,

fontFamily: 'Georgia',

// Text Theme
textTheme: const TextTheme(
headline1: TextStyle(fontSize: 72.0, fontWeight: FontWeight.bold),
headline6: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic),
bodyText1: TextStyle(fontSize: 16.0, fontFamily: 'Hind'),
),

// elevatedButtonTheme
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
primary: secondaryLightColor,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
textStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.normal)),
),

// Card Theme
cardTheme: CardTheme(
color: Colors.grey.shade100,
elevation: 0,
shadowColor: shadowColor,
shape: RoundedRectangleBorder(
side: const BorderSide(width: 1.0),
borderRadius: BorderRadius.circular(4.0)),
),

// Floating Button
floatingActionButtonTheme: const FloatingActionButtonThemeData(
elevation: 16,
iconSize: 24.0,
backgroundColor: secondaryLightColor,
),

// Icon Them
iconTheme: const IconThemeData(
color: primaryDarkColor,
size: 20.0,
),

// Button Theme
// buttonColor: Color.fromARGB(255, 191, 179, 164),
buttonTheme: const ButtonThemeData(
buttonColor: secondaryLightColor,
shape: RoundedRectangleBorder(),
textTheme: ButtonTextTheme.primary,
),


inputDecorationTheme: const InputDecorationTheme(
labelStyle: TextStyle(fontSize: 14,),
errorStyle: TextStyle(
color: Colors.red, fontWeight: FontWeight.bold, fontSize: 14.0),
// border: UnderlineInputBorder(
// borderSide: BorderSide(color: primaryDarkColor, width: 1.0),
// ),
// focusedBorder: UnderlineInputBorder(
// borderSide: BorderSide(color: primaryDarkColor, width: 1.0),
// ),
// errorBorder: UnderlineInputBorder(
// borderSide: BorderSide(color: primaryDarkColor, width: 1.0),
// ),
// focusedErrorBorder: UnderlineInputBorder(
// borderSide: BorderSide(color: primaryDarkColor, width: 1.0),
// ),
),
);
}
17 changes: 17 additions & 0 deletions lib/core/data/data_source/local/customer_dao.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:floor/floor.dart';

import 'customer_entity.dart';

@dao
abstract class CustomerDao {

@insert
Future<void> insertCustomer(CustomerEntity customer);

@Query("SELECT * FROM CustomerEntity")
Future<List<CustomerEntity>> getAll();

@Query("SELECT * FROM CustomerEntity WHERE id =:customerId")
Future<CustomerEntity?> getCustomer(int customerId);

}
27 changes: 27 additions & 0 deletions lib/core/data/data_source/local/customer_entity.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:floor/floor.dart';

@Entity(indices: [
Index(value: ["firstName", "lastName", "dateOfBirth", "email"], unique: true)
])
class CustomerEntity {
@PrimaryKey(
autoGenerate: true,
)
int? id;
String? firstName;
String? lastName;
String? phoneNumber;
String? email;
String? bankAccountNumber;
String? dateOfBirth;

CustomerEntity({
this.id,
this.firstName,
this.lastName,
this.phoneNumber,
this.email,
this.bankAccountNumber,
this.dateOfBirth,
});
}
19 changes: 19 additions & 0 deletions lib/core/data/data_source/local/database.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

// required package imports
import 'dart:async';
import 'package:floor/floor.dart';
import 'package:mc_crud_test/core/data/data_source/local/customer_entity.dart';
import 'package:mc_crud_test/core/data/data_source/local/customer_dao.dart';

import 'package:sqflite/sqflite.dart' as sqflite;

import 'customer_entity.dart';


part 'database.g.dart'; // the generated code will be there


@Database(version: 1, entities: [CustomerEntity])
abstract class AppDatabase extends FloorDatabase {
CustomerDao get customerDao;
}
190 changes: 190 additions & 0 deletions lib/core/data/data_source/local/database.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading