Skip to content

Commit 8e0cea3

Browse files
committed
SegmentedControl take color of primary swatch
1 parent ddf30e0 commit 8e0cea3

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

.idea/workspace.xml

Lines changed: 20 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/main.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MyApp extends StatelessWidget {
99
return new MaterialApp(
1010
title: 'Flutter Demo',
1111
theme: new ThemeData(
12-
primarySwatch: Colors.blue,
12+
primarySwatch: Colors.green,
1313
),
1414
home: new MyHomePage(),
1515
);
@@ -70,6 +70,7 @@ class MyHomePage extends StatelessWidget {
7070
label: "My Languages",
7171
attribute: "languages",
7272
require: false,
73+
value: ["Dart"],
7374
options: [
7475
FormBuilderInputOption(label: "Dart", value: false),
7576
FormBuilderInputOption(label: "Kotlin", value: false),

lib/src/form_builder.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ class _FormBuilderState extends State<FormBuilder> {
311311
constraints:
312312
const BoxConstraints(minWidth: double.infinity),
313313
child: CupertinoSegmentedControl(
314+
borderColor: Theme.of(context).primaryColor,
315+
selectedColor: Theme.of(context).primaryColor,
316+
pressedColor: Theme.of(context).primaryColor,
314317
groupValue: field.value,
315318
children: Map.fromIterable(
316319
formControls[count].options,

0 commit comments

Comments
 (0)