// Copyright 2014 The Flutter Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import'package:flutter/material.dart';import'package:flutter_api_samples/material/slider/slider.2.dart'asexample;import'package:flutter_test/flutter_test.dart';voidmain(){testWidgets('Slider shows secondary track',(WidgetTestertester)async{awaittester.pumpWidget(constexample.SliderApp(),);expect(find.byType(Slider),findsNWidgets(2));finalFinderslider1Finder=find.byType(Slider).at(0);finalFinderslider2Finder=find.byType(Slider).at(1);Sliderslider1=tester.widget(slider1Finder);Sliderslider2=tester.widget(slider2Finder);expect(slider1.secondaryTrackValue,slider2.value);constdoubletargetValue=0.8;finalRectrect=tester.getRect(slider2Finder);finalOffsettarget=Offset(rect.left+(rect.right-rect.left)*targetValue,rect.top+(rect.bottom-rect.top)/2);awaittester.tapAt(target);awaittester.pump();slider1=tester.widget(slider1Finder);slider2=tester.widget(slider2Finder);expect(slider1.secondaryTrackValue,closeTo(targetValue,0.05));expect(slider1.secondaryTrackValue,slider2.value);});}