1
0
mirror of https://github.com/nisrulz/flutter-examples.git synced 2026-08-24 16:50:47 +00:00
Files
flutter-examples/bottom_sheet/lib/home.dart
Nishant Srivastava 5c53498119 refactor: standardize Dart and Android config across all 54 apps
- Bump all apps to sdk >=3.0.0 <4.0.0 and add flutter_lints + a shared
  analysis_options.yaml to every app (flutter analyze is now green repo-wide)
- Fix real compile errors in firebase_google_authentication and image_editor,
  plus deprecated APIs (Matrix4, SvgPicture.color, textScaleFactor),
  missing async 'mounted' guards, and misc lints via dart fix + manual fixes
- Align pubspec 'name' with each folder and Android namespace/applicationId
  with the documented github.nisrulz.* convention
- Convert bmi_calculator from a legacy Flutter module to a standard app
  with a proper android/ scaffold; fix missing android:exported in launcher
  manifests across 22 apps so all Android builds pass
- Untrack generated build files (GeneratedPluginRegistrant,
  .flutter-plugins-dependencies) and ignore them
2026-08-17 17:26:39 +02:00

63 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:bottom_sheet/models/ListTileModel.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
backgroundColor: Colors.redAccent,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
child: Text(
"Bottom Sheet",
style: TextStyle(fontSize: 20),
),
onPressed: () {
_openBottomSheet(context);
},
)
],
),
),
);
}
}
void _openBottomSheet(context) {
showModalBottomSheet(
context: context,
builder: (builder) {
return Container(
padding: EdgeInsets.all(5.0),
child: Wrap(
children: <Widget>[
getListTile(Icons.more, Colors.black45, "More", context),
getListTile(Icons.favorite, Colors.pink, "Favourites", context),
getListTile(Icons.account_box, Colors.blue, "Profile", context),
Divider(
thickness: 2.0,
height: 10.0,
),
getListTile(Icons.exit_to_app, null, "Logout", context),
],
),
);
},
);
}