Flutter - Анимированный виджет процесса - PullRequest
0 голосов
/ 31 января 2020

Я хочу создать виджет анимации процесса, подобный этому, во флаттере, который при просмотре страницы перемещается с 1 на 2.

enter image description here

Любые предложения приветствуются

1 Ответ

0 голосов
/ 03 февраля 2020

Этого можно достичь с помощью виджета флаттера Stepper, ниже приведена базовая c реализация Stepper Widget

Полный текст статьи по Средний здесь

Widget _tabStep() => Container(
    margin: EdgeInsets.only(top: 10),
    color: PURPLE,
    child: Stepper(
      steps: [
        Step(
          title: Text("First"),
          content: Text("This is our first example."),
        ),
        Step(
          title: Text("Second"),
          content: Text("This is our second example."),
        ),
        Step(
          title: Text("Third"),
          content: Text("This is our third example."),
        ),
        Step(
          title: Text("Forth"),
          content: Text("This is our forth example."),
        ),
      ],
      currentStep: _index,
      onStepTapped: (index) {
        setState(() {
          _index = index;
        });
      },
      onStepCancel: () {
        print("You are clicking the cancel button.");
      },
      onStepContinue: () {
        print("You are clicking the continue button.");
      },
    ),
  );
...