Skip to content

Commit

Permalink
#359: updated button
Browse files Browse the repository at this point in the history
  • Loading branch information
jorre127 committed Oct 18, 2024
1 parent e3fb018 commit 83a0461
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
25 changes: 21 additions & 4 deletions lib/screen/logs/logs_screen.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_navigation_generator_annotations/flutter_navigation_generator_annotations.dart';
import 'package:flutter_template/di/injectable.dart';
import 'package:flutter_template/styles/theme_assets.dart';
import 'package:flutter_template/styles/theme_data.dart';
import 'package:flutter_template/util/extension/date_time_extension.dart';
import 'package:flutter_template/viewmodel/logs/logs_viewmodel.dart';
import 'package:flutter_template/widget/general/simple_screen/base_screen.dart';
import 'package:flutter_template/widget/general/styled/flutter_template_button.dart';
import 'package:flutter_template/widget/general/svg_icon.dart';
import 'package:flutter_template/widget/provider/provider_widget.dart';
import 'package:icapps_architecture/icapps_architecture.dart';

Expand All @@ -28,16 +30,31 @@ class LogsScreenState extends State<LogsScreen> {
child: Column(
children: [
Expanded(
child: ListView.builder(
child: ListView.separated(
padding: const EdgeInsets.symmetric(vertical: 16),
itemCount: viewModel.availableDates.length,
separatorBuilder: (context, index) => const SizedBox(height: 8),
itemBuilder: (context, index) {
final item = viewModel.availableDates[index];
return TouchFeedBack(
onTapped: () => viewModel.onLogTapped(item),
child: Text(
item.shortDateWeekdayFormat,
style: theme.text.bodyBig,
color: theme.inverseBackground,
borderRadius: BorderRadius.circular(12),
child: Padding(
padding: const EdgeInsets.all(16),
child: Row(
children: [
Expanded(
child: Text(
item.shortDateWeekdayFormat,
style: theme.text.bodyBig,
),
),
const SvgIcon(
svgAsset: ThemeAssets.chevronRightIcon,
)
],
),
),
);
},
Expand Down
2 changes: 1 addition & 1 deletion lib/styles/theme_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ThemeColors {
static const fadedGrey = Color(0xFF6C7B89);
static const mediumGrey = Color(0x80000000); //black 50%
static const lightGrey = Color(0xFFDDE1E4);
static const backgroundGrey = Color(0xFFF1F2F3);
static const backgroundGrey = Color(0xFFF9FAFC);
static const disabledGrey = Color(0xFFE6E6E6);
static const shadow = Color(0x1e000000); //black 12%
static const error = Color(0xFFE30000);
Expand Down
5 changes: 5 additions & 0 deletions lib/widget/debug/debug_row_item.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_template/styles/theme_assets.dart';
import 'package:flutter_template/styles/theme_data.dart';
import 'package:flutter_template/widget/general/svg_icon.dart';
import 'package:flutter_template/widget/provider/data_provider_widget.dart';
import 'package:icapps_architecture/icapps_architecture.dart';

Expand Down Expand Up @@ -42,6 +44,9 @@ class DebugRowItem extends StatelessWidget {
],
),
),
const SvgIcon(
svgAsset: ThemeAssets.chevronRightIcon,
),
],
),
),
Expand Down
12 changes: 10 additions & 2 deletions lib/widget/general/styled/flutter_template_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,26 @@ class FlutterTemplateButton extends StatelessWidget {
);
if (context.isIOSTheme) {
return TouchFeedBack(
borderRadius: BorderRadius.circular(12),
onTapped: isEnabled ? onClick : null,
child: AnimatedContainer(
color: isEnabled ? _enabledButtonColor(theme) : _disabledButtonColor(theme),
decoration: BoxDecoration(
color: isEnabled ? _enabledButtonColor(theme) : _disabledButtonColor(theme),
borderRadius: BorderRadius.circular(12),
),
duration: ThemeDurations.shortAnimationDuration,
child: content,
),
);
}
return AnimatedContainer(
color: isEnabled ? _enabledButtonColor(theme) : _disabledButtonColor(theme),
decoration: BoxDecoration(
color: isEnabled ? _enabledButtonColor(theme) : _disabledButtonColor(theme),
borderRadius: BorderRadius.circular(12),
),
duration: ThemeDurations.shortAnimationDuration,
child: TouchFeedBack(
borderRadius: BorderRadius.circular(12),
onTapped: isEnabled ? onClick : null,
child: content,
),
Expand Down

0 comments on commit 83a0461

Please sign in to comment.