animated_segment 0.0.4 copy "animated_segment: ^0.0.4" to clipboard
animated_segment: ^0.0.4 copied to clipboard

Package provides you a modern animated fancy segment. Show selection of tab using elastic way animation.

example/lib/main.dart

import 'package:animated_segment/segment_animation.dart';
import 'package:example/constants/strings.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({
    Key? key,
  }) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
  final List<String> _listOfSegments = [
    Strings.tab_1,
    Strings.tab_2,
    Strings.tab_3,
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        alignment: Alignment.center,
        color: AppColors.white,
        child: AnimatedSegment(
          segmentNames: _listOfSegments,
          onSegmentChanged: (index) {
            print('Selected Segment is: ${_listOfSegments[index]}');
          },
          initialSegment: 1,
          backgroundColor: AppColors.bgColor,
          segmentTextColor: AppColors.white,
          rippleEffectColor: AppColors.primary,
          selectedSegmentColor: AppColors.primary,
        ),
      ),
    );
  }
}
71
likes
150
points
33
downloads

Publisher

verified publishermindinventory.com

Weekly Downloads

Package provides you a modern animated fancy segment. Show selection of tab using elastic way animation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on animated_segment