欧美free性护士vide0shd,老熟女,一区二区三区,久久久久夜夜夜精品国产,久久久久久综合网天天,欧美成人护士h版

目錄

在Flutter中,如何實現(xiàn)TabBarIndicator? flutter attach

在Flutter中,要實現(xiàn)TabBarIndicator,可以使用CustomTabIndicator組件。以下是一個簡單的示例:

  1. pubspec.yaml文件中添加依賴:
dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  1. 然后,在main.dart文件中導(dǎo)入并使用CustomTabIndicator組件:
import 'package:flutter/material.dart';
import 'package:flutter_cupertino_icons/flutter_cupertino_icons.dart';
import 'package:flutter_tabbarindicator/flutter_tabbarindicator.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Tab Bar Indicator')),
        body: CustomTabBar(),
      ),
    );
  }
}
  1. 最后,創(chuàng)建一個自定義的CustomTabBar組件來顯示CustomTabIndicator
class CustomTabBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Row(
          children: [
            Icon(CupertinoIcons.home),
            SizedBox(width: 10),
            CupertinoTextField(
              controller: null,
              keyboardType: TextInputType.number,
              keyboardActions: <KeyboardAction>[
                KeyboardActions.done,
              ],
            ),
          ],
        ),
        Row(
          children: [
            Icon(CupertinoIcons.person),
            SizedBox(width: 10),
            CupertinoTextField(
              controller: null,
              keyboardType: TextInputType.text,
              keyboardActions: <KeyboardAction>[
                KeyboardActions.done,
              ],
            ),
          ],
        ),
        Row(
          children: [
            Icon(CupertinoIcons.mail),
            SizedBox(width: 10),
            CupertinoTextField(
              controller: null,
              keyboardType: TextInputType.emailAddress,
              keyboardActions: <KeyboardAction>[
                KeyboardActions.done,
              ],
            ),
          ],
        ),
        Row(
          children: [
            Icon(CupertinoIcons.settings),
            SizedBox(width: 10),
            CupertinoButton(
              child: Text('Settings'),
              onPressed: () {},
            ),
          ],
        ),
      ],
    );
  }
}

這個示例中,我們創(chuàng)建了一個包含三個按鈕的CustomTabBar組件。每個按鈕都顯示一個圖標(biāo)和一個文本輸入框。點擊圖標(biāo)時,文本輸入框?qū)@得焦點。

本文內(nèi)容根據(jù)網(wǎng)絡(luò)資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點和立場。

轉(zhuǎn)載請注明,如有侵權(quán),聯(lián)系刪除。

本文鏈接:http://gantiao.com.cn/post/2027494909.html

發(fā)布評論

您暫未設(shè)置收款碼

請在主題配置——文章設(shè)置里上傳

掃描二維碼手機訪問

文章目錄