-
Notifications
You must be signed in to change notification settings - Fork 13
/
platform_button.dart
39 lines (35 loc) · 1.09 KB
/
platform_button.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:voice/constants/strings.dart';
import 'package:voice/constants/theme.dart';
import 'package:voice/widget/platform_widget.dart';
class PlatformButton extends PlatformWidget<CupertinoButton, MaterialButton> {
final onPressed;
PlatformButton({this.onPressed});
@override
MaterialButton createAndroidWidget(BuildContext context) {
return MaterialButton(
onPressed: onPressed,
color: VoiceTheme.blaze_orange,
child: Directionality(
textDirection: TextDirection.ltr,
child: Text(
Strings.label_try_again,
style: TextStyle(color: Colors.white),
)),
);
}
@override
CupertinoButton createIosWidget(BuildContext context) {
return CupertinoButton(
onPressed: onPressed,
color: VoiceTheme.blaze_orange,
child: Directionality(
textDirection: TextDirection.ltr,
child: Text(
Strings.label_try_again,
style: TextStyle(color: Colors.white),
)),
);
}
}