revanced-manager/lib/ui/widgets/rootCheckerView/magisk_button.dart

43 lines
1.1 KiB
Dart
Raw Normal View History

2022-08-14 16:03:01 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
2022-08-14 16:03:01 +02:00
import 'package:flutter_svg/flutter_svg.dart';
class MagiskButton extends StatelessWidget {
2022-08-18 16:33:33 +02:00
final Function() onPressed;
2022-08-14 16:03:01 +02:00
const MagiskButton({
Key? key,
2022-08-18 16:33:33 +02:00
required this.onPressed,
2022-08-14 16:03:01 +02:00
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
2022-08-14 16:03:01 +02:00
GestureDetector(
onTap: onPressed,
child: CircleAvatar(
radius: 32,
backgroundColor: Theme.of(context).colorScheme.primary,
2022-08-14 16:03:01 +02:00
child: SvgPicture.asset(
'assets/images/magisk.svg',
color: Theme.of(context).colorScheme.surface,
height: 40,
width: 40,
2022-08-14 16:03:01 +02:00
),
),
),
const SizedBox(height: 8),
I18nText(
'rootCheckerView.grantPermission',
child: const Text(
2022-08-14 16:03:01 +02:00
'',
style: TextStyle(fontSize: 15),
2022-08-14 16:03:01 +02:00
),
),
],
);
}
}