Skip to content

Instantly share code, notes, and snippets.

@Dieterbe
Created September 11, 2025 09:17
Show Gist options
  • Save Dieterbe/929e4a581ed7fccd76354531c1299a7b to your computer and use it in GitHub Desktop.
Save Dieterbe/929e4a581ed7fccd76354531c1299a7b to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
/// Flutter code sample for [Switch].
void main() => runApp(const SwitchApp());
class SwitchApp extends StatelessWidget {
const SwitchApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Switch Sample')),
body: Row(
children: [
Text("some text"),
Switch(value: true, onChanged: (bool value) {}),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment