forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgradient_button.dart
More file actions
50 lines (47 loc) · 1.46 KB
/
Copy pathgradient_button.dart
File metadata and controls
50 lines (47 loc) · 1.46 KB
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
40
41
42
43
44
45
46
47
48
49
50
import 'package:flutter/material.dart';
import 'package:gradient_borders/gradient_borders.dart';
class GradientButton extends StatelessWidget {
final String title;
final VoidCallback onPressed;
const GradientButton({super.key, required this.title, required this.onPressed});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
border: const GradientBoxBorder(
gradient: LinearGradient(
colors: [
Color.fromARGB(127, 208, 208, 208),
Color.fromARGB(127, 188, 99, 121),
Color.fromARGB(127, 86, 101, 182),
Color.fromARGB(127, 126, 190, 236),
],
),
width: 2,
),
borderRadius: BorderRadius.circular(12),
),
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: const Color.fromARGB(255, 17, 17, 17),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
),
child: Container(
width: double.infinity,
height: 45,
alignment: Alignment.center,
child: Text(
title,
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 18,
color: Color.fromARGB(255, 255, 255, 255),
),
),
),
),
);
}
}