@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
22import 'package:splitio/splitio.dart' ;
33
44/// Replace these with valid values
5- const String _apiKey = 'api -key' ;
5+ const String _sdkKey = 'sdk -key' ;
66const String _matchingKey = 'user-id' ;
77
88void main () {
@@ -21,12 +21,12 @@ class SplitioExampleApp extends StatefulWidget {
2121}
2222
2323class _SplitioExampleAppState extends State <SplitioExampleApp > {
24- String _splitName = '' ;
24+ String _featureFlagName = '' ;
2525 bool _sdkReady = false ;
2626 bool _sdkReadyFromCache = false ;
2727 late SplitClient _client;
2828
29- final Splitio _split = Splitio (_apiKey , _matchingKey,
29+ final Splitio _split = Splitio (_sdkKey , _matchingKey,
3030 configuration: SplitConfiguration (
3131 trafficType: "user" ,
3232 ));
@@ -87,20 +87,20 @@ class _SplitioExampleAppState extends State<SplitioExampleApp> {
8787 Padding (
8888 padding: const EdgeInsets .fromLTRB (32 , 8 , 32 , 8 ),
8989 child: TextField (
90- decoration:
91- const InputDecoration ( hintText: 'Enter split name' ),
90+ decoration: const InputDecoration (
91+ hintText: 'Enter feature flag name' ),
9292 onChanged: (text) {
9393 setState (() {
94- _splitName = text;
94+ _featureFlagName = text;
9595 });
9696 },
9797 ),
9898 ),
9999 Visibility (
100- visible: _splitName != '' ,
100+ visible: _featureFlagName != '' ,
101101 child: ElevatedButton (
102102 onPressed: performEvaluation,
103- child: Text ('Evaluate: $_splitName ' )),
103+ child: Text ('Evaluate: $_featureFlagName ' )),
104104 ),
105105 Visibility (
106106 visible: _sdkReady || _sdkReadyFromCache,
@@ -131,9 +131,8 @@ class _SplitioExampleAppState extends State<SplitioExampleApp> {
131131 }
132132
133133 void performEvaluation () async {
134- _client
135- .getTreatment (_splitName)
136- .then ((value) => {print ('Evaluation value for $_splitName is $value ' )});
134+ _client.getTreatment (_featureFlagName).then (
135+ (value) => {print ('Evaluation value for $_featureFlagName is $value ' )});
137136 }
138137
139138 void track () {
0 commit comments