我正在尝试制作一个动画旧式里程表计数器,并找到了一个运行良好的封装里程表,但问题是它只接受并在 UI 中显示int 值,我需要显示双精度值,有没有人知道这个是可能的还是我应该自己做一个?
PS:我拥有的代码是包示例页面中的代码。
我想要的是:
我有的:
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text('NiiTii'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>\[
Container(padding: EdgeInsets.all(10),
child: AnimatedSlideOdometerNumber(
letterWidth: 20,
odometerNumber: OdometerNumber(_counter),
duration: const Duration(seconds: 1),
numberTextStyle: TextStyle(fontSize: 20,color: Colors.white,fontWeight: FontWeight.bold),
),
decoration: BoxDecoration(
border: Border.all(color: Colors.deepPurple,width: 15.0),
color: Colors.red
),
),
Padding(
padding: EdgeInsets.only(top: 30),
child: SlideOdometerTransition(
letterWidth: 20,
numberTextStyle: TextStyle(fontSize: 20),
),
),
],
),
)
);