Remove Cupertino changes branches
Keep the Material-only changes feature while preserving public Cupertino parameters for callers. Remove Cupertino-only widgets, imports, hosts, and tests because the app never reaches that path.
This commit is contained in:
@@ -2,7 +2,6 @@ import '../../../ui/adaptive/segmented_bar.dart';
|
||||
import '../../../ui/input/arrow_key_pager.dart';
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
@@ -70,7 +69,6 @@ class _FileDiffViewerState extends State<FileDiffViewer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final file = widget.file;
|
||||
final cupertino = usesCupertino(context);
|
||||
final base = DefaultTextStyle.of(context).style;
|
||||
final mono = nativeDiffText(base);
|
||||
final stat = changeStat(file.added, file.removed);
|
||||
@@ -196,12 +194,7 @@ class _FileDiffViewerState extends State<FileDiffViewer> {
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 16,
|
||||
color: cupertino
|
||||
? CupertinoColors.separator.resolveFrom(context)
|
||||
: Theme.of(context).dividerColor,
|
||||
),
|
||||
Divider(height: 16, color: Theme.of(context).dividerColor),
|
||||
Flexible(child: _body(context, mono)),
|
||||
],
|
||||
),
|
||||
@@ -260,11 +253,9 @@ Future<void> showFileDiffViewer(
|
||||
}) {
|
||||
final list = files == null || !files.contains(file) ? [file] : files;
|
||||
final page = FileDiffPage(files: list, initialIndex: list.indexOf(file));
|
||||
return Navigator.of(context).push<void>(
|
||||
usesCupertino(context)
|
||||
? CupertinoPageRoute<void>(builder: (_) => page)
|
||||
: MaterialPageRoute<void>(builder: (_) => page),
|
||||
);
|
||||
return Navigator.of(
|
||||
context,
|
||||
).push<void>(MaterialPageRoute<void>(builder: (_) => page));
|
||||
}
|
||||
|
||||
/// One recorded file's diff as a page, with the previous and next file of the
|
||||
@@ -286,7 +277,6 @@ class _FileDiffPageState extends State<FileDiffPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cupertino = usesCupertino(context);
|
||||
final file = widget.files[_index];
|
||||
final name = file.path.split('/').last;
|
||||
final count = widget.files.length;
|
||||
@@ -321,18 +311,12 @@ class _FileDiffPageState extends State<FileDiffPage> {
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
minimum: const EdgeInsets.all(8),
|
||||
child: GlassControlBar(cupertino: cupertino, child: pager),
|
||||
child: GlassControlBar(cupertino: false, child: pager),
|
||||
),
|
||||
),
|
||||
child: viewer,
|
||||
),
|
||||
);
|
||||
if (cupertino) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: SegmentedBar(cupertino: true, title: name),
|
||||
child: Theme(data: hostTextTheme(context), child: body),
|
||||
);
|
||||
}
|
||||
return Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: SegmentedBar(cupertino: false, title: name),
|
||||
|
||||
Reference in New Issue
Block a user