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