44 lines
1.4 KiB
Dart
44 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:notube/constants.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:notube/states/dlFormState.dart';
|
|
|
|
class SubmitButton extends StatefulWidget {
|
|
const SubmitButton({super.key});
|
|
|
|
@override
|
|
State<SubmitButton> createState() => _SubmitButtonState();
|
|
}
|
|
|
|
class _SubmitButtonState extends State<SubmitButton> {
|
|
bool isHovering = false;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var dlForm = context.watch<DlFormState>();
|
|
return ConstrainedBox(
|
|
constraints: BoxConstraints.tightFor(width: 200),
|
|
child: MouseRegion(
|
|
cursor: SystemMouseCursors.click,
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
dlForm.download();
|
|
},
|
|
child: InkWell(
|
|
onHover: (hovering) {
|
|
debugPrint('Hovering: $hovering');
|
|
setState(() => isHovering = hovering);
|
|
},
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(vertical: 14),
|
|
decoration: BoxDecoration(
|
|
color: isHovering ? colorDarkRed : colorMainRed,
|
|
),
|
|
child: const Text('Ok', textAlign: TextAlign.center).tr(),
|
|
),
|
|
))),
|
|
);
|
|
}
|
|
}
|