init
This commit is contained in:
6
lib/pages/splash/index.dart
Normal file
6
lib/pages/splash/index.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
library splash;
|
||||
|
||||
export './splash_binding.dart';
|
||||
export './splash_logic.dart';
|
||||
export './splash_state.dart';
|
||||
export './splash_view.dart';
|
||||
10
lib/pages/splash/splash_binding.dart
Normal file
10
lib/pages/splash/splash_binding.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'splash_logic.dart';
|
||||
|
||||
class SplashBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut(() => SplashLogic());
|
||||
}
|
||||
}
|
||||
24
lib/pages/splash/splash_logic.dart
Normal file
24
lib/pages/splash/splash_logic.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
||||
|
||||
import 'splash_state.dart';
|
||||
|
||||
class SplashLogic extends GetxController {
|
||||
final SplashState state = SplashState();
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void showText(context) {
|
||||
TDToast.showText('轻提示文字内容', context: context);
|
||||
}
|
||||
}
|
||||
6
lib/pages/splash/splash_state.dart
Normal file
6
lib/pages/splash/splash_state.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
class SplashState {
|
||||
SplashState() {
|
||||
///Initialize variables
|
||||
}
|
||||
}
|
||||
43
lib/pages/splash/splash_view.dart
Normal file
43
lib/pages/splash/splash_view.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
||||
import 'splash_logic.dart';
|
||||
|
||||
class SplashPage extends StatefulWidget {
|
||||
const SplashPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SplashPage> createState() => _SplashPageState();
|
||||
}
|
||||
|
||||
class _SplashPageState extends State<SplashPage> {
|
||||
final logic = Get.find<SplashLogic>();
|
||||
final state = Get.find<SplashLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text("Splash"),
|
||||
TDButton(
|
||||
theme: TDButtonTheme.primary,
|
||||
text: "立即登录",
|
||||
onTap: () {
|
||||
logic.showText(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
Get.delete<SplashLogic>();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user