2021/2/28 : Flutter : Slider、RangeSlider、CupertinoSlider(Flutter 今週のウィジェット)について

 

//Slider,とりあえず動くサンプル
import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(home:MyApp(),),);

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  double rating=40.0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body:Center(
        child:Column(
          mainAxisAlignment:MainAxisAlignment.center,
          children: [
            Text("${rating.round()}",style:TextStyle(fontSize:40.0,),),
            //↓Slider.adaptiveコンストラクタにするとiOSデバイス時に