fix: minor test

This commit is contained in:
akhdanre 2025-03-01 12:31:00 +07:00
parent a498687e15
commit f1bb4abd6d
7 changed files with 136 additions and 14 deletions

View File

@ -1,15 +1,11 @@
import 'package:flutter/src/widgets/navigator.dart'; import 'package:flutter/material.dart';
import 'package:get/get_navigation/src/routes/route_middleware.dart'; import 'package:get/get_navigation/src/routes/route_middleware.dart';
import 'package:quiz_app/app/routes/app_pages.dart'; import 'package:quiz_app/app/routes/app_pages.dart';
import 'package:quiz_app/core/utils/logger.dart';
class AuthMiddleware extends GetMiddleware { class AuthMiddleware extends GetMiddleware {
@override @override
RouteSettings? redirect(String? route) { RouteSettings? redirect(String? route) {
String name = "home"; if (route != null) return RouteSettings(name: AppRoutes.loginPage);
if (route != null && !route.contains(name)) return RouteSettings(name: AppRoutes.loginPage);
logC.i("its not contain");
return null; return null;
} }
} }

View File

@ -1,8 +1,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:quiz_app/core/utils/logger.dart';
class HomeView extends StatelessWidget { class HomeView extends StatelessWidget with WidgetsBindingObserver {
const HomeView({super.key}); const HomeView({super.key});
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
logC.i("the state is $state");
super.didChangeAppLifecycleState(state);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(

View File

@ -7,7 +7,10 @@ class LoginView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: Center( body: Center(
child: Text("login page"), child: GestureDetector(
onTap: () {},
child: Text("test work in background"),
),
), ),
); );
} }

View File

@ -0,0 +1,12 @@
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:quiz_app/core/utils/logger.dart';
class GlobalController extends GetxController with WidgetsBindingObserver {
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
logC.i("state $state");
}
}

View File

@ -1,6 +1,15 @@
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:quiz_app/app/app.dart'; import 'package:quiz_app/app/app.dart';
import 'package:quiz_app/core/utils/logger.dart';
void main() { void main() {
runApp(MyApp()); runZonedGuarded(() {
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}, (e, stackTrace) {
logC.e("issue message $e || $stackTrace");
});
} }

View File

@ -75,6 +75,11 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
get: get:
dependency: "direct main" dependency: "direct main"
description: description:
@ -83,6 +88,70 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.6.6" version: "4.6.6"
google_identity_services_web:
dependency: transitive
description:
name: google_identity_services_web
sha256: "55580f436822d64c8ff9a77e37d61f5fb1e6c7ec9d632a43ee324e2a05c3c6c9"
url: "https://pub.dev"
source: hosted
version: "0.3.3"
google_sign_in:
dependency: "direct main"
description:
name: google_sign_in
sha256: fad6ddc80c427b0bba705f2116204ce1173e09cf299f85e053d57a55e5b2dd56
url: "https://pub.dev"
source: hosted
version: "6.2.2"
google_sign_in_android:
dependency: transitive
description:
name: google_sign_in_android
sha256: "7af72e5502c313865c729223b60e8ae7bce0a1011b250c24edcf30d3d7032748"
url: "https://pub.dev"
source: hosted
version: "6.1.35"
google_sign_in_ios:
dependency: transitive
description:
name: google_sign_in_ios
sha256: "8468465516a6fdc283ffbbb06ec03a860ee34e9ff84b0454074978705b42379b"
url: "https://pub.dev"
source: hosted
version: "5.8.0"
google_sign_in_platform_interface:
dependency: transitive
description:
name: google_sign_in_platform_interface
sha256: "1f6e5787d7a120cc0359ddf315c92309069171306242e181c09472d1b00a2971"
url: "https://pub.dev"
source: hosted
version: "2.4.5"
google_sign_in_web:
dependency: transitive
description:
name: google_sign_in_web
sha256: ada595df6c30cead48e66b1f3a050edf0c5cf2ba60c185d69690e08adcc6281b
url: "https://pub.dev"
source: hosted
version: "0.12.4+3"
http:
dependency: transitive
description:
name: http
sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f
url: "https://pub.dev"
source: hosted
version: "1.3.0"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.dev"
source: hosted
version: "4.1.2"
leak_tracker: leak_tracker:
dependency: transitive dependency: transitive
description: description:
@ -155,6 +224,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.0" version: "1.9.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -208,6 +285,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.3" version: "0.7.3"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.dev"
source: hosted
version: "1.4.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -224,6 +309,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.3.0" version: "14.3.0"
web:
dependency: transitive
description:
name: web
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
sdks: sdks:
dart: ">=3.6.0 <4.0.0" dart: ">=3.6.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54" flutter: ">=3.24.0"

View File

@ -2,7 +2,7 @@ name: quiz_app
description: "A new Flutter project." description: "A new Flutter project."
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages. # pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: "none" # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application. # The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43 # A version number is three numbers separated by dots, like 1.2.43
@ -31,12 +31,13 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8 cupertino_icons: ^1.0.8
get: ^4.6.6 get: ^4.6.6
logger: ^2.5.0 logger: ^2.5.0
google_sign_in: ^6.2.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
@ -53,7 +54,6 @@ dev_dependencies:
# The following section is specific to Flutter packages. # The following section is specific to Flutter packages.
flutter: flutter:
# The following line ensures that the Material Icons font is # The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in # included with your application, so that you can use the icons in
# the material Icons class. # the material Icons class.