Skip to content

Commit

Permalink
Merge pull request #194 from LezdCS/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
LezdCS authored May 31, 2024
2 parents 2b92d76 + b7c48cf commit c4f8e61
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 38 deletions.
10 changes: 8 additions & 2 deletions lib/src/core/resources/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ class Themes {
tertiary: Colors.deepPurpleAccent[200],
tertiaryContainer: Colors.grey[850],
),
textTheme: const TextTheme(bodyLarge: TextStyle(color: Colors.white)),
textTheme: const TextTheme(
bodyLarge: TextStyle(color: Colors.white),
bodyMedium: TextStyle(color: Color.fromARGB(255, 75, 75, 75)),
),
primaryIconTheme: const IconThemeData(color: Colors.white),
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(
Expand Down Expand Up @@ -69,7 +72,10 @@ class Themes {
tertiary: Colors.deepPurpleAccent[200],
tertiaryContainer: Colors.grey[850],
),
textTheme: const TextTheme(bodyLarge: TextStyle(color: Colors.black)),
textTheme: const TextTheme(
bodyLarge: TextStyle(color: Colors.black),
bodyMedium: TextStyle(color: Color.fromARGB(255, 75, 75, 75)),
),
primaryIconTheme: const IconThemeData(color: Colors.black),
inputDecorationTheme: const InputDecorationTheme(
border: OutlineInputBorder(
Expand Down
96 changes: 64 additions & 32 deletions lib/src/presentation/widgets/settings/chats_joined.dart
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,11 @@ class ChatsJoined extends GetView<SettingsViewController> {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Form(
child: Column(
children: [
Obx(
() => DropdownButton(
Obx(
() => Form(
child: Column(
children: [
DropdownButton(
value: selectedPlatform.toString(),
items: List.generate(Platform.values.length, (index) {
String badge = '';
Expand Down Expand Up @@ -387,41 +387,73 @@ class ChatsJoined extends GetView<SettingsViewController> {
selectedPlatform.value = pFromS;
},
),
),
TextFormField(
controller: channelTextController,
textInputAction: TextInputAction.send,
style: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
),
maxLines: 1,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter the channel name';
}
return null;
},
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
enabledBorder: Theme.of(context).inputDecorationTheme.border,
hintStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
fontSize: 16),
labelStyle: TextStyle(
TextFormField(
controller: channelTextController,
textInputAction: TextInputAction.send,
style: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
),
hintText: 'Channel name',
labelText: 'Channel name',
maxLines: 1,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter the channel name';
}
return null;
},
decoration: InputDecoration(
helperText: _getHelperText(selectedPlatform.value),
helperStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
),
isDense: true,
contentPadding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
enabledBorder:
Theme.of(context).inputDecorationTheme.border,
hintStyle: TextStyle(
color: Theme.of(context).textTheme.bodyMedium!.color,
fontSize: 16,
),
labelStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
),
hintText: _getHintText(selectedPlatform.value),
labelText: _getHintText(selectedPlatform.value),
),
),
),
],
],
),
),
),
],
);
}

String _getHelperText(Platform platform) {
switch (platform) {
case Platform.twitch:
return '';
case Platform.kick:
return '';
case Platform.youtube:
return 'Ex: youtube.com/@channel/streams';
default:
return '';
}
}

String _getHintText(Platform platform) {
switch (platform) {
case Platform.twitch:
return 'Channel name';
case Platform.kick:
return 'Channel name';
case Platform.youtube:
return 'Channel URL';
default:
return '';
}
}
}

extension StringCasingExtension on String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Widget _addDialog(context, SettingsViewController controller) {
const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
enabledBorder: Theme.of(context).inputDecorationTheme.border,
hintStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
color: Theme.of(context).textTheme.bodyMedium!.color,
fontSize: 16),
labelStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
Expand Down Expand Up @@ -317,7 +317,7 @@ Widget _addDialog(context, SettingsViewController controller) {
const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
enabledBorder: Theme.of(context).inputDecorationTheme.border,
hintStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
color: Theme.of(context).textTheme.bodyMedium!.color,
fontSize: 16),
labelStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
Expand Down Expand Up @@ -402,7 +402,7 @@ Widget _editDialog(context, SettingsViewController controller, elem) {
const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
enabledBorder: Theme.of(context).inputDecorationTheme.border,
hintStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
color: Theme.of(context).textTheme.bodyMedium!.color,
fontSize: 16),
hintText: 'Tab title',
labelText: 'Title',
Expand Down Expand Up @@ -435,7 +435,7 @@ Widget _editDialog(context, SettingsViewController controller, elem) {
const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
enabledBorder: Theme.of(context).inputDecorationTheme.border,
hintStyle: TextStyle(
color: Theme.of(context).textTheme.bodyLarge!.color,
color: Theme.of(context).textTheme.bodyMedium!.color,
fontSize: 16),
hintText: 'Tab url',
labelText: 'URL',
Expand Down

0 comments on commit c4f8e61

Please sign in to comment.