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

Debug-time bottom sheets for Flutter — text input with history and single-select list.

example/lib/main.dart

import 'package:debug_sheet/debug_sheet.dart';
import 'package:flutter/material.dart';
import 'package:get_storage/get_storage.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await GetStorage.init();
  runApp(const ExampleApp());
}

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: HomePage());
  }
}

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

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  String _inputResult = '—';
  int _selectResult = -1;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('debug_sheet example')),
      body: Padding(
        padding: const EdgeInsets.all(24),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Text('Input result: $_inputResult'),
            const SizedBox(height: 12),
            ElevatedButton(
              onPressed: () async {
                final result = await showModalBottomSheet<String>(
                  context: context,
                  isScrollControlled: true,
                  builder: (_) => const DebugInputSheet(title: 'Enter a URL'),
                );
                setState(() => _inputResult = result ?? '(cancelled)');
              },
              child: const Text('Open DebugInputSheet'),
            ),
            const SizedBox(height: 8),
            Text(
              'Confirm a few different URLs, then reopen the sheet — the one '
              'you just used sits at the top of the history.',
              style: Theme.of(context).textTheme.bodySmall,
            ),
            const SizedBox(height: 32),
            Text('Select result: index $_selectResult'),
            const SizedBox(height: 12),
            ElevatedButton(
              onPressed: () async {
                final result = await showModalBottomSheet<int>(
                  context: context,
                  builder: (_) => const DebugSelectSheet(
                    title: 'Choose an option',
                    items: ['Option A', 'Option B', 'Option C'],
                  ),
                );
                setState(() => _selectResult = result ?? -1);
              },
              child: const Text('Open DebugSelectSheet'),
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
140
points
109
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Debug-time bottom sheets for Flutter — text input with history and single-select list.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

crypto, flutter, get_storage

More

Packages that depend on debug_sheet