import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:isekai_wiki/components/isekai_page_scaffold.dart'; import 'package:isekai_wiki/components/state_test.dart'; import 'package:isekai_wiki/styles.dart'; class SearchController extends GetxController { var count1 = 0.obs; var count2 = 0.obs; } class SearchTab extends StatelessWidget { const SearchTab({super.key}); @override Widget build(BuildContext context) { var c = Get.put(SearchController()); return IsekaiPageScaffold( navigationBar: const CupertinoNavigationBar( middle: Text('搜索'), ), child: ListView( children: [ Container( color: Theme.of(context).cardColor, child: SafeArea( top: false, bottom: false, child: Column( children: [ Obx( () => StateTest( count: c.count1.value, onPressed: (() { c.count1.value++; }), ), ), Obx( () => StateTest( count: c.count2.value, onPressed: (() { c.count2.value++; }), ), ), ], ), ), ), ], ), ); } }