Flutter - 根据先前在步进器上的选择填充步骤内容

标签 flutter dart

我正在尝试根据选择加载步骤的内容。例如,如果用户选择选项 B,则在下一步加载一组不同的选项。到目前为止,这是我所拥有的,但内容并未动态加载:目标是如果选择“新车”,则应加载一组不同的选项。

class HomePage extends StatefulWidget {

  @override
  _HomePageState createState() => _HomePageState();
}



class _HomePageState extends State<HomePage> {
  int _currentStep = 0;



  List<RadioModel> step0 = [
    RadioModel(false, "New", Icons.directions_car),
    RadioModel(false, "Used", Icons.directions_car),
  ];



  List<RadioModel> step1 = [
    RadioModel(false, "Honda", Icons.local_shipping),
    RadioModel(false, "Toyota", Icons.title)
  ];

  List<RadioModel> step3 = [
    RadioModel(false, "Red", Icons.radio_button_checked),
    RadioModel(false, "Orage", Icons.radio_button_checked)
  ];





  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        iconTheme: IconThemeData(color: Colors.grey),
        backgroundColor: Colors.white,
        elevation: 2,
        title: Text("Buy Car".toUpperCase(),
            style: TextStyle(
              color: Colors.grey[700],
              fontSize: 17,
            )),
//        leading: IconButton(
//            icon: Icon(Icons.close, size: 28),
//              onPressed: () {
//              Navigator.of(context).pop();
//
//            }),
      ),
      body: Theme(
        data: ThemeData(primaryColor: Colors.indigoAccent),
        child:
        Stepper(
          type: StepperType.vertical,
          currentStep: _currentStep,
          onStepTapped: (int step) => setState(() => _currentStep = step),
          onStepContinue:
          _currentStep < 2 ? () => setState(() => _currentStep += 1) : null,
          onStepCancel:
          _currentStep > 0 ? () => setState(() => _currentStep -= 1) : null,
          controlsBuilder: (BuildContext context,
              {VoidCallback onStepContinue, VoidCallback onStepCancel}) =>
              Container(
                height: 70,
                child: Row(
                  mainAxisSize: MainAxisSize.max,
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: <Widget>[
                    _currentStep == 0
                        ? Text("")
                        : RaisedButton(
                      onPressed: onStepCancel,
                      textColor: Colors.grey,
                      textTheme: ButtonTextTheme.normal,
                      child: Row(children: <Widget>[
                        const Icon(Icons.chevron_left),
                        Text("PREV")
                      ]),
                    ),
                    RaisedButton(
                      onPressed: onStepContinue,
                      textColor: Colors.white,
                      color: Colors.indigoAccent,
                      textTheme: ButtonTextTheme.normal,
                      child: Row(children: <Widget>[
                        _currentStep >= 2
                            ? Icon(Icons.done)
                            : Icon(Icons.chevron_right),
                        _currentStep >= 2 ? Text("DONE") : Text("NEXT")
                      ]),
                    ),
                  ],
                ),
              ),
          steps: <Step>[
            Step(
              title: Text(
                "Car",
                style: TextStyle(
                  fontSize: 15,
                  color: Colors.grey[600],
                ),
              ),
              content: Column(
                children: <Widget>[
                  Row(
                    children: <Widget>[
                      Padding(
                        padding: const EdgeInsets.only(left:8.0,bottom:10),
                        child: Text(
                          "What type of car?:",
                          style: TextStyle(
                            fontSize: 17,
                            color: Colors.black,
                          ),
                        ),
                      ),
                    ],
                  ),
                  SelectableCard(options: step0),
                ],
              ),
              isActive: _currentStep >= 0,
              state:
              _currentStep >= 0 ? StepState.complete : StepState.disabled,
            ),
            Step(
              title: Text(
                "Brand",
                style: TextStyle(
                  fontSize: 15,
                  color: Colors.grey[600],
                ),
              ),
              content: Column(
                children: <Widget>[
                  Row(
                    children: <Widget>[
                      Padding(
                        padding: const EdgeInsets.only(left:8.0,bottom:10),
                        child: Text(
                          "Made Company?",
                          style: TextStyle(
                            fontSize: 17,
                            color: Colors.black,
                          ),
                        ),
                      ),
                    ],
                  ),
                  SelectableCard(options: step1),
                ],
              ),
              isActive: _currentStep >= 1,
              state:
              _currentStep >= 1 ? StepState.complete : StepState.disabled,
            ),

            Step(
              title: Text(
                "Color",
                style: TextStyle(
                  fontSize: 15,
                  color: Colors.grey[600],
                ),
              ),
              content: SelectableCard(options: step3),
              isActive: _currentStep >= 2,
              state:
              _currentStep >= 3 ? StepState.complete : StepState.disabled,
            ),
          ],
        ),
      ),
    );
  }

  Widget _commentary(){

    return TextFormField(
      keyboardType: TextInputType.multiline,
      maxLines: 3,
      decoration: InputDecoration(
        labelText: 'i.e - Concurrent Area',
      ),
    );

  }
}

