velocity_x 4.3.1 copy "velocity_x: ^4.3.1" to clipboard
velocity_x: ^4.3.1 copied to clipboard

A minimalist Flutter framework for rapidly building custom designs.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:vx_example/mutations/mutations.dart';
import 'package:vx_example/pages/pages.dart';
import 'package:vx_example/stores/stores.dart';

/// Build store and make it part of app
void main() => runApp(VxState(store: BaseStore(), child: const VxExampleApp()));

/// VxExampleApp
class VxExampleApp extends StatelessWidget {
  /// Create VxExampleApp
  const VxExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      // theme: ThemeData(
      //   // Styles for the AppBar
      //   appBarTheme: const AppBarTheme(),

      //   // Styles for the BottomNavigationBar
      //   bottomNavigationBarTheme: const BottomNavigationBarThemeData(),
      // ),
      home: VxBuilder<BaseStore>(
        mutations: const {SetCurrentIndex},
        builder: (context, store, status) {
          return Scaffold(
            body: store.currentIndex == 0
                ? const HomePage()
                : const ProfilePage(),
            bottomNavigationBar: BottomNavigationBar(
              items: const [
                BottomNavigationBarItem(
                  icon: Icon(key: Key('bottom-nav-home'), Icons.home),
                  label: 'Home',
                ),
                BottomNavigationBarItem(
                  icon: Icon(key: Key('bottom-nav-profile'), Icons.person),
                  label: 'Profile',
                ),
              ],
              currentIndex: store.currentIndex,
              onTap: (_) => SetCurrentIndex(),
            ),
          );
        },
      ),
    );
  }
}
copied to clipboard
1.44k
likes
150
points
8.08k
downloads

Publisher

verified publishercodepur.dev

Weekly Downloads

2024.09.13 - 2025.03.28

A minimalist Flutter framework for rapidly building custom designs.

Homepage
Repository (GitHub)
Contributing

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

auto_size_text_pk, flutter, flutter_web_plugins, intl, vector_math, vxstate

More

Packages that depend on velocity_x