mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-08-06 17:48:43 +08:00
update: 规范
This commit is contained in:
@ -7,21 +7,26 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class SliderDemo extends StatefulWidget {
|
||||
_Demo createState() => _Demo();
|
||||
}
|
||||
|
||||
class _Demo extends State<SliderDemo> {
|
||||
double value = 0.0;
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return Slider(
|
||||
value: value,//实际进度的位置
|
||||
inactiveColor: Colors.black12,//进度中不活动部分的颜色
|
||||
value: value,
|
||||
//实际进度的位置
|
||||
inactiveColor: Colors.black12,
|
||||
//进度中不活动部分的颜色
|
||||
label: 'value: $value',
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
divisions: 1000,
|
||||
activeColor: Colors.blue,//进度中活动部分的颜色
|
||||
activeColor: Colors.blue,
|
||||
//进度中活动部分的颜色
|
||||
onChanged: (double) {
|
||||
setState(() {
|
||||
value = double.roundToDouble();
|
||||
@ -29,31 +34,35 @@ class _Demo extends State<SliderDemo> {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class SliderThemeDemo extends StatefulWidget {
|
||||
_SliderThemeDemo createState() => _SliderThemeDemo();
|
||||
}
|
||||
|
||||
class _SliderThemeDemo extends State<SliderThemeDemo> {
|
||||
double value = 0.0;
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: SliderTheme(
|
||||
data: SliderTheme.of(context).copyWith(
|
||||
// activeTickMarkColor:Colors.yellowAccent,
|
||||
activeTrackColor: Colors.yellowAccent,//实际进度的颜色
|
||||
activeTrackColor: Colors.yellowAccent,
|
||||
//实际进度的颜色
|
||||
// inactiveTickMarkColor:Colors.black
|
||||
thumbColor: Colors.black,//滑块中心的颜色
|
||||
inactiveTrackColor:Colors.red,//默 认进度条的颜色
|
||||
valueIndicatorColor: Colors.blue,//提示进度的气派的背景色
|
||||
valueIndicatorTextStyle: TextStyle(//提示气泡里面文字的样式
|
||||
thumbColor: Colors.black,
|
||||
//滑块中心的颜色
|
||||
inactiveTrackColor: Colors.red,
|
||||
//默 认进度条的颜色
|
||||
valueIndicatorColor: Colors.blue,
|
||||
//提示进度的气派的背景色
|
||||
valueIndicatorTextStyle: TextStyle(
|
||||
//提示气泡里面文字的样式
|
||||
color: Colors.white,
|
||||
),
|
||||
inactiveTickMarkColor:Colors.blue,//divisions对进度线分割后 断续线中间间隔的颜色
|
||||
inactiveTickMarkColor: Colors.blue,
|
||||
//divisions对进度线分割后 断续线中间间隔的颜色
|
||||
overlayColor: Colors.pink, //滑块边缘颜色
|
||||
),
|
||||
child: Container(
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_go/components/widget_demo.dart';
|
||||
|
||||
import 'demo.dart';
|
||||
|
||||
const contentA = '''
|
||||
@ -23,22 +24,18 @@ const contentA = '''
|
||||
|
||||
''';
|
||||
|
||||
|
||||
class Demo extends StatefulWidget {
|
||||
static const String routeName = 'elements/Form/Switch/AnimatedSwitcher';
|
||||
|
||||
_Demo createState() => _Demo();
|
||||
}
|
||||
|
||||
class _Demo extends State<Demo> {
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return WidgetDemo(
|
||||
title: 'SwitchListTile',
|
||||
codeUrl: 'elements/Form/Switch/AnimatedSwitcher/demo.dart',
|
||||
contentList: [
|
||||
contentA,
|
||||
AnimatedSwitcherDemo()
|
||||
],
|
||||
contentList: [contentA, AnimatedSwitcherDemo()],
|
||||
docUrl: '',
|
||||
);
|
||||
}
|
||||
|
@ -7,8 +7,6 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
class SwitchDemo extends StatefulWidget {
|
||||
_Demo createState() => _Demo();
|
||||
}
|
||||
|
@ -3,11 +3,13 @@
|
||||
/// Date: 20/01/2019
|
||||
/// Time: 22:28
|
||||
/// email: sanfan.hx@alibaba-inc.com
|
||||
/// target: CupertinoTabBar
|
||||
/// target: CupertionTabBar
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
class CupertinoTimerPickerDemo extends StatefulWidget {
|
||||
_Demo createState() => _Demo();
|
||||
}
|
||||
@ -37,6 +39,7 @@ class _Demo extends State<CupertinoTimerPickerDemo> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_go/components/widget_demo.dart';
|
||||
|
||||
import 'demo.dart';
|
||||
@ -27,7 +26,6 @@ const Text0 = '''
|
||||
|
||||
''';
|
||||
|
||||
|
||||
class Demo extends StatefulWidget {
|
||||
static const String routeName =
|
||||
'/element/themes/Cupertino/CupertinoTimerPicker';
|
||||
@ -42,11 +40,9 @@ class _DemoState extends State<Demo> {
|
||||
return WidgetDemo(
|
||||
title: 'CupertinoTimerPicker',
|
||||
codeUrl: 'themes/Cupertino/CupertinoTimerPicker/demo.dart',
|
||||
docUrl: 'https://docs.flutter.io/flutter/cupertino/CupertinoTimerPicker-class.html',
|
||||
contentList: [
|
||||
Text0,
|
||||
CupertinoTimerPickerDemo()
|
||||
],
|
||||
docUrl:
|
||||
'https://docs.flutter.io/flutter/cupertino/CupertinoTimerPicker-class.html',
|
||||
contentList: [Text0, CupertinoTimerPickerDemo()],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user