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

A ListTile-Widget that renders a platform-specific ListTile.

platform_list_tile #

A ListTile-Widget that renders the platfrom-specific ListTile

Getting Started #

To use this plugin, add platfform_listtile as a dependency in your pubspec.yaml file.

The PlatformListTile-Widget renders a ListTile with the Material or Cupertino device specific style.

It combines the attributes of the ListTile and the CupertinoListTile. Material-only attributes are marked with a "M" at the end of name.

The only added vales are isElevatedM and elevationM. They put the ListTile inside a card and add a small Elevation around it.

Example #

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'PlatformListTile Demo',
      home: PlatformListTileDemo(),
    );
  }
}

class PlatformListTileDemo extends StatelessWidget {
  const PlatformListTileDemo({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("PlatformListTile"),
      ),
      body: ListView(
        children: [
          PlatformListTile(
            title: Text("ListTile"),
          ),
          PlatformListTile(
            title: Text("Empty ListTile"),
            trailing: Icon(
              Icons.circle,
              color: Colors.white
                  .withOpacity(0), //Overwriting the default iOS trailing icon
            ),
          ),
          PlatformListTile(
            title: Text("Leading Icon"),
            leading: Icon(Icons.account_circle),
          ),
          PlatformListTile(
            title: Text("Trailing Icon"),
            trailing: Icon(Icons.account_circle),
          ),
          PlatformListTile(
            title: Text("Both Icons"),
            leading: Icon(Icons.account_circle),
            trailing: Icon(Icons.account_circle),
          ),
          PlatformListTile(
            title: Text("Subtitle"),
            subtitle: Text("This is the Subtitle"),
          ),
          PlatformListTile(
            title: Text("Material Elevated"),
            isElevatedM: true,
            leading: Icon(Icons.account_circle),
            trailing: Icon(Icons.account_circle),
          )
        ],
      ),
    );
  }
}
2
likes
60
pub points
16%
popularity

Publisher

unverified uploader

A ListTile-Widget that renders a platform-specific ListTile.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

cupertino_list_tile, flutter

More

Packages that depend on platform_list_tile