InkWell
Автор: Satamoni
Загружено: 2025-07-25
Просмотров: 1
Описание:
InkWell
#flutter
#firebasez
#fluttercommunity
#fluttercourse
#fluttertutorials
code:
import 'package:flutter/material.dart';
void main() = runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: InkWellExample(),
);
}
}
class InkWellExample extends StatefulWidget {
@override
_InkWellExampleState createState() = _InkWellExampleState();
}
class _InkWellExampleState extends State InkWellExample {
String message = "tap";
void updateMessage(String newMessage) {
setState(() {
message = newMessage;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Material(
color: Colors.blue,
borderRadius: BorderRadius.circular(8),
child: InkWell(
onTap: () = updateMessage("onTap"),
onDoubleTap: () = updateMessage("onDoubleTap"),
onLongPress: () = updateMessage("onLongPress"),
borderRadius: BorderRadius.circular(8),
child: Container(
width: 150,
height: 150,
alignment: Alignment.center,
child: Text(
"tap",
style: TextStyle(color: Colors.white, fontSize: 18),
),
),
),
),
SizedBox(height: 20),
Text(message, style: TextStyle(fontSize: 20)),
],
),
),
);
}
}
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: