Replace Telegram widget with bot login
All checks were successful
Build and deploy Flutter Web / build (push) Successful in 2m22s
All checks were successful
Build and deploy Flutter Web / build (push) Successful in 2m22s
This commit is contained in:
@@ -1,2 +1,26 @@
|
||||
export 'telegram_login_button_stub.dart'
|
||||
if (dart.library.html) 'telegram_login_button_web.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TelegramLoginButton extends StatelessWidget {
|
||||
const TelegramLoginButton({
|
||||
required this.onPressed,
|
||||
required this.loading,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final VoidCallback? onPressed;
|
||||
final bool loading;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FilledButton.icon(
|
||||
onPressed: loading ? null : onPressed,
|
||||
icon: loading
|
||||
? const SizedBox.square(
|
||||
dimension: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.telegram),
|
||||
label: const Text('Войти через Telegram'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user