platform_settings_ui 0.0.1 copy "platform_settings_ui: ^0.0.1" to clipboard
platform_settings_ui: ^0.0.1 copied to clipboard

outdated

Easily create settings pages with iOS 15 and Android 11 norms.

example/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:platform_settings_ui/platform_settings_ui.dart';
import 'package:platform_settings_ui/settings_tile/settings_switch_tile.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Platform Settings UI Demo',
      home: PlatformUiExample(),
    );
  }
}

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

  @override
  _PlatformUiExampleState createState() => _PlatformUiExampleState();
}

class _PlatformUiExampleState extends State<PlatformUiExample> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Settings"),
      ),
      body: SettingsList(
        children: [
          SettingsSection(
            title: "Common",
            children: [
              SettingsTile(
                title: "Language",
                icon: const Icon(Icons.language),
                onTap: () => print("Tapped"),
                subTitle: "English",
              ),
              SettingsTile(
                title: "Theme",
                icon: const Icon(Icons.add_to_home_screen),
                onTap: () => print("Tapped"),
                subTitle: "light",
              )
            ]
          ),
          SettingsSection(
              title: "Account",
              children: [
                SettingsTile(
                  title: "Name",
                  icon: const Icon(Icons.person),
                  onTap: () => print("Tapped"),
                  subTitle: "John Doe",
                ),
                SettingsSwitchTile(
                  title: "Theme",
                  icon: const Icon(Icons.add_to_home_screen),
                  value: true,
                  onChanged: (value) => print(value),
                  activeColor: Colors.red,
                )
              ]
          )
        ],
      ),
    );
  }
}
12
likes
0
pub points
60%
popularity

Publisher

unverified uploader

Easily create settings pages with iOS 15 and Android 11 norms.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on platform_settings_ui