Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve sign in with google error #540

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/app/modules/home/views/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,7 @@ class HomeView extends GetView<HomeController> {
axisDirection: AxisDirection.down,
child: Obx(() {
return FutureBuilder(
future: controller.isUserSignedIn.value
? controller
.initStream(controller.userModel.value)
: controller
.initStream(controller.userModel.value),
future: controller.initStream(controller.userModel.value),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
final Stream streamAlarms = snapshot.data;
Expand Down
34 changes: 16 additions & 18 deletions lib/app/modules/settings/views/google_sign_in.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/settings_controller.dart';
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/theme_controller.dart';
Expand Down Expand Up @@ -148,26 +150,23 @@ class GoogleSignIn extends StatelessWidget {
isLightMode: themeController.isLightMode.value,
),
child: Padding(
padding: EdgeInsets.only(left: 30, right: 30),
padding: const EdgeInsets.only(left: 30, right: 30),
child: Row(
children: [
Obx(
() => Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
(controller.isUserLoggedIn.value)
?
// 'Unlink ${controller.userModel!.email}'
'Unlink @usermail'.trParams(
{'usermail': controller.userModel!.email})
: 'Sign-In with Google'.tr,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
overflow: TextOverflow.ellipsis,
),
Expanded(
child: Obx(
() =>Text(
overflow:TextOverflow.ellipsis ,
(controller.isUserLoggedIn.value)
?
// 'Unlink ${controller.userModel!.email}'
'Unlink @usermail'.trParams(
{'usermail': controller.userModel!.email})
: 'Sign-In with Google'.tr,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
overflow: TextOverflow.ellipsis,
),
],
),
),
),
IconButton(
Expand Down Expand Up @@ -295,7 +294,6 @@ class GoogleSignIn extends StatelessWidget {
: kprimaryTextColor.withOpacity(0.3),
),
),
Spacer(),
Obx(
() => Icon(
(controller.isUserLoggedIn.value)
Expand Down