iT邦幫忙

2023 iThome 鐵人賽

DAY 10
0
自我挑戰組

基礎學習Flutter系列 第 10

Day10-學習[Building for iOS with Flutter]得出小部件

  • 分享至 

  • xImage
  •  

https://ithelp.ithome.com.tw/upload/images/20230925/20130175pUho2O9Rck.jpg

class HomePage extends StatelessWidget {
  const HomePage ();

@override
Widget build(BuildContext context) {
  return CupertinoPageScaffold(
    child: Center( 
      child: SizedBox( 
        width: 300,
        child: Cupertinoslider(
          min: 0,
          max: 100,
          value: 50,
          onChanged: (newvalue) {},
        ).// Cupertinoslider
       ). // SizedBox
    ).// Center
   );// CupertinoPageScaffold
  }
 }

https://ithelp.ithome.com.tw/upload/images/20230925/20130175vfhEpIOj8j.jpg

@override
Widget build(BuildContext context) {
  return CupertinoPageScaffold(
    child: Center(
      child: SizedBox(
        height: 300,
        child: CupertinoPicker(
          itemExtent: _KPickerItemHeight,
          backgroundcolors Cupertinocolors.white,
          onSelectedItemChanged: (int index) {}, 
          children:List<Widget>.generate(coolColorNames.length,(int index){
            return Center
              child: Text (coolColorNames [index]) ,
            );
          }),
       ), // Cupertinoslider
      ),// SizedBox
     ), // Center
   ); // CupertinoPageScaffold
  }
}


const List<String> coolColorNames = <String>[
  'Sarcoline', 'Coquelicot', 'Smaragdine', 'Mikado', 'Glaucous', 'Wenge',
  'Fulvous', 'Xanadu', 'Falu', 'Eburnean', 'Amaranth', 'Australien',
  'Banan', 'Falu', 'Gingerline', 'Incarnadine','Labrador', 'Nattier',
  'Pervenche', 'Sinoper', 'Verditer', 'Watchet',"Zaffre',
];

Date
https://ithelp.ithome.com.tw/upload/images/20230925/2013017544tfsUd85Z.jpg

@override
Widget build(BuildContext context) {
  return CupertinoPageScaffold(
    child: Center(
    child: SizedBox(
      height: 300,
      child: CupertinoDatePicker(
        mode: CupertinoDatePickerMode.date,
        onDateTimeChanged: (newValue) {},
      ),//cupertinodatePicker
     ),//SizedBox
    ),//Center
   );// CupertinoPageScaffold
  }
 } 

上一篇
Day9-學習[Building for iOS with Flutter]得出目標應用程式
下一篇
Day11-學習[Building for iOS with Flutter]得出小部件
系列文
基礎學習Flutter30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言