Skip to main content

prism_adaptive_scaffold 0.1.0 copy "prism_adaptive_scaffold: ^0.1.0" to clipboard
prism_adaptive_scaffold: ^0.1.0 copied to clipboard

Responsive adaptive scaffolds for Flutter — the maintained replacement for the discontinued flutter_adaptive_scaffold. Navigation rails, split views, and breakpoints that adapt from phone to tablet to [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:prism_adaptive_scaffold/prism_adaptive_scaffold.dart';

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

/// Demonstrates how [PrismAdaptiveScaffold] adapts to window size.
/// Resize the window to see bottom bar → rail → extended rail transitions.
class DemoApp extends StatelessWidget {
  const DemoApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'prism_adaptive_scaffold demo',
      theme: ThemeData.light(useMaterial3: true),
      darkTheme: ThemeData.dark(useMaterial3: true),
      home: const DemoPage(),
    );
  }
}

class DemoPage extends StatefulWidget {
  const DemoPage({super.key});

  @override
  State<DemoPage> createState() => _DemoPageState();
}

class _DemoPageState extends State<DemoPage> {
  int _index = 0;

  static const _destinations = [
    AdaptiveDestination(icon: Icons.inbox_outlined, selectedIcon: Icons.inbox, label: 'Inbox'),
    AdaptiveDestination(icon: Icons.star_outlined, selectedIcon: Icons.star, label: 'Starred'),
    AdaptiveDestination(icon: Icons.send_outlined, selectedIcon: Icons.send, label: 'Sent'),
  ];

  @override
  Widget build(BuildContext context) {
    return PrismAdaptiveScaffold(
      destinations: _destinations,
      currentIndex: _index,
      onDestinationSelected: (i) => setState(() => _index = i),
      appBar: AppBar(title: const Text('prism_adaptive_scaffold demo')),
      bodyBuilder: (index) => Center(
        child: Text(
          'Page $index',
          style: Theme.of(context).textTheme.headlineMedium,
        ),
      ),
    );
  }
}
0
likes
150
points
55
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Responsive adaptive scaffolds for Flutter — the maintained replacement for the discontinued flutter_adaptive_scaffold. Navigation rails, split views, and breakpoints that adapt from phone to tablet to desktop out of the box.

Repository (GitHub)
View/report issues

Topics

#adaptive #responsive #scaffold #navigation #layout

License

MIT (license)

Dependencies

flutter, meta

More

Packages that depend on prism_adaptive_scaffold