rand dart fix

This commit is contained in:
2026-01-15 17:36:22 -08:00
parent dbbdafd893
commit 91e7e39fe8
131 changed files with 976 additions and 1365 deletions
@@ -4,7 +4,6 @@ import 'tabs/master_detail_controller.dart';
import 'tabs/table_view_controller.dart';
import 'package:flutter/foundation.dart';
void main() => runApp(MyApp());
@@ -26,11 +25,11 @@ class CupertinoControllersApp extends StatelessWidget {
items: [
BottomNavigationBarItem(
icon: Icon(Icons.list),
title: Text("Table"),
label: Text("Table"),
),
BottomNavigationBarItem(
icon: Icon(Icons.layers),
title: Text("Mater Detail"),
label: Text("Mater Detail"),
),
],
),
@@ -41,9 +40,9 @@ class CupertinoControllersApp extends StatelessWidget {
];
return CupertinoTabView(
builder: (BuildContext context) {
return pages[index]?.child;
return pages[index].child;
},
defaultTitle: pages[index]?.title,
defaultTitle: pages[index].title,
);
;
},
@@ -80,7 +80,7 @@ class TableViewScreenState extends State<TableViewScreen>
var _sections = <CupertinoTableViewSection>[];
_sections = _buildSections(context,
data: _search != null && _search.isNotEmpty
data: _search.isNotEmpty
? _searchItems(context, search: _search)
: contacts);
@@ -117,10 +117,9 @@ class TableViewScreenState extends State<TableViewScreen>
});
},
onChanged: (String value) {
if (value != null)
setState(() {
_search = value;
});
setState(() {
_search = value;
});
},
),
),
@@ -144,17 +143,15 @@ class TableViewScreenState extends State<TableViewScreen>
},
isEditing: _isEditing,
onEditing: (bool value) {
if (value != null) {
setState(() {
_isEditing = value;
});
if (!_isEditing) {
setState(() {
_isEditing = value;
selected.clear();
});
if (!_isEditing) {
setState(() {
selected.clear();
});
}
}
},
},
isSearching: _isSearching,
showEditingButtonLeft: true,
);
@@ -197,7 +194,7 @@ class TableViewScreenState extends State<TableViewScreen>
}
Widget _buildListTile(BuildContext context, List<String> item) {
final bool _selected = selected?.contains(item) ?? false;
final bool _selected = selected.contains(item) ?? false;
CupertinoEditingAction _action;
switch (sharedValue) {
case 0:
@@ -138,7 +138,7 @@ class CupertinoTableViewController extends StatelessWidget {
}
return DefaultTextStyle(
style: Theme.of(context).textTheme.title!,
style: Theme.of(context).textTheme.titleLarge!,
child: Scaffold(
body: CustomScrollView(
primary: true,
@@ -1,5 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../widgets/text.dart';
@@ -14,9 +14,7 @@ class CupertinoSearchBar extends AnimatedWidget {
this.onClear,
this.enabled = true,
this.autoCorrect = true,
}) : assert(controller != null),
assert(focusNode != null),
super(key: key, listenable: animation);
}) : super(key: key, listenable: animation);
final TextEditingController controller;
final FocusNode focusNode;
@@ -68,7 +66,7 @@ class CupertinoSearchBar extends AnimatedWidget {
style: new TextStyle(
inherit: false,
color: CupertinoColors.inactiveGray
.withOpacity(_opacityTween.evaluate(animation)),
.withValues(alpha: _opacityTween.evaluate(animation)),
fontSize: _kFontSize,
),
),
@@ -102,11 +100,10 @@ class CupertinoSearchBar extends AnimatedWidget {
),
),
new CupertinoButton(
minSize: 10.0,
padding: const EdgeInsets.all(1.0),
borderRadius: new BorderRadius.circular(30.0),
color: CupertinoColors.inactiveGray.withOpacity(
1.0 - _opacityTween.evaluate(animation),
color: CupertinoColors.inactiveGray.withValues(
alpha: 1.0 - _opacityTween.evaluate(animation),
),
child: new Icon(
Icons.close,
@@ -118,7 +115,7 @@ class CupertinoSearchBar extends AnimatedWidget {
return;
else
onClear!();
},
}, minimumSize: Size(10.0, 10.0),
),
],
),
@@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
enum CupertinoTextTheme { title, subtitle, detail, custom }