Skip to content

Commit

Permalink
Merge pull request #11 from Iconica-Development/bugfix/control_page
Browse files Browse the repository at this point in the history
fix: title spacing control_page
  • Loading branch information
Gorter-dev authored Sep 2, 2024
2 parents 0438e06 + 8ba6012 commit e73e32e
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 48 deletions.
13 changes: 0 additions & 13 deletions .flutter-plugins

This file was deleted.

1 change: 0 additions & 1 deletion .flutter-plugins-dependencies

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Iconica Standard Component Release Workflow
# Workflow Caller version: 1.0.0

on:
release:
types: [published]

workflow_dispatch:

jobs:
call-global-iconica-workflow:
uses: Iconica-Development/.github/.github/workflows/component-release.yml@master
secrets: inherit
permissions: write-all
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 5.1.0

* Upgraded flutter_profile and flutter_input_library
* Added spacing to `control.page` title when no icon is provided
* Added `onTap` callback to `control.page` to allow for custom actions

## 5.0.0

* Remove partOfGroup from controllwrapper parameter.
Expand Down
29 changes: 3 additions & 26 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:example/main.dart';
import "package:flutter_test/flutter_test.dart";

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());

// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);

// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();

// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
test("adds one to input values", () {
expect(1 + 1, 2);
});
}
5 changes: 5 additions & 0 deletions lib/src/ui/control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Control extends ChangeNotifier {
this.isLastSettingInGroup = false,
this.hintText,
this.initialValue,
this.onTap,
});

factory Control.custom({
Expand All @@ -74,6 +75,7 @@ class Control extends ChangeNotifier {
required String title,
String? description,
Icon? preficIcon,
void Function()? onTap,
}) =>
Control(
type: ControlType.page,
Expand All @@ -82,6 +84,7 @@ class Control extends ChangeNotifier {
settings: controls,
description: description,
prefixIcon: preficIcon,
onTap: onTap,
);

factory Control.radio({
Expand Down Expand Up @@ -409,6 +412,8 @@ class Control extends ChangeNotifier {
/// The initial value of the input field
String? initialValue;

void Function()? onTap;

void change(value) {
onChange?.call(value);
notifyListeners();
Expand Down
6 changes: 6 additions & 0 deletions lib/src/ui/input_field_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ class _InputFieldGeneratorState extends State<InputFieldGenerator> {
var theme = Theme.of(context);
return GestureDetector(
onTap: () async {
if (setting.onTap != null) {
setting.onTap!();
return;
}
await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => Scaffold(
Expand Down Expand Up @@ -490,6 +494,8 @@ class _InputFieldGeneratorState extends State<InputFieldGenerator> {
width: 64,
child: setting.prefixIcon,
),
] else ...[
const SizedBox(width: 20),
],
Column(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down
15 changes: 7 additions & 8 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: flutter_settings
description: "Iconica Flutter Settings component"
version: 5.0.0

publish_to: "none"
version: 5.1.0
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub/

environment:
sdk: ">=3.2.6 <4.0.0"
Expand All @@ -16,13 +16,12 @@ dependencies:
shared_preferences: ^2.0.7
intl: ^0.18.1
flutter_profile:
git:
url: https://github.com/Iconica-Development/flutter_profile
ref: 1.5.0
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub/
version: ^1.6.0
flutter_input_library:
git:
url: https://github.com/Iconica-Development/flutter_input_library
ref: 3.3.1
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
version: ^3.6.0
url_launcher: ^6.3.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit e73e32e

Please sign in to comment.