You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
import 'package:flutter/Material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import '../values/constants.dart';
|
|
|
|
class SearchBarComponent extends StatefulWidget {
|
|
final String? text;
|
|
final VoidCallback? callback;
|
|
const SearchBarComponent({Key? key, this.text, this.callback})
|
|
: super(key: key);
|
|
|
|
@override
|
|
State<SearchBarComponent> createState() => _SearchBarComponentState();
|
|
}
|
|
|
|
class _SearchBarComponentState extends State<SearchBarComponent> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: widget.callback,
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
child: Container(
|
|
constraints: BoxConstraints(maxWidth: 600),
|
|
color: searchBarColor,
|
|
width: double.infinity,
|
|
padding: EdgeInsets.fromLTRB(defaultPadding, 16, defaultPadding, 16),
|
|
child: Text(
|
|
widget.text ?? "Chercher une musique...",
|
|
style: GoogleFonts.plusJakartaSans(color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|