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
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,10 +22,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 34
ndkVersion flutter.ndkVersion
Expand Down
12 changes: 0 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
buildscript {
ext.kotlin_version = '1.8.0'
repositories {
mavenCentral()
google()

}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:' + String.valueOf(kotlin_version)
}
}

allprojects {
repositories {
Expand Down
7 changes: 4 additions & 3 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#Tue Dec 02 12:56:57 IRST 2025
android.enableJetifier=true
android.useAndroidX=true
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
android.useAndroidX=true
android.enableJetifier=true
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.0" apply false
}

include ":app"
2 changes: 1 addition & 1 deletion lib/component/button_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class AppButtonStyles {
AppButtonStyles._();

static ButtonStyle mainButtonStyle = ButtonStyle(
shape: MaterialStatePropertyAll(RoundedRectangleBorder(
shape: WidgetStatePropertyAll(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppDimens.medium))));
}
1 change: 1 addition & 0 deletions lib/component/decoratios.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 0 additions & 1 deletion lib/component/text_style.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:watch_store/gen/fonts.gen.dart';
import 'package:watch_store/res/colors.dart';
Expand Down
9 changes: 4 additions & 5 deletions lib/component/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ ThemeData lightTheme() {
brightness: Brightness.light,
iconTheme: const IconThemeData(color: Colors.black),
primaryColor: AppColors.primaryColor,
elevatedButtonTheme: ElevatedButtonThemeData(
elevatedButtonTheme: const ElevatedButtonThemeData(
style: ButtonStyle(
backgroundColor:
const MaterialStatePropertyAll(AppColors.primaryColor))),
backgroundColor: WidgetStatePropertyAll(AppColors.primaryColor))),
scaffoldBackgroundColor: AppColors.scaffoldBackgroundColor,
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: MaterialStateColor.resolveWith((states) {
if (states.contains(MaterialState.focused)) {
fillColor: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.focused)) {
return AppColors.focusedTextField;
} else {
return AppColors.unFocusedTextField;
Expand Down
12 changes: 6 additions & 6 deletions lib/data/model/banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class Banner {
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['image'] = this.image;
data['created_at'] = this.createdAt.toIso8601String();
data['updated_at'] = this.updatedAt.toIso8601String();
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['title'] = title;
data['image'] = image;
data['created_at'] = createdAt.toIso8601String();
data['updated_at'] = updatedAt.toIso8601String();
return data;
}
}
2 changes: 1 addition & 1 deletion lib/data/model/category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Category {
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['title'] = title;
data['image'] = image;
Expand Down
8 changes: 4 additions & 4 deletions lib/data/model/product_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ProductDetailes {
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['title'] = title;
data['title_en'] = titleEn;
Expand Down Expand Up @@ -120,7 +120,7 @@ class Colors {
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['title'] = title;
data['code'] = code;
return data;
Expand All @@ -139,7 +139,7 @@ class Properties {
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['property'] = property;
data['value'] = value;
return data;
Expand All @@ -158,7 +158,7 @@ class Comments {
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['user'] = user;
data['body'] = body;
return data;
Expand Down
4 changes: 1 addition & 3 deletions lib/data/model/user.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import 'dart:convert';

import 'package:flutter/material.dart';

class User {
final String name;
final String phone;
final String address;
final String postalCode;
final image;
final dynamic image;
final double lat;
final double lng;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/data/repo/user_repp.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter_osm_plugin/flutter_osm_plugin.dart';
import 'package:watch_store/data/model/order.dart';
import 'package:watch_store/data/model/userInfo.dart';
import 'package:watch_store/data/model/userinfo.dart';
import 'package:watch_store/data/src/user_data_src.dart';

abstract class IUserRepo {
Expand Down
6 changes: 3 additions & 3 deletions lib/data/src/home_data_src.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class HomeRemoteDataSrc implements IHomeDataSrc {

@override
Future<Home> getHome() async {
final Home _home;
final Home home;

final response = await httpClient.get(Endpoints.home);
HTTPResponseValidator.isValidStatusCode(response.statusCode ?? 0);
_home = Home.fromJson(response.data['data']);
return _home;
home = Home.fromJson(response.data['data']);
return home;
}
}
2 changes: 1 addition & 1 deletion lib/data/src/user_data_src.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter_osm_plugin/flutter_osm_plugin.dart';
import 'package:watch_store/data/model/order.dart';
import 'package:watch_store/data/model/userInfo.dart';
import 'package:watch_store/data/model/userinfo.dart';

abstract class IUserDataSrc {
Future<UserInfo> getUserInfo();
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MyApp extends StatelessWidget {
},
),
],
child: MainScreen(),
child: const MainScreen(),
);
} else if (state is LoggedOutState) {
return SendSmsScreen();
Expand Down
10 changes: 3 additions & 7 deletions lib/res/dimens.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@



class AppDimens{
AppDimens._();
class AppDimens {
AppDimens._();
static const double small = 8;
static const double medium = 12;
static const double large = 24;

}
}
8 changes: 4 additions & 4 deletions lib/route/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import 'package:watch_store/screens/register/register_screen.dart';

Map<String, Widget Function(BuildContext)> routes = {
ScreenNames.sendSmsScreen: (context) => SendSmsScreen(),
ScreenNames.verifyCodeScreen: (context) => VerifyCodeScreen(),
ScreenNames.registerScreen: (context) => RegisterScreen(),
ScreenNames.mainScreen: (context) => MainScreen(),
ScreenNames.productListScreen: (context) => ProductListScreen(),
ScreenNames.verifyCodeScreen: (context) => const VerifyCodeScreen(),
ScreenNames.registerScreen: (context) => const RegisterScreen(),
ScreenNames.mainScreen: (context) => const MainScreen(),
ScreenNames.productListScreen: (context) => const ProductListScreen(),
ScreenNames.productSingleScreen: (context) => const ProductSingleScreen(),
};
2 changes: 1 addition & 1 deletion lib/screens/auth/cubit/auth_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class LoadingState extends AuthState {}
final class ErrorState extends AuthState {}

final class SentState extends AuthState {
final mobile;
final String mobile;
SentState({required this.mobile});
}

Expand Down
5 changes: 1 addition & 4 deletions lib/screens/auth/send_sms_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:watch_store/gen/assets.gen.dart';
import 'package:watch_store/res/dimens.dart';
Expand All @@ -13,10 +11,9 @@ import 'package:watch_store/widgets/main_button.dart';

class SendSmsScreen extends StatelessWidget {
SendSmsScreen({super.key});
TextEditingController _controller = TextEditingController();
final TextEditingController _controller = TextEditingController();
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Scaffold(
body: SafeArea(
child: SizedBox(
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/auth/verify_code_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import 'package:watch_store/widgets/app_text_field.dart';
import 'package:watch_store/widgets/main_button.dart';

class VerifyCodeScreen extends StatefulWidget {
VerifyCodeScreen({super.key});
const VerifyCodeScreen({super.key});

@override
State<VerifyCodeScreen> createState() => _VerifyCodeScreenState();
}

class _VerifyCodeScreenState extends State<VerifyCodeScreen> {
TextEditingController _controller = TextEditingController();
final TextEditingController _controller = TextEditingController();

@override
void initState() {
Expand Down
1 change: 0 additions & 1 deletion lib/screens/cart/bloc/cart_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/physics.dart';
import 'package:watch_store/data/model/cart.dart';
import 'package:watch_store/data/repo/cart_repo.dart';

Expand Down
8 changes: 4 additions & 4 deletions lib/screens/cart/cart_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class CartScreen extends StatelessWidget {
onTap: () =>
BlocProvider.of<CartBloc>(context).add(PayEvent()),
child: Container(
padding: EdgeInsets.all(AppDimens.medium),
margin: EdgeInsets.all(AppDimens.medium),
padding: const EdgeInsets.all(AppDimens.medium),
margin: const EdgeInsets.all(AppDimens.medium),
decoration: const BoxDecoration(
color: AppColors.surfaceColor,
borderRadius: BorderRadius.all(
Expand Down Expand Up @@ -159,8 +159,8 @@ class CartScreen extends StatelessWidget {
}

class CartList extends StatelessWidget {
List<CartModel> list;
CartList({super.key, required this.list});
final List<CartModel> list;
const CartList({super.key, required this.list});

@override
Widget build(BuildContext context) {
Expand Down
2 changes: 0 additions & 2 deletions lib/screens/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:watch_store/data/repo/home_rep.dart';
import 'package:watch_store/gen/assets.gen.dart';
import 'package:watch_store/res/colors.dart';
import 'package:watch_store/res/dimens.dart';
import 'package:watch_store/res/strings.dart';
import 'package:watch_store/screens/home/bloc/home_bloc.dart';
import 'package:watch_store/screens/product_list/product_list_screen.dart';
import 'package:watch_store/widgets/app_slider.dart';
Expand All @@ -20,7 +19,6 @@ class HomeScreen extends StatelessWidget {

@override
Widget build(BuildContext context) {
Size size = MediaQuery.sizeOf(context);
return BlocProvider(
create: (context) {
final homeBloc = HomeBloc(homeRepository);
Expand Down
Loading