2019-01-31 07:37:25 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../providers/settings.dart';
|
|
|
|
|
|
|
|
class Link extends StatelessWidget {
|
|
|
|
final Widget child;
|
|
|
|
final GestureTapCallback onTap;
|
2019-02-06 06:06:11 +01:00
|
|
|
final Color bgColor;
|
2019-01-31 07:37:25 +01:00
|
|
|
|
2019-02-06 06:06:11 +01:00
|
|
|
Link({@required this.child, @required this.onTap, this.bgColor});
|
2019-01-31 07:37:25 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Material(
|
|
|
|
child: Ink(
|
2019-02-06 06:06:11 +01:00
|
|
|
color: bgColor ?? Colors.white,
|
2019-01-31 07:37:25 +01:00
|
|
|
child: InkWell(
|
|
|
|
splashColor:
|
|
|
|
SettingsProvider.of(context).layout == LayoutMap.cupertino
|
|
|
|
? Colors.transparent
|
|
|
|
: null,
|
|
|
|
onTap: onTap,
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|