refactor(example): simplify the example
This commit is contained in:
parent
5ec457c0ff
commit
b763e88957
|
|
@ -3,27 +3,14 @@ import 'package:flutter/material.dart';
|
|||
import 'package:swipeable_cards_stack/swipeable_cards_stack.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
runApp(const MaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||
);
|
||||
}
|
||||
home: const MyHomePage(),
|
||||
));
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
const MyHomePage({Key? key, required this.title}) : super(key: key);
|
||||
final String title;
|
||||
const MyHomePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
|
|
@ -36,9 +23,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.title),
|
||||
),
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
|
@ -68,8 +52,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
debugPrint('onDown ${(widget as CardView).text} $index');
|
||||
}
|
||||
},
|
||||
enableSwipeUp: true,
|
||||
enableSwipeDown: true,
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 20.0),
|
||||
|
|
|
|||
Loading…
Reference in New Issue