首页 > 其他 > 详细

slider

时间:2019-06-04 21:15:59      阅读:89      评论:0      收藏:0      [点我收藏+]
import ‘package:flutter/material.dart‘;

void main()=>runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
);
}
}

class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
double reading=0.0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Slider(
value: reading,
min: 0.0,
max: 100.0,
inactiveColor: Colors.grey,
activeColor: Colors.orange,
label: ‘value:$reading‘,
divisions: 10,
onChanged: (data){setState(() {
reading = data;
});})
],
),
);
}
}

slider

原文:https://www.cnblogs.com/braveheart007/p/10976118.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!