Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility to have different styles for title in main widget and dialog #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.13"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -56,7 +56,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -73,28 +73,28 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.8"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0"
multiselect_formfield:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.1.4"
name: multiselect_formfield
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.6"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -106,55 +106,55 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.5"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.17"
version: "0.3.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
dart: ">=2.12.0 <3.0.0"
3 changes: 1 addition & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2

multiselect_formfield:
path: ../
multiselect_formfield: ^0.1.6

dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main() {
expect(find.text('1'), findsNothing);

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

// Verify that our counter has incremented.
Expand Down
6 changes: 4 additions & 2 deletions lib/multiselect_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ class MultiSelectDialogItem<V> {
class MultiSelectDialog<V> extends StatefulWidget {
final List<MultiSelectDialogItem<V>> items;
final List<V> initialSelectedValues;
final Widget title;
final Text title;
final String okButtonLabel;
final String cancelButtonLabel;
final TextStyle labelStyle;
final TextStyle dialogHeadderStyle;
final ShapeBorder dialogShapeBorder;
final Color checkBoxCheckColor;
final Color checkBoxActiveColor;
Expand All @@ -26,6 +27,7 @@ class MultiSelectDialog<V> extends StatefulWidget {
this.okButtonLabel,
this.cancelButtonLabel,
this.labelStyle = const TextStyle(),
this.dialogHeadderStyle = const TextStyle(),
this.dialogShapeBorder,
this.checkBoxActiveColor,
this.checkBoxCheckColor})
Expand Down Expand Up @@ -66,7 +68,7 @@ class _MultiSelectDialogState<V> extends State<MultiSelectDialog<V>> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: widget.title,
title: Text(widget.title.data, style: widget.dialogHeadderStyle),
shape: widget.dialogShapeBorder,
contentPadding: EdgeInsets.only(top: 12.0),
content: SingleChildScrollView(
Expand Down
7 changes: 5 additions & 2 deletions lib/multiselect_formfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:multiselect_formfield/multiselect_dialog.dart';

class MultiSelectFormField extends FormField<dynamic> {
final Widget title;
final Text title;
final Widget hintWidget;
final bool required;
final String errorText;
Expand All @@ -22,6 +22,7 @@ class MultiSelectFormField extends FormField<dynamic> {
final InputBorder border;
final TextStyle chipLabelStyle;
final Color chipBackGroundColor;
final TextStyle dialogHeadderStyle;
final TextStyle dialogTextStyle;
final ShapeBorder dialogShapeBorder;
final Color checkBoxCheckColor;
Expand Down Expand Up @@ -50,6 +51,7 @@ class MultiSelectFormField extends FormField<dynamic> {
this.trailing,
this.chipLabelStyle,
this.chipBackGroundColor,
this.dialogHeadderStyle = const TextStyle(),
this.dialogTextStyle = const TextStyle(),
this.dialogShapeBorder = const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(0.0)),
Expand Down Expand Up @@ -107,6 +109,7 @@ class MultiSelectFormField extends FormField<dynamic> {
cancelButtonLabel: cancelButtonLabel,
items: items,
initialSelectedValues: initialSelected,
dialogHeadderStyle: dialogHeadderStyle,
labelStyle: dialogTextStyle,
dialogShapeBorder: dialogShapeBorder,
checkBoxActiveColor: checkBoxActiveColor,
Expand Down Expand Up @@ -153,7 +156,7 @@ class MultiSelectFormField extends FormField<dynamic> {
)
: Container(),
Icon(
Icons.arrow_drop_down,
Icons.arrow_drop_down_outlined,
color: Colors.black87,
size: 25.0,
),
Expand Down
38 changes: 19 additions & 19 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,49 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
version: "2.5.0-nullsafety.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0-nullsafety.3"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
version: "1.2.0-nullsafety.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.1.0-nullsafety.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.13"
version: "1.15.0-nullsafety.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0-nullsafety.1"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -66,21 +66,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.8"
version: "0.12.10-nullsafety.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0-nullsafety.3"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0-nullsafety.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -92,55 +92,55 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0-nullsafety.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.5"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0-nullsafety.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0-nullsafety.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.17"
version: "0.2.19-nullsafety.2"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0-nullsafety.3"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0-nullsafety.3"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
dart: ">=2.10.0-110 <2.11.0"
Loading