✨ Firebase push notification
This commit is contained in:
@ -6,6 +6,7 @@ import 'package:solian/router.dart';
|
||||
import 'package:solian/screens/auth/signin.dart';
|
||||
import 'package:solian/screens/auth/signup.dart';
|
||||
import 'package:solian/widgets/account/account_heading.dart';
|
||||
import 'package:solian/widgets/account/push_notify_register_dialog.dart';
|
||||
|
||||
class AccountScreen extends StatefulWidget {
|
||||
const AccountScreen({super.key});
|
||||
@ -101,6 +102,31 @@ class _AccountScreenState extends State<AccountScreen> {
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
const Divider(thickness: 0.3, height: 0.3)
|
||||
.paddingSymmetric(vertical: 16),
|
||||
Wrap(
|
||||
spacing: 4,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Text(
|
||||
'pushNotifyRegisterAction'.tr,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withOpacity(0.85),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
const PushNotifyRegisterDialog(),
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
|
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
||||
import 'package:solian/exts.dart';
|
||||
import 'package:solian/providers/auth.dart';
|
||||
import 'package:solian/services.dart';
|
||||
import 'package:solian/widgets/account/push_notify_register_dialog.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
class SignInPopup extends StatefulWidget {
|
||||
@ -23,6 +24,11 @@ class _SignInPopupState extends State<SignInPopup> {
|
||||
final password = _passwordController.value.text;
|
||||
if (username.isEmpty || password.isEmpty) return;
|
||||
provider.signin(context, username, password).then((_) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) => const PushNotifyRegisterDialog(),
|
||||
);
|
||||
|
||||
Navigator.pop(context, true);
|
||||
}).catchError((e) {
|
||||
List<String> messages = e.toString().split('\n');
|
||||
|
Reference in New Issue
Block a user