class SelectableInLineCard extends StatefulWidget {

  final List<RadioModel> options;

  SelectableInLineCard({@required this.options});

  @override
  _SelectableInLineCardState createState() => _SelectableInLineCardState();
}

class _SelectableInLineCardState extends State<SelectableInLineCard> {

  List<RadioModel> sampleData = new List<RadioModel>();

  void initState() {
    // TODO: implement initState
    super.initState();
    sampleData = widget.options;


  }

  @override
  Widget build(BuildContext context) {
    return GridView.builder(
      shrinkWrap: true,
      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
        crossAxisCount: 1,
        childAspectRatio: MediaQuery.of(context).size.width /
            (MediaQuery.of(context).size.height / 12),
      ),
      itemCount: sampleData.length,
      itemBuilder: (context, index) {
        return Card(
          shape: sampleData[index].isSelected
              ? RoundedRectangleBorder(
              side: BorderSide(color: Colors.indigoAccent, width: 2.0),
              borderRadius: BorderRadius.circular(4.0))
              : RoundedRectangleBorder(
              side: BorderSide(color: Colors.grey[200], width: 2.0),
              borderRadius: BorderRadius.circular(4.0)),
          color: Colors.white,
          elevation: 0,
          child: InkWell(
            splashColor: Colors.transparent,
            highlightColor: Colors.transparent,
            onTap: () {
              setState(() {
                sampleData.forEach((element) => element.isSelected = false);
                sampleData[index].isSelected = true;
                //print(sampleData[index].time);
              });
            },
            child: GridTile(
              child: FlatButton(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    Row(
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: <Widget>[
                        Text(
                          sampleData[index].time,
                          style: TextStyle(
                            fontSize: 15,
                            color: sampleData[index].isSelected ? Colors.indigoAccent : Colors.grey[500],
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ),
          ),
        );
      },
    );
  }
}


class SelectableCard extends StatefulWidget {
  final List<RadioModel> options;

  SelectableCard({@required this.options});

  @override
  _SelectableCardState createState() => _SelectableCardState();
}

class _SelectableCardState extends State<SelectableCard> {
  List<RadioModel> sampleData = new List<RadioModel>();
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    sampleData = widget.options;
  }
  @override
  Widget build(BuildContext context) {
    return GridView.builder(
      shrinkWrap: true,
      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
        crossAxisCount: 2,
        childAspectRatio: MediaQuery.of(context).size.width /
            (MediaQuery.of(context).size.height / 2.5),
      ),
      itemCount: sampleData.length,
      itemBuilder: (context, index) {
        return Card(
          shape: sampleData[index].isSelected
              ? RoundedRectangleBorder(
              side: BorderSide(color: Colors.indigoAccent, width: 2.0),
              borderRadius: BorderRadius.circular(4.0))
              : RoundedRectangleBorder(
              side: BorderSide(color: Colors.grey[200], width: 2.0),
              borderRadius: BorderRadius.circular(4.0)),
          color: Colors.white,
          elevation: 0,
          child: InkWell(
            splashColor: Colors.transparent,
            highlightColor: Colors.transparent,
            onTap: () {
              setState(() {
                sampleData.forEach((element) => element.isSelected = false);
                sampleData[index].isSelected = true;
              });
            },
            child: GridTile(child: RadioItem(sampleData[index])),
          ),
        );
      },
    );
  }
}

class RadioItem extends StatelessWidget {
  final RadioModel _item;
  RadioItem(this._item);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: FlatButton(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Icon(_item.icon, color:_item.isSelected ? Colors.indigoAccent : Colors.grey[500], size: 35,),
            Text(
              _item.time,
              style: TextStyle(
                fontSize: 15,
                color: _item.isSelected ? Colors.indigoAccent : Colors.grey[500],
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class RadioModel {
  bool isSelected;
  String time;
  IconData icon;
  RadioModel(this.isSelected, this.time, this.icon);
}

这是该应用目前的样子。

enter image description here

最佳答案

编辑
您可以使用 Map前往 map intList<RadioModel>
使用 Map<int, List<RadioModel>>控制step1'多选
并用 step1Index[answer[0]] 重新运行
代码片段

Map<int, List<RadioModel>> step1Index = {
    0: [
      RadioModel(false, "Honda", Icons.local_shipping),
      RadioModel(false, "Toyota", Icons.title)
    ],
    1: [
      RadioModel(false, "abc", Icons.local_shipping),
      RadioModel(false, "def", Icons.title)
    ],
  };

List<RadioModel> choiceNextStep() {
  return step1Index[answer[0]];
}

您可以在下面复制粘贴运行完整代码
完整的工作演示请参见下面
第 1 步:使用 List<int> answer = [null, null, null];留步选择
第 2 步:使用 StatefulBuilder刷新步骤

StatefulBuilder(
            builder: (BuildContext context, StateSetter setState) {
          return Stepper(

第三步:SelectableCard按条件传参

SelectableCard(options: answer[0] == 0 ? step1 : step1_1, step: 1)

第 4 步:SelectableCardState移动 sampleData = widget.options;来自 initState()build

工作演示

enter image description here

完整代码

    import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: HomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

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

List<int> answer = [0, 0, 0];

class _HomePageState extends State<HomePage> {
  int _currentStep = 0;

  List<RadioModel> step0 = [
    RadioModel(false, "New", Icons.directions_car),
    RadioModel(false, "Used", Icons.directions_car),
  ];

  Map<int, List<RadioModel>> step1Index = {
    0: [
      RadioModel(false, "Honda", Icons.local_shipping),
      RadioModel(false, "Toyota", Icons.title)
    ],
    1: [
      RadioModel(false, "abc", Icons.local_shipping),
      RadioModel(false, "def", Icons.title)
    ],
  };

  //step1Index

  List<RadioModel> step1 = [
    RadioModel(false, "Honda", Icons.local_shipping),
    RadioModel(false, "Toyota", Icons.title)
  ];

  List<RadioModel> step1_1 = [
    RadioModel(false, "abc", Icons.local_shipping),
    RadioModel(false, "def", Icons.title)
  ];

  List<RadioModel> step3 = [
    RadioModel(false, "Red", Icons.radio_button_checked),
    RadioModel(false, "Orage", Icons.radio_button_checked)
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        iconTheme: IconThemeData(color: Colors.grey),
        backgroundColor: Colors.white,
        elevation: 2,
        title: Text("Buy Car".toUpperCase(),
            style: TextStyle(
              color: Colors.grey[700],
              fontSize: 17,
            )),
//        leading: IconButton(
//            icon: Icon(Icons.close, size: 28),
//              onPressed: () {
//              Navigator.of(context).pop();
//
//            }),
      ),
      body: Theme(
        data: ThemeData(primaryColor: Colors.indigoAccent),
        child: StatefulBuilder(
            builder: (BuildContext context, StateSetter setState) {
          return Stepper(
            type: StepperType.vertical,
            currentStep: _currentStep,
            onStepTapped: (int step) => setState(() => _currentStep = step),
            onStepContinue: _currentStep < 2
                ? () => setState(() => _currentStep += 1)
                : null,
            onStepCancel: _currentStep > 0
                ? () => setState(() => _currentStep -= 1)
                : null,
            controlsBuilder: (BuildContext context,
                    {VoidCallback onStepContinue, VoidCallback onStepCancel}) =>
                Container(
              height: 70,
              child: Row(
                mainAxisSize: MainAxisSize.max,
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  _currentStep == 0
                      ? Text("")
                      : RaisedButton(
                          onPressed: onStepCancel,
                          textColor: Colors.grey,
                          textTheme: ButtonTextTheme.normal,
                          child: Row(children: <Widget>[
                            const Icon(Icons.chevron_left),
                            Text("PREV")
                          ]),
                        ),
                  RaisedButton(
                    onPressed: onStepContinue,
                    textColor: Colors.white,
                    color: Colors.indigoAccent,
                    textTheme: ButtonTextTheme.normal,
                    child: Row(children: <Widget>[
                      _currentStep >= 2
                          ? Icon(Icons.done)
                          : Icon(Icons.chevron_right),
                      _currentStep >= 2 ? Text("DONE") : Text("NEXT")
                    ]),
                  ),
                ],
              ),
            ),
            steps: <Step>[
              Step(
                title: Text(
                  "Car",
                  style: TextStyle(
                    fontSize: 15,
                    color: Colors.grey[600],
                  ),
                ),
                content: Column(
                  children: <Widget>[
                    Row(
                      children: <Widget>[
                        Padding(
                          padding: const EdgeInsets.only(left: 8.0, bottom: 10),
                          child: Text(
                            "What type of car?:",
                            style: TextStyle(
                              fontSize: 17,
                              color: Colors.black,
                            ),
                          ),
                        ),
                      ],
                    ),
                    SelectableCard(options: step0, step: 0),
                  ],
                ),
                isActive: _currentStep >= 0,
                state:
                    _currentStep >= 0 ? StepState.complete : StepState.disabled,
              ),
              Step(
                title: Text(
                  "Brand",
                  style: TextStyle(
                    fontSize: 15,
                    color: Colors.grey[600],
                  ),
                ),
                content: Column(
                  children: <Widget>[
                    Row(
                      children: <Widget>[
                        Padding(
                          padding: const EdgeInsets.only(left: 8.0, bottom: 10),
                          child: Text(
                            "Made Company?",
                            style: TextStyle(
                              fontSize: 17,
                              color: Colors.black,
                            ),
                          ),
                        ),
                      ],
                    ),
                    SelectableCard(options: choiceNextStep(), step: 1)
                  ],
                ),
                isActive: _currentStep >= 1,
                state:
                    _currentStep >= 1 ? StepState.complete : StepState.disabled,
              ),
              Step(
                title: Text(
                  "Color",
                  style: TextStyle(
                    fontSize: 15,
                    color: Colors.grey[600],
                  ),
                ),
                content: SelectableCard(options: step3, step: 2),
                isActive: _currentStep >= 2,
                state:
                    _currentStep >= 3 ? StepState.complete : StepState.disabled,
              ),
            ],
          );
        }),
      ),
    );
  }

  List<RadioModel> choiceNextStep() {

    return step1Index[answer[0]];

    /*if (answer[0] == 0) {
      return step1;
    } else {
      return step1_1;
    }*/
  }

  Widget _commentary() {
    return TextFormField(
      keyboardType: TextInputType.multiline,
      maxLines: 3,
      decoration: InputDecoration(
        labelText: 'i.e - Concurrent Area',
      ),
    );
  }
}

class SelectableInLineCard extends StatefulWidget {
  final List<RadioModel> options;

  SelectableInLineCard({@required this.options});

  @override
  _SelectableInLineCardState createState() => _SelectableInLineCardState();
}

class _SelectableInLineCardState extends State<SelectableInLineCard> {
  List<RadioModel> sampleData = new List<RadioModel>();

  void initState() {
    // TODO: implement initState
    super.initState();
    sampleData = widget.options;
  }

  @override
  Widget build(BuildContext context) {
    return GridView.builder(
      shrinkWrap: true,
      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
        crossAxisCount: 1,
        childAspectRatio: MediaQuery.of(context).size.width /
            (MediaQuery.of(context).size.height / 12),
      ),
      itemCount: sampleData.length,
      itemBuilder: (context, index) {
        return Card(
          shape: sampleData[index].isSelected
              ? RoundedRectangleBorder(
                  side: BorderSide(color: Colors.indigoAccent, width: 2.0),
                  borderRadius: BorderRadius.circular(4.0))
              : RoundedRectangleBorder(
                  side: BorderSide(color: Colors.grey[200], width: 2.0),
                  borderRadius: BorderRadius.circular(4.0)),
          color: Colors.white,
          elevation: 0,
          child: InkWell(
            splashColor: Colors.transparent,
            highlightColor: Colors.transparent,
            onTap: () {
              setState(() {
                sampleData.forEach((element) => element.isSelected = false);
                sampleData[index].isSelected = true;

                //print(sampleData[index].time);
              });
            },
            child: GridTile(
              child: FlatButton(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    Row(
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: <Widget>[
                        Text(
                          sampleData[index].time,
                          style: TextStyle(
                            fontSize: 15,
                            color: sampleData[index].isSelected
                                ? Colors.indigoAccent
                                : Colors.grey[500],
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ),
          ),
        );
      },
    );
  }
}

class SelectableCard extends StatefulWidget {
  final List<RadioModel> options;
  final int step;
  SelectableCard({@required this.options, @required this.step});

  @override
  _SelectableCardState createState() => _SelectableCardState();
}

class _SelectableCardState extends State<SelectableCard> {
  List<RadioModel> sampleData = new List<RadioModel>();
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    //sampleData = widget.options;
    //print(sampleData.toString());
  }

  @override
  Widget build(BuildContext context) {
    sampleData = widget.options;
    print(sampleData.toString());
    return GridView.builder(
      shrinkWrap: true,
      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
        crossAxisCount: 2,
        childAspectRatio: MediaQuery.of(context).size.width /
            (MediaQuery.of(context).size.height / 2.5),
      ),
      itemCount: sampleData.length,
      itemBuilder: (context, index) {
        return Card(
          shape: sampleData[index].isSelected
              ? RoundedRectangleBorder(
                  side: BorderSide(color: Colors.indigoAccent, width: 2.0),
                  borderRadius: BorderRadius.circular(4.0))
              : RoundedRectangleBorder(
                  side: BorderSide(color: Colors.grey[200], width: 2.0),
                  borderRadius: BorderRadius.circular(4.0)),
          color: Colors.white,
          elevation: 0,
          child: InkWell(
            splashColor: Colors.transparent,
            highlightColor: Colors.transparent,
            onTap: () {
              setState(() {
                sampleData.forEach((element) => element.isSelected = false);
                sampleData[index].isSelected = true;
                print('step ${widget.step}');
                print('index ${index}');
                answer[widget.step] = index;
                print(answer[widget.step]);
              });
            },
            child: GridTile(child: RadioItem(sampleData[index])),
          ),
        );
      },
    );
  }
}

class RadioItem extends StatelessWidget {
  final RadioModel _item;
  RadioItem(this._item);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: FlatButton(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Icon(
              _item.icon,
              color: _item.isSelected ? Colors.indigoAccent : Colors.grey[500],
              size: 35,
            ),
            Text(
              _item.time,
              style: TextStyle(
                fontSize: 15,
                color:
                    _item.isSelected ? Colors.indigoAccent : Colors.grey[500],
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class RadioModel {
  bool isSelected;
  String time;
  IconData icon;
  RadioModel(this.isSelected, this.time, this.icon);
}

关于Flutter - 根据先前在步进器上的选择填充步骤内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59130685/

相关文章:

dart - 如何在 flutter 中拆分 Dart 类?

asynchronous - net不在时如何处理socket异常?

flutter - 创建失败,Flutter 代码混淆

mysql - Flutter/Dart 只提取日期和时间?

flutter - 我们可以在flutter中使用蓝牙检查设备是否为智能手机吗?

Flutter json_serializable 5.0.0 不能与 auto_route 一起使用

flutter - 在创建带有 float 应用栏的应用时使用 StreamBuilder

android - Flutter 中的导航堆栈和启动模式是如何处理的?

dart - 如何在 IOWebSocketChannel 中设置用户代理?

api - 如何使用 Dio 在 Flutter 中调用 API?