CreateGroupView erstellt #28
36
lib/presentation/widgets/custom_search_bar.dart
Normal file
36
lib/presentation/widgets/custom_search_bar.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:game_tracker/core/custom_theme.dart';
|
||||
|
||||
class CustomSearchBar extends StatelessWidget {
|
||||
final TextEditingController controller;
|
||||
final String hintText;
|
||||
final ValueChanged<String>? onChanged;
|
||||
final BoxConstraints? constraints;
|
||||
|
||||
const CustomSearchBar({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.hintText,
|
||||
this.onChanged,
|
||||
this.constraints,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SearchBar(
|
||||
controller: controller,
|
||||
constraints:
|
||||
constraints ?? const BoxConstraints(maxHeight: 45, minHeight: 45),
|
||||
hintText: hintText,
|
||||
onChanged: onChanged,
|
||||
hintStyle: MaterialStateProperty.all(const TextStyle(fontSize: 16)),
|
||||
|
sneeex marked this conversation as resolved
Outdated
|
||||
leading: const Icon(Icons.search),
|
||||
backgroundColor: MaterialStateProperty.all(CustomTheme.boxColor),
|
||||
|
sneeex marked this conversation as resolved
Outdated
flixcoo
commented
MaterialStateProperty ist deprecated MaterialStateProperty ist deprecated
|
||||
side: MaterialStateProperty.all(BorderSide(color: CustomTheme.boxBorder)),
|
||||
|
sneeex marked this conversation as resolved
Outdated
flixcoo
commented
MaterialStateProperty ist deprecated MaterialStateProperty ist deprecated
|
||||
shape: MaterialStateProperty.all(
|
||||
|
sneeex marked this conversation as resolved
Outdated
flixcoo
commented
MaterialStateProperty ist deprecated MaterialStateProperty ist deprecated
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
elevation: MaterialStateProperty.all(0),
|
||||
|
sneeex marked this conversation as resolved
Outdated
flixcoo
commented
MaterialStateProperty ist deprecated MaterialStateProperty ist deprecated
|
||||
);
|
||||
}
|
||||
}
|
||||
38
lib/presentation/widgets/text_input_field.dart
Normal file
38
lib/presentation/widgets/text_input_field.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:game_tracker/core/custom_theme.dart';
|
||||
|
||||
class TextInputField extends StatelessWidget {
|
||||
final TextEditingController controller;
|
||||
final ValueChanged<String>? onChanged;
|
||||
final String hintText;
|
||||
|
||||
const TextInputField({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.hintText,
|
||||
this.onChanged,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextField(
|
||||
controller: controller,
|
||||
onChanged: onChanged,
|
||||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
fillColor: CustomTheme.boxColor,
|
||||
hintText: hintText,
|
||||
hintStyle: const TextStyle(fontSize: 18),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
borderSide: BorderSide(color: CustomTheme.boxBorder),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
borderSide: BorderSide(color: CustomTheme.boxBorder),
|
||||
),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
42
lib/presentation/widgets/tiles/text_icon_list_tile.dart
Normal file
42
lib/presentation/widgets/tiles/text_icon_list_tile.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:game_tracker/core/custom_theme.dart';
|
||||
|
||||
class IconListTile extends StatelessWidget {
|
||||
|
sneeex marked this conversation as resolved
Outdated
flixcoo
commented
Klassenname stimmt nicht mit Dateiname überein Klassenname stimmt nicht mit Dateiname überein
|
||||
final String text;
|
||||
final IconData icon;
|
||||
|
sneeex marked this conversation as resolved
Outdated
flixcoo
commented
Falls das Icon bisher nur ein Icon ist, ggf. nur das Icon deaktivierbar machen anstatt es komplett selbst zu setzen Falls das Icon bisher nur ein Icon ist, ggf. nur das Icon deaktivierbar machen anstatt es komplett selbst zu setzen
|
||||
final VoidCallback onPressed;
|
||||
|
||||
const IconListTile({
|
||||
|
sneeex marked this conversation as resolved
flixcoo
commented
|
||||
super.key,
|
||||
required this.text,
|
||||
required this.icon,
|
||||
|
sneeex marked this conversation as resolved
Outdated
flixcoo
commented
onPressed sollte nich required sein wenn das icon nicht immer zu sehen ist onPressed sollte nich required sein wenn das icon nicht immer zu sehen ist
|
||||
required this.onPressed,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: CustomTheme.boxColor,
|
||||
border: Border.all(color: CustomTheme.boxBorder),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
IconButton(icon: Icon(icon, size: 20), onPressed: onPressed),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
44
lib/presentation/widgets/tiles/text_icon_tile.dart
Normal file
44
lib/presentation/widgets/tiles/text_icon_tile.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:game_tracker/core/custom_theme.dart';
|
||||
|
||||
class TextIconTile extends StatelessWidget {
|
||||
final String text;
|
||||
final IconData? icon;
|
||||
|
sneeex marked this conversation as resolved
Outdated
flixcoo
commented
Falls das Icon bisher nur ein Icon ist, ggf. nur das Icon deaktivierbar machen anstatt es komplett selbst zu setzen Falls das Icon bisher nur ein Icon ist, ggf. nur das Icon deaktivierbar machen anstatt es komplett selbst zu setzen
|
||||
final VoidCallback? onIconTap;
|
||||
|
||||
const TextIconTile({
|
||||
super.key,
|
||||
required this.text,
|
||||
this.icon,
|
||||
this.onIconTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
color: CustomTheme.onBoxColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (icon != null) const SizedBox(width: 3),
|
||||
Flexible(
|
||||
child: Text(
|
||||
text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
if (icon != null) ...<Widget>[
|
||||
const SizedBox(width: 3),
|
||||
GestureDetector(onTap: onIconTap, child: Icon(icon, size: 20)),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user
MaterialStatePropertyist deprecated