enough_platform_widgets 1.1.1 enough_platform_widgets: ^1.1.1 copied to clipboard
Useful platform aware widgets to develop a Flutter app with either Cupertino and Material design.
example/enough_platform_widgets_example.dart
import 'package:enough_platform_widgets/enough_platform_widgets.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return PlatformApp(
title: 'Platform App Example',
material: (context, platform) => MaterialAppData(
theme: ThemeData(
primarySwatch: Colors.blue,
),
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) => PlatformScaffold(
appBar: PlatformAppBar(
title: Text('Hello World'),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ListView(
children: [
SelectablePlatformListTile(
title: Text('List Tile 1'),
),
SelectablePlatformListTile(
title: Text('List Tile 2'),
),
SelectablePlatformListTile(
title: Text('List Tile 3'),
),
],
),
),
],
),
);
}