我是新人,我的英语很差。请回答易于理解的问题...我已经尝试使用 AspectRatio 小部件,但它与中心小部件相结合,将我的按钮移动到了中心。除此之外,它确实有效,但按钮确实需要粘在一边。到目前为止,这是我的代码:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'main.dart';
import 'contentData.dart';
import 'package:swipedetector/swipedetector.dart';
AppBrain contentData = AppBrain();
class SwipePage extends StatefulWidget {
SwipePage({Key key, this.title}) : super(key: key);
final String title;
@override
_SwipePage createState() => _SwipePage();
}
class _SwipePage extends State<SwipePage> {
@override
Widget build(BuildContext context) {
return SwipeDetector(
swipeConfiguration: SwipeConfiguration(
horizontalSwipeMaxHeightThreshold: 80.0,
horizontalSwipeMinDisplacement: 30.0,
horizontalSwipeMinVelocity: 150.0),
onSwipeLeft: () {
Navigator.of(context).push(
toInformationPage(),
);
},
child: Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: Padding(
padding: const EdgeInsets.only(top: 20, bottom: 20),
child: Column( …Run Code Online (Sandbox Code Playgroud)