Ask Your Question
2

Is there a Cupertino-themed Listtile/Card or a similar component that is available for integration in my flutter application?

asked 2021-12-10 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-07-02 14:00:00 +0000

lalupa gravatar image

Yes, Flutter provides Cupertino-themed ListTile and Card components that can be used in your application. These components follow the design guidelines of the Cupertino iOS style and provide a seamless experience for iOS users. To use these components, you need to import the 'cupertino_icons' package in your application and use the 'CupertinoListTile' and 'CupertinoCard' classes to create the widgets. Here is an example:

import 'package:flutter/cupertino.dart';
import 'package:cupertino_icons/cupertino_icons.dart';

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      navigationBar: CupertinoNavigationBar(
        middle: Text('My App'),
      ),
      child: SafeArea(
        child: ListView(
          children: <Widget>[
            CupertinoListTile(
              leading: Icon(CupertinoIcons.home),
              title: Text('Home'),
              subtitle: Text('Go to Home Page'),
              trailing: Icon(CupertinoIcons.forward),
              onTap: () {},
            ),
            CupertinoDivider(),
            CupertinoListTile(
              leading: Icon(CupertinoIcons.profile_circled),
              title: Text('Profile'),
              subtitle: Text('View your Profile'),
              trailing: Icon(CupertinoIcons.forward),
              onTap: () {},
            ),
            CupertinoDivider(),
            CupertinoCard(
              child: Column(
                children: <Widget>[
                  Text('Hello, World!'),
                  CupertinoButton(
                    child: Text('Learn More'),
                    onPressed: () {},
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-10 11:00:00 +0000

Seen: 10 times

Last updated: Jul 02 '21