mirror of
https://github.com/git-touch/git-touch
synced 2025-03-03 10:47:47 +01:00
feat: follow system option
This commit is contained in:
parent
80ab94df53
commit
baf3e43045
45
lib/app.dart
Normal file
45
lib/app.dart
Normal file
@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/home.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/screens/login.dart';
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
final themData = ThemeData(
|
||||
brightness: theme.brightness,
|
||||
// primaryColorBrightness: theme.brightness,
|
||||
primaryColorLight: theme.paletteLight.background,
|
||||
primaryColorDark: theme.paletteDark.background,
|
||||
);
|
||||
|
||||
// TODO:
|
||||
if (!auth.ready || !Provider.of<ThemeModel>(context).ready) {
|
||||
return MaterialApp(theme: themData, home: Scaffold(body: Text('a')));
|
||||
}
|
||||
|
||||
// Fimber.d(settings.activeLogin);
|
||||
if (auth.activeAccount == null) {
|
||||
return MaterialApp(theme: themData, home: LoginScreen());
|
||||
}
|
||||
|
||||
switch (theme.theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return CupertinoApp(
|
||||
theme: CupertinoThemeData(brightness: theme.brightness),
|
||||
home: Home(),
|
||||
);
|
||||
default:
|
||||
return MaterialApp(
|
||||
theme: themData,
|
||||
home: Home(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
153
lib/home.dart
Normal file
153
lib/home.dart
Normal file
@ -0,0 +1,153 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/notification.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/screens/gitlab_todos.dart';
|
||||
import 'package:git_touch/screens/gitlab_user.dart';
|
||||
import 'package:git_touch/screens/notification.dart';
|
||||
import 'package:git_touch/screens/user.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/screens/news.dart';
|
||||
import 'package:git_touch/screens/search.dart';
|
||||
import 'package:git_touch/screens/trending.dart';
|
||||
|
||||
class Home extends StatefulWidget {
|
||||
@override
|
||||
_HomeState createState() => _HomeState();
|
||||
}
|
||||
|
||||
class _HomeState extends State<Home> {
|
||||
int active = 0;
|
||||
|
||||
_buildScreen(int index) {
|
||||
// return GitlabProjectScreen(32221);
|
||||
// return IssuesScreen('flutter', 'flutter', isPullRequest: true);
|
||||
// return IssueScreen('reactjs', 'rfcs', 29);
|
||||
// return IssueScreen('reactjs', 'rfcs', 68, isPullRequest: true);
|
||||
// return Image.asset('images/spinner.webp', width: 32, height: 32);
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
|
||||
switch (auth.activeAccount.platform) {
|
||||
case PlatformType.github:
|
||||
switch (index) {
|
||||
case 0:
|
||||
return NewsScreen();
|
||||
case 1:
|
||||
return NotificationScreen();
|
||||
case 2:
|
||||
return TrendingScreen();
|
||||
case 3:
|
||||
return SearchScreen();
|
||||
case 4:
|
||||
return UserScreen('');
|
||||
}
|
||||
break;
|
||||
case PlatformType.gitlab:
|
||||
switch (index) {
|
||||
case 0:
|
||||
return GitlabTodosScreen();
|
||||
case 1:
|
||||
return GitlabUserScreen(auth.activeAccount.gitlabId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildNotificationIcon(BuildContext context, bool isActive) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final iconData = Icons.notifications;
|
||||
int count = Provider.of<NotificationModel>(context).count;
|
||||
if (count == 0) {
|
||||
return Icon(iconData);
|
||||
}
|
||||
|
||||
// String text = count > 99 ? '99+' : count.toString();
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
Icon(iconData),
|
||||
Positioned(
|
||||
right: -2,
|
||||
top: -2,
|
||||
child: Icon(Octicons.primitive_dot,
|
||||
color: theme.paletteOf(context).primary, size: 14))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
List<BottomNavigationBarItem> get _navigationItems {
|
||||
switch (Provider.of<AuthModel>(context).activeAccount.platform) {
|
||||
case PlatformType.github:
|
||||
return [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.rss_feed),
|
||||
title: Text('News'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: _buildNotificationIcon(context, false),
|
||||
activeIcon: _buildNotificationIcon(context, true),
|
||||
title: Text('Notification'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.whatshot),
|
||||
title: Text('Trending'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.search),
|
||||
title: Text('Search'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person),
|
||||
activeIcon: Icon(Icons.person),
|
||||
title: Text('Me'),
|
||||
),
|
||||
];
|
||||
case PlatformType.gitlab:
|
||||
return [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.timeline),
|
||||
title: Text('Todos'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person_outline),
|
||||
activeIcon: Icon(Icons.person),
|
||||
title: Text('Me'),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
switch (theme.theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return CupertinoTabScaffold(
|
||||
tabBar: CupertinoTabBar(items: _navigationItems),
|
||||
tabBuilder: (context, index) {
|
||||
return CupertinoTabView(builder: (context) {
|
||||
return _buildScreen(index);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
default:
|
||||
return Scaffold(
|
||||
body: _buildScreen(active),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
// selectedItemColor: theme.paletteOf(context).primary,
|
||||
items: _navigationItems,
|
||||
currentIndex: active,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
onTap: (int index) {
|
||||
setState(() {
|
||||
active = index;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
174
lib/main.dart
174
lib/main.dart
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/app.dart';
|
||||
import 'package:git_touch/models/code.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
@ -9,12 +10,10 @@ import 'package:git_touch/screens/commits.dart';
|
||||
import 'package:git_touch/screens/gitlab_blob.dart';
|
||||
import 'package:git_touch/screens/gitlab_issue.dart';
|
||||
import 'package:git_touch/screens/gitlab_project.dart';
|
||||
import 'package:git_touch/screens/gitlab_todos.dart';
|
||||
import 'package:git_touch/screens/gitlab_tree.dart';
|
||||
import 'package:git_touch/screens/gitlab_user.dart';
|
||||
import 'package:git_touch/screens/issue_form.dart';
|
||||
import 'package:git_touch/screens/issues.dart';
|
||||
import 'package:git_touch/screens/notification.dart';
|
||||
import 'package:git_touch/screens/object.dart';
|
||||
import 'package:git_touch/screens/repository.dart';
|
||||
import 'package:git_touch/screens/settings.dart';
|
||||
@ -25,179 +24,10 @@ import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/models/notification.dart';
|
||||
import 'package:fluro/fluro.dart';
|
||||
import 'package:git_touch/screens/news.dart';
|
||||
import 'package:git_touch/screens/search.dart';
|
||||
import 'package:git_touch/screens/login.dart';
|
||||
import 'package:git_touch/screens/issue.dart';
|
||||
import 'package:git_touch/screens/trending.dart';
|
||||
import 'package:fimber/fimber.dart';
|
||||
|
||||
class Home extends StatefulWidget {
|
||||
@override
|
||||
_HomeState createState() => _HomeState();
|
||||
}
|
||||
|
||||
class _HomeState extends State<Home> {
|
||||
int active = 0;
|
||||
// String login;
|
||||
|
||||
Widget _buildNotificationIcon(BuildContext context, bool isActive) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final iconData = Icons.notifications;
|
||||
int count = Provider.of<NotificationModel>(context).count;
|
||||
if (count == 0) {
|
||||
return Icon(iconData);
|
||||
}
|
||||
|
||||
// String text = count > 99 ? '99+' : count.toString();
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
Icon(iconData),
|
||||
Positioned(
|
||||
right: -2,
|
||||
top: -2,
|
||||
child: Icon(Octicons.primitive_dot,
|
||||
color: theme.palette.primary, size: 14))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
List<BottomNavigationBarItem> get _navigationItems {
|
||||
switch (Provider.of<AuthModel>(context).activeAccount.platform) {
|
||||
case PlatformType.github:
|
||||
return [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.rss_feed),
|
||||
title: Text('News'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: _buildNotificationIcon(context, false),
|
||||
activeIcon: _buildNotificationIcon(context, true),
|
||||
title: Text('Notification'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.whatshot),
|
||||
title: Text('Trending'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.search),
|
||||
title: Text('Search'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person),
|
||||
activeIcon: Icon(Icons.person),
|
||||
title: Text('Me'),
|
||||
),
|
||||
];
|
||||
case PlatformType.gitlab:
|
||||
return [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.timeline),
|
||||
title: Text('Todos'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person_outline),
|
||||
activeIcon: Icon(Icons.person),
|
||||
title: Text('Me'),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
_buildScreen(int index) {
|
||||
// return GitlabProjectScreen(32221);
|
||||
// return IssuesScreen('flutter', 'flutter', isPullRequest: true);
|
||||
// return IssueScreen('reactjs', 'rfcs', 29);
|
||||
// return IssueScreen('reactjs', 'rfcs', 68, isPullRequest: true);
|
||||
// return Image.asset('images/spinner.webp', width: 32, height: 32);
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
|
||||
switch (auth.activeAccount.platform) {
|
||||
case PlatformType.github:
|
||||
switch (index) {
|
||||
case 0:
|
||||
return NewsScreen();
|
||||
case 1:
|
||||
return NotificationScreen();
|
||||
case 2:
|
||||
return TrendingScreen();
|
||||
case 3:
|
||||
return SearchScreen();
|
||||
case 4:
|
||||
return UserScreen('');
|
||||
}
|
||||
break;
|
||||
case PlatformType.gitlab:
|
||||
switch (index) {
|
||||
case 0:
|
||||
return GitlabTodosScreen();
|
||||
case 1:
|
||||
return GitlabUserScreen(auth.activeAccount.gitlabId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
final themData = ThemeData(
|
||||
brightness: theme.brightnessEnum,
|
||||
primaryColor: theme.palette.background,
|
||||
);
|
||||
|
||||
// TODO:
|
||||
if (!auth.ready || !Provider.of<ThemeModel>(context).ready) {
|
||||
return MaterialApp(theme: themData, home: Scaffold(body: Text('a')));
|
||||
}
|
||||
|
||||
// Fimber.d(settings.activeLogin);
|
||||
if (auth.activeAccount == null) {
|
||||
return MaterialApp(theme: themData, home: LoginScreen());
|
||||
}
|
||||
|
||||
switch (theme.theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return CupertinoApp(
|
||||
theme: CupertinoThemeData(
|
||||
brightness: theme.brightnessEnum,
|
||||
primaryColor: theme.palette.primary,
|
||||
),
|
||||
home: CupertinoTabScaffold(
|
||||
tabBar: CupertinoTabBar(items: _navigationItems),
|
||||
tabBuilder: (context, index) {
|
||||
return CupertinoTabView(
|
||||
builder: (context) {
|
||||
return _buildScreen(index);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
default:
|
||||
return MaterialApp(
|
||||
theme: themData,
|
||||
home: Scaffold(
|
||||
body: _buildScreen(active),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
selectedItemColor: theme.palette.primary,
|
||||
items: _navigationItems,
|
||||
currentIndex: active,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
onTap: (int index) {
|
||||
setState(() {
|
||||
active = index;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
// Platform messages may fail, so we use a try/catch PlatformException.
|
||||
@ -264,6 +94,6 @@ void main() async {
|
||||
ChangeNotifierProvider(create: (context) => authModel),
|
||||
ChangeNotifierProvider(create: (context) => codeModel),
|
||||
],
|
||||
child: Home(),
|
||||
child: MyApp(),
|
||||
));
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ class AppThemeType {
|
||||
}
|
||||
|
||||
class AppBrightnessType {
|
||||
// static const followSystem = 0;
|
||||
static const followSystem = 0;
|
||||
static const light = 1;
|
||||
static const dark = 2;
|
||||
static const values = [
|
||||
// AppBrightnessType.followSystem,
|
||||
AppBrightnessType.followSystem,
|
||||
AppBrightnessType.light,
|
||||
AppBrightnessType.dark
|
||||
];
|
||||
@ -77,15 +77,15 @@ class StaticRoute extends PageRouteBuilder {
|
||||
}
|
||||
|
||||
class Palette {
|
||||
Color primary;
|
||||
Color text;
|
||||
Color secondaryText;
|
||||
Color tertiaryText;
|
||||
Color background;
|
||||
Color grayBackground;
|
||||
Color border;
|
||||
final Color primary;
|
||||
final Color text;
|
||||
final Color secondaryText;
|
||||
final Color tertiaryText;
|
||||
final Color background;
|
||||
final Color grayBackground;
|
||||
final Color border;
|
||||
|
||||
Palette({
|
||||
const Palette({
|
||||
this.primary,
|
||||
this.text,
|
||||
this.secondaryText,
|
||||
@ -104,9 +104,23 @@ class ThemeModel with ChangeNotifier {
|
||||
int get theme => _theme;
|
||||
bool get ready => _theme != null;
|
||||
|
||||
int _brightnessValue = AppBrightnessType.light;
|
||||
int _brightnessValue = AppBrightnessType.followSystem;
|
||||
int get brighnessValue => _brightnessValue;
|
||||
Brightness get brightnessEnum {
|
||||
|
||||
/// not null
|
||||
Brightness brightnessOf(BuildContext context) {
|
||||
switch (_brightnessValue) {
|
||||
case AppBrightnessType.light:
|
||||
return Brightness.light;
|
||||
case AppBrightnessType.dark:
|
||||
return Brightness.dark;
|
||||
default:
|
||||
return MediaQuery.of(context).platformBrightness;
|
||||
}
|
||||
}
|
||||
|
||||
// could be null
|
||||
Brightness get brightness {
|
||||
switch (_brightnessValue) {
|
||||
case AppBrightnessType.light:
|
||||
return Brightness.light;
|
||||
@ -127,30 +141,33 @@ class ThemeModel with ChangeNotifier {
|
||||
|
||||
final router = Router();
|
||||
|
||||
Palette get palette {
|
||||
switch (brightnessEnum) {
|
||||
final paletteLight = Palette(
|
||||
primary: Colors.blueAccent.shade700,
|
||||
text: Colors.black,
|
||||
secondaryText: Colors.grey.shade800,
|
||||
tertiaryText: Colors.grey.shade600,
|
||||
background: Colors.white,
|
||||
grayBackground: Colors.grey.shade100,
|
||||
border: Colors.grey.shade400,
|
||||
);
|
||||
final paletteDark = Palette(
|
||||
primary: Colors.blueAccent.shade200,
|
||||
text: Colors.grey.shade300,
|
||||
secondaryText: Colors.grey.shade400,
|
||||
tertiaryText: Colors.grey.shade500,
|
||||
background: Colors.black,
|
||||
grayBackground: Colors.grey.shade900,
|
||||
border: Colors.grey.shade700,
|
||||
);
|
||||
|
||||
Palette paletteOf(BuildContext context) {
|
||||
switch (brightnessOf(context)) {
|
||||
case Brightness.light:
|
||||
return Palette(
|
||||
primary: Colors.blueAccent.shade700,
|
||||
text: Colors.black,
|
||||
secondaryText: Colors.grey.shade800,
|
||||
tertiaryText: Colors.grey.shade600,
|
||||
background: Colors.white,
|
||||
grayBackground: Colors.grey.shade100,
|
||||
border: Colors.grey.shade400,
|
||||
);
|
||||
return paletteLight;
|
||||
case Brightness.dark:
|
||||
return Palette(
|
||||
primary: Colors.blueAccent.shade200,
|
||||
text: Colors.grey.shade300,
|
||||
secondaryText: Colors.grey.shade400,
|
||||
tertiaryText: Colors.grey.shade500,
|
||||
background: Colors.black,
|
||||
grayBackground: Colors.grey.shade900,
|
||||
border: Colors.grey.shade700,
|
||||
);
|
||||
return paletteDark;
|
||||
default:
|
||||
return null;
|
||||
throw 'brightnessOf should not return null';
|
||||
}
|
||||
}
|
||||
|
||||
@ -350,7 +367,7 @@ class ThemeModel with ChangeNotifier {
|
||||
return Container(
|
||||
height: 216,
|
||||
child: CupertinoPicker(
|
||||
backgroundColor: palette.background,
|
||||
backgroundColor: paletteOf(context).background,
|
||||
children: groupItem.items.map((v) => Text(v.text)).toList(),
|
||||
itemExtent: 40,
|
||||
scrollController: FixedExtentScrollController(
|
||||
|
@ -32,7 +32,7 @@ class CommonScaffold extends StatelessWidget {
|
||||
default:
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
brightness: theme.brightnessEnum,
|
||||
brightness: theme.brightnessOf(context),
|
||||
title: title,
|
||||
actions: [
|
||||
if (action != null) action,
|
||||
|
@ -134,20 +134,21 @@ class _LongListStatefulScaffoldState<T, K>
|
||||
child: Container(
|
||||
padding: CommonStyle.padding,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: theme.palette.text),
|
||||
border: Border.all(color: theme.paletteOf(context).text),
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text('$count hidden items',
|
||||
style:
|
||||
TextStyle(color: theme.palette.text, fontSize: 15)),
|
||||
style: TextStyle(
|
||||
color: theme.paletteOf(context).text, fontSize: 15)),
|
||||
Padding(padding: EdgeInsets.only(top: 4)),
|
||||
loadingMore
|
||||
? CupertinoActivityIndicator()
|
||||
: Text(
|
||||
'Load more...',
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary, fontSize: 16),
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -51,7 +51,8 @@ class _AboutScreenState extends State<AboutScreen> {
|
||||
SizedBox(height: 12),
|
||||
Text(
|
||||
'GitTouch',
|
||||
style: TextStyle(fontSize: 20, color: theme.palette.text),
|
||||
style:
|
||||
TextStyle(fontSize: 20, color: theme.paletteOf(context).text),
|
||||
),
|
||||
SizedBox(height: 48),
|
||||
TableView(items: [
|
||||
|
@ -79,7 +79,7 @@ class CommitsScreen extends StatelessWidget {
|
||||
payload.messageHeadline,
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.text,
|
||||
color: theme.paletteOf(context).text,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@ -93,7 +93,7 @@ class CommitsScreen extends StatelessWidget {
|
||||
Text(
|
||||
' committed ${timeago.format(payload.committedDate)}',
|
||||
style: TextStyle(
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
|
@ -85,7 +85,7 @@ class GitlabProjectScreen extends StatelessWidget {
|
||||
CommonStyle.verticalGap,
|
||||
if (data.languages.isNotEmpty)
|
||||
Container(
|
||||
color: theme.palette.background,
|
||||
color: theme.paletteOf(context).background,
|
||||
padding: CommonStyle.padding.copyWith(top: 8, bottom: 8),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
@ -132,7 +132,7 @@ class GitlabProjectScreen extends StatelessWidget {
|
||||
if (data.readme != null)
|
||||
Container(
|
||||
padding: CommonStyle.padding,
|
||||
color: theme.palette.background,
|
||||
color: theme.paletteOf(context).background,
|
||||
child: MarkdownView(data.readme),
|
||||
),
|
||||
CommonStyle.verticalGap,
|
||||
|
@ -47,7 +47,7 @@ class GitlabProjectActivity extends StatelessWidget {
|
||||
TextSpan(
|
||||
text: data.author.name,
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
|
@ -13,7 +13,7 @@ class GitlabTodosScreen extends StatelessWidget {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return TextSpan(
|
||||
text: p.author.name,
|
||||
style: TextStyle(color: theme.palette.primary),
|
||||
style: TextStyle(color: theme.paletteOf(context).primary),
|
||||
);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ class GitlabTodosScreen extends StatelessWidget {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return TextSpan(
|
||||
text: '${p.project.pathWithNamespace}!${p.target.iid}',
|
||||
style: TextStyle(color: theme.palette.primary),
|
||||
style: TextStyle(color: theme.paletteOf(context).primary),
|
||||
);
|
||||
}
|
||||
|
||||
@ -85,7 +85,8 @@ class GitlabTodosScreen extends StatelessWidget {
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
style: TextStyle(
|
||||
color: theme.palette.text, fontSize: 17),
|
||||
color: theme.paletteOf(context).text,
|
||||
fontSize: 17),
|
||||
children: [
|
||||
..._buildItem(context, item),
|
||||
],
|
||||
|
@ -18,7 +18,8 @@ class ImageViewScreen extends StatelessWidget {
|
||||
title: title,
|
||||
body: PhotoView(
|
||||
imageProvider: NetworkImage(url),
|
||||
backgroundDecoration: BoxDecoration(color: theme.palette.background),
|
||||
backgroundDecoration:
|
||||
BoxDecoration(color: theme.paletteOf(context).background),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ mutation {
|
||||
'$owner / $name',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
@ -436,7 +436,7 @@ mutation {
|
||||
'#$number',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -463,7 +463,7 @@ mutation {
|
||||
Text(
|
||||
'${p['changedFiles']} files changed',
|
||||
style: TextStyle(
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
@ -486,7 +486,7 @@ mutation {
|
||||
),
|
||||
Icon(
|
||||
Icons.chevron_right,
|
||||
color: theme.palette.border,
|
||||
color: theme.paletteOf(context).border,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
@ -36,7 +36,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
child: Container(
|
||||
padding: CommonStyle.padding,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: theme.palette.border)),
|
||||
border: Border(
|
||||
bottom: BorderSide(color: theme.paletteOf(context).border)),
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
@ -68,7 +69,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: theme.palette.border)),
|
||||
border: Border(
|
||||
bottom: BorderSide(color: theme.paletteOf(context).border)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -125,7 +127,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
Text(
|
||||
'user, repo, read:org',
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: theme.palette.primary),
|
||||
fontSize: 16,
|
||||
color: theme.paletteOf(context).primary),
|
||||
)
|
||||
],
|
||||
),
|
||||
@ -175,7 +178,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
// Text(
|
||||
// 'api, read_user, read_repository',
|
||||
// style: TextStyle(
|
||||
// fontSize: 16, color: theme.palette.primary),
|
||||
// fontSize: 16, color: theme.paletteOf(context).primary),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
|
@ -114,7 +114,7 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.palette.text,
|
||||
color: theme.paletteOf(context).text,
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
@ -125,7 +125,7 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
|
||||
},
|
||||
child: Icon(
|
||||
Octicons.check,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
|
@ -152,7 +152,7 @@ class ObjectScreen extends StatelessWidget {
|
||||
return PhotoView(
|
||||
imageProvider: NetworkImage(rawUrl),
|
||||
backgroundDecoration:
|
||||
BoxDecoration(color: theme.palette.background),
|
||||
BoxDecoration(color: theme.paletteOf(context).background),
|
||||
);
|
||||
case 'md':
|
||||
case 'markdown':
|
||||
@ -169,9 +169,10 @@ class ObjectScreen extends StatelessWidget {
|
||||
child: HighlightView(
|
||||
text,
|
||||
language: _language,
|
||||
theme: themeMap[theme.brightnessEnum == Brightness.dark
|
||||
? codeProvider.themeDark
|
||||
: codeProvider.theme],
|
||||
theme: themeMap[
|
||||
theme.brightnessOf(context) == Brightness.dark
|
||||
? codeProvider.themeDark
|
||||
: codeProvider.theme],
|
||||
padding: CommonStyle.padding,
|
||||
textStyle: TextStyle(
|
||||
fontSize: codeProvider.fontSize.toDouble(),
|
||||
|
@ -143,7 +143,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
'$owner / $name',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -170,7 +170,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
Text(
|
||||
repo.description,
|
||||
style: TextStyle(
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
@ -180,7 +180,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
child: Text(
|
||||
repo.homepageUrl,
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
@ -194,8 +194,8 @@ class RepositoryScreen extends StatelessWidget {
|
||||
return MyLabel(
|
||||
name: node.topic.name,
|
||||
// color: Colors.blue.shade50,
|
||||
color: theme.palette.grayBackground,
|
||||
textColor: theme.palette.primary,
|
||||
color: theme.paletteOf(context).grayBackground,
|
||||
textColor: theme.paletteOf(context).primary,
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
@ -233,7 +233,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Container(
|
||||
color: theme.palette.background,
|
||||
color: theme.paletteOf(context).background,
|
||||
padding: EdgeInsets.all(40),
|
||||
height: 400,
|
||||
child: charts.PieChart(
|
||||
@ -268,7 +268,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
// color: theme.palette.background,
|
||||
// color: theme.paletteOf(context).background,
|
||||
padding: CommonStyle.padding.copyWith(top: 8, bottom: 8),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
@ -364,7 +364,7 @@ class RepositoryScreen extends StatelessWidget {
|
||||
if (readme != null)
|
||||
Container(
|
||||
padding: CommonStyle.padding,
|
||||
color: theme.palette.background,
|
||||
color: theme.paletteOf(context).background,
|
||||
child: MarkdownView(
|
||||
readme,
|
||||
basePaths: [owner, name, branch ?? 'master'], // TODO:
|
||||
|
@ -17,7 +17,7 @@ class SettingsScreen extends StatelessWidget {
|
||||
Widget _buildRightWidget(BuildContext context, bool checked) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
if (!checked) return null;
|
||||
return Icon(Icons.check, color: theme.palette.primary, size: 24);
|
||||
return Icon(Icons.check, color: theme.paletteOf(context).primary, size: 24);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -63,7 +63,7 @@ class SettingsScreen extends StatelessWidget {
|
||||
TableView(
|
||||
headerText: 'BRIGHTNESS',
|
||||
items: [
|
||||
// Tuple2('Follow System', AppBrightnessType.followSystem),
|
||||
Tuple2('Follow System', AppBrightnessType.followSystem),
|
||||
Tuple2('Light', AppBrightnessType.light),
|
||||
Tuple2('Dark', AppBrightnessType.dark),
|
||||
].map((t) {
|
||||
|
@ -53,7 +53,7 @@ class TrendingScreen extends StatelessWidget {
|
||||
Icon(
|
||||
Octicons.repo,
|
||||
size: 15,
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
),
|
||||
SizedBox(width: 2),
|
||||
Text(item.repo.name)
|
||||
|
@ -107,7 +107,7 @@ class UserScreen extends StatelessWidget {
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(
|
||||
color: theme.palette.text,
|
||||
color: theme.paletteOf(context).text,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
@ -117,7 +117,7 @@ class UserScreen extends StatelessWidget {
|
||||
Text(
|
||||
login,
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
@ -127,13 +127,13 @@ class UserScreen extends StatelessWidget {
|
||||
Icon(
|
||||
Octicons.clock,
|
||||
size: 16,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
'Joined on ${dateFormat.format(createdAt)}',
|
||||
style: TextStyle(
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
@ -144,7 +144,7 @@ class UserScreen extends StatelessWidget {
|
||||
Text(
|
||||
bio,
|
||||
style: TextStyle(
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
fontSize: 17,
|
||||
),
|
||||
)
|
||||
@ -216,7 +216,7 @@ class UserScreen extends StatelessWidget {
|
||||
]),
|
||||
CommonStyle.border,
|
||||
Container(
|
||||
color: theme.palette.background,
|
||||
color: theme.paletteOf(context).background,
|
||||
padding: CommonStyle.padding,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
@ -230,7 +230,7 @@ class UserScreen extends StatelessWidget {
|
||||
spacing: 3,
|
||||
children: week.contributionDays.map((day) {
|
||||
var color = convertColor(day.color);
|
||||
if (theme.brightnessEnum == Brightness.dark) {
|
||||
if (theme.brightnessOf(context) == Brightness.dark) {
|
||||
color = Color.fromRGBO(0xff - color.red,
|
||||
0xff - color.green, 0xff - color.blue, 1);
|
||||
}
|
||||
@ -256,7 +256,8 @@ class UserScreen extends StatelessWidget {
|
||||
leftIconData: Octicons.organization,
|
||||
text: TextContainsOrganization(
|
||||
p.company,
|
||||
style: TextStyle(fontSize: 17, color: theme.palette.text),
|
||||
style: TextStyle(
|
||||
fontSize: 17, color: theme.paletteOf(context).text),
|
||||
oneLine: true,
|
||||
),
|
||||
),
|
||||
|
@ -104,7 +104,7 @@ class UsersScreen extends StatelessWidget {
|
||||
Icon(
|
||||
Octicons.organization,
|
||||
size: 15,
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(company),
|
||||
@ -117,7 +117,7 @@ class UsersScreen extends StatelessWidget {
|
||||
Icon(
|
||||
Octicons.location,
|
||||
size: 15,
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(location),
|
||||
@ -129,7 +129,7 @@ class UsersScreen extends StatelessWidget {
|
||||
Icon(
|
||||
Octicons.clock,
|
||||
size: 15,
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text('Joined on ${dateFormat.format(createdAt)}'),
|
||||
|
@ -60,7 +60,7 @@ TextSpan createLinkSpan(
|
||||
return TextSpan(
|
||||
text: text,
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
recognizer: TapGestureRecognizer()
|
||||
@ -154,7 +154,7 @@ class PrimerBranchName extends StatelessWidget {
|
||||
child: Text(
|
||||
name,
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontSize: 14,
|
||||
height: 1,
|
||||
fontFamily: CommonStyle.monospace,
|
||||
|
@ -39,7 +39,8 @@ class BlobView extends StatelessWidget {
|
||||
case 'webp':
|
||||
return PhotoView(
|
||||
imageProvider: NetworkImage(payload),
|
||||
backgroundDecoration: BoxDecoration(color: theme.palette.background),
|
||||
backgroundDecoration:
|
||||
BoxDecoration(color: theme.paletteOf(context).background),
|
||||
);
|
||||
case 'md':
|
||||
case 'markdown':
|
||||
|
@ -21,7 +21,7 @@ class BorderView extends StatelessWidget {
|
||||
margin: EdgeInsets.only(left: leftPadding),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(color: theme.palette.border, width: 0),
|
||||
top: BorderSide(color: theme.paletteOf(context).border, width: 0),
|
||||
),
|
||||
),
|
||||
);
|
||||
@ -33,14 +33,15 @@ class BorderView extends StatelessWidget {
|
||||
width: leftPadding,
|
||||
height: height,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(color: theme.palette.background),
|
||||
decoration:
|
||||
BoxDecoration(color: theme.paletteOf(context).background),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: height,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(color: theme.palette.border),
|
||||
decoration: BoxDecoration(color: theme.paletteOf(context).border),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -59,7 +59,8 @@ class CommentItem extends StatelessWidget {
|
||||
Text(
|
||||
timeago.format(DateTime.parse(payload['createdAt'])),
|
||||
style: TextStyle(
|
||||
color: theme.palette.tertiaryText, fontSize: 13),
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
fontSize: 13),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -92,7 +93,8 @@ class CommentItem extends StatelessWidget {
|
||||
SizedBox(width: 4),
|
||||
Text(numberFormat.format(count),
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary, fontSize: 14))
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontSize: 14))
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -120,9 +122,11 @@ class CommentItem extends StatelessWidget {
|
||||
child: Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('+', style: TextStyle(color: theme.palette.primary)),
|
||||
Text('+',
|
||||
style:
|
||||
TextStyle(color: theme.paletteOf(context).primary)),
|
||||
Icon(Octicons.smiley,
|
||||
color: theme.palette.primary, size: 18),
|
||||
color: theme.paletteOf(context).primary, size: 18),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -31,14 +31,14 @@ class EntryItem extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.palette.text,
|
||||
color: theme.paletteOf(context).text,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ class EventItem extends StatelessWidget {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return TextSpan(
|
||||
text: text,
|
||||
style: TextStyle(color: theme.palette.primary),
|
||||
style: TextStyle(color: theme.paletteOf(context).primary),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
theme.push(context, url);
|
||||
@ -62,7 +62,7 @@ class EventItem extends StatelessWidget {
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.text,
|
||||
color: theme.paletteOf(context).text,
|
||||
),
|
||||
children: [
|
||||
_buildLinkSpan(
|
||||
@ -77,7 +77,7 @@ class EventItem extends StatelessWidget {
|
||||
Text(timeago.format(e.createdAt),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
)),
|
||||
],
|
||||
),
|
||||
@ -99,7 +99,7 @@ class EventItem extends StatelessWidget {
|
||||
spans: [
|
||||
TextSpan(
|
||||
text: ' ' + e.type,
|
||||
style: TextStyle(color: theme.palette.primary),
|
||||
style: TextStyle(color: theme.paletteOf(context).primary),
|
||||
)
|
||||
],
|
||||
card: Text('Woops, ${e.type} not implemented yet'),
|
||||
@ -114,14 +114,15 @@ class EventItem extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.palette.grayBackground,
|
||||
color: theme.paletteOf(context).grayBackground,
|
||||
borderRadius: BorderRadius.all(Radius.circular(4))),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: theme.palette.text, fontSize: 15),
|
||||
style: TextStyle(
|
||||
color: theme.paletteOf(context).text, fontSize: 15),
|
||||
children: [
|
||||
TextSpan(
|
||||
text:
|
||||
@ -140,7 +141,7 @@ class EventItem extends StatelessWidget {
|
||||
Text(
|
||||
commit.sha.substring(0, 7),
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontSize: 15,
|
||||
fontFamily: CommonStyle.monospace,
|
||||
),
|
||||
@ -151,7 +152,8 @@ class EventItem extends StatelessWidget {
|
||||
commit.message,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style: TextStyle(color: theme.palette.text, fontSize: 15),
|
||||
style: TextStyle(
|
||||
color: theme.paletteOf(context).text, fontSize: 15),
|
||||
),
|
||||
)
|
||||
],
|
||||
@ -190,7 +192,7 @@ class EventItem extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.palette.grayBackground,
|
||||
color: theme.paletteOf(context).grayBackground,
|
||||
borderRadius: BorderRadius.all(Radius.circular(4))),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -205,7 +207,7 @@ class EventItem extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 17,
|
||||
color: theme.palette.text,
|
||||
color: theme.paletteOf(context).text,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@ -217,8 +219,9 @@ class EventItem extends StatelessWidget {
|
||||
body,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 3,
|
||||
style:
|
||||
TextStyle(color: theme.palette.secondaryText, fontSize: 15),
|
||||
style: TextStyle(
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
fontSize: 15),
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
@ -227,20 +230,20 @@ class EventItem extends StatelessWidget {
|
||||
Text(issue.user.login,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
)),
|
||||
Expanded(child: Container()),
|
||||
if (issue.comments != null) ...[
|
||||
Icon(
|
||||
Octicons.comment,
|
||||
size: 14,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(issue.comments.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
)),
|
||||
]
|
||||
],
|
||||
|
@ -73,7 +73,7 @@ class IssueItem extends StatelessWidget {
|
||||
TextSpan(
|
||||
text: '#${payload['number']}',
|
||||
style: TextStyle(
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
@ -81,7 +81,7 @@ class IssueItem extends StatelessWidget {
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.text,
|
||||
color: theme.paletteOf(context).text,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -100,7 +100,7 @@ class IssueItem extends StatelessWidget {
|
||||
DefaultTextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
@ -125,7 +125,8 @@ class IssueItem extends StatelessWidget {
|
||||
Expanded(child: SizedBox()),
|
||||
Icon(Octicons.comment,
|
||||
size: 14,
|
||||
color: theme.palette.secondaryText),
|
||||
color:
|
||||
theme.paletteOf(context).secondaryText),
|
||||
SizedBox(width: 3),
|
||||
Text(numberFormat
|
||||
.format(payload['comments']['totalCount']))
|
||||
|
@ -20,7 +20,7 @@ class ListGroup<T> extends StatelessWidget {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(top: BorderSide(color: theme.palette.border)),
|
||||
border: Border(top: BorderSide(color: theme.paletteOf(context).border)),
|
||||
),
|
||||
child: itemBuilder(entry.value, entry.key),
|
||||
);
|
||||
@ -33,7 +33,7 @@ class ListGroup<T> extends StatelessWidget {
|
||||
padding: padding,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: theme.palette.border),
|
||||
border: Border.all(color: theme.paletteOf(context).border),
|
||||
borderRadius: BorderRadius.all(Radius.circular(3)),
|
||||
),
|
||||
child: Column(
|
||||
|
@ -20,8 +20,8 @@ class MarkdownView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final _basicStyle =
|
||||
TextStyle(fontSize: 16, color: theme.palette.text, height: 1.5);
|
||||
final _basicStyle = TextStyle(
|
||||
fontSize: 16, color: theme.paletteOf(context).text, height: 1.5);
|
||||
final _hStyle =
|
||||
_basicStyle.copyWith(fontWeight: FontWeight.w600, height: 1.25);
|
||||
|
||||
@ -69,7 +69,7 @@ class MarkdownView extends StatelessWidget {
|
||||
},
|
||||
data: text,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
a: _basicStyle.copyWith(color: theme.palette.primary),
|
||||
a: _basicStyle.copyWith(color: theme.paletteOf(context).primary),
|
||||
p: _basicStyle,
|
||||
code: _basicStyle.copyWith(
|
||||
fontSize: 16 * 0.85,
|
||||
@ -82,11 +82,12 @@ class MarkdownView extends StatelessWidget {
|
||||
h4: _hStyle,
|
||||
h5: _hStyle.copyWith(fontSize: 14),
|
||||
h6: _hStyle.copyWith(
|
||||
fontSize: 16 * 0.85, color: theme.palette.tertiaryText),
|
||||
fontSize: 16 * 0.85, color: theme.paletteOf(context).tertiaryText),
|
||||
em: _basicStyle.copyWith(fontStyle: FontStyle.italic),
|
||||
strong: _basicStyle.copyWith(fontWeight: FontWeight.w600),
|
||||
del: const TextStyle(decoration: TextDecoration.lineThrough),
|
||||
blockquote: _basicStyle.copyWith(color: theme.palette.tertiaryText),
|
||||
blockquote:
|
||||
_basicStyle.copyWith(color: theme.paletteOf(context).tertiaryText),
|
||||
img: _basicStyle,
|
||||
checkbox: _basicStyle,
|
||||
blockSpacing: 16,
|
||||
@ -104,14 +105,14 @@ class MarkdownView extends StatelessWidget {
|
||||
),
|
||||
codeblockPadding: EdgeInsets.all(16),
|
||||
codeblockDecoration: BoxDecoration(
|
||||
color: theme.palette.grayBackground,
|
||||
color: theme.paletteOf(context).grayBackground,
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
horizontalRuleDecoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
width: 4,
|
||||
color: theme.palette.grayBackground,
|
||||
color: theme.paletteOf(context).grayBackground,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -17,7 +17,7 @@ class MutationButton extends StatelessWidget {
|
||||
return CupertinoButton(
|
||||
onPressed: onPressed,
|
||||
minSize: 0,
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 14,
|
||||
vertical: 5,
|
||||
@ -27,7 +27,7 @@ class MutationButton extends StatelessWidget {
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: theme.palette.background,
|
||||
color: theme.paletteOf(context).background,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -71,8 +71,9 @@ class _NotificationItemState extends State<NotificationItem> {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
return Icon(
|
||||
payload.unread ? Octicons.check : Octicons.primitive_dot,
|
||||
color:
|
||||
loading ? theme.palette.grayBackground : theme.palette.tertiaryText,
|
||||
color: loading
|
||||
? theme.paletteOf(context).grayBackground
|
||||
: theme.paletteOf(context).tertiaryText,
|
||||
size: 24,
|
||||
);
|
||||
}
|
||||
@ -133,7 +134,8 @@ class _NotificationItemState extends State<NotificationItem> {
|
||||
child: Text(
|
||||
payload.subject.title,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: theme.palette.text),
|
||||
style: TextStyle(
|
||||
fontSize: 15, color: theme.paletteOf(context).text),
|
||||
),
|
||||
),
|
||||
Link(child: _buildCheckIcon(), onTap: _markAsRead),
|
||||
|
@ -79,14 +79,14 @@ class RepositoryItem extends StatelessWidget {
|
||||
owner + ' / ',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@ -97,8 +97,10 @@ class RepositoryItem extends StatelessWidget {
|
||||
SizedBox(width: 6),
|
||||
DefaultTextStyle(
|
||||
child: Icon(iconData,
|
||||
size: 16, color: theme.palette.secondaryText),
|
||||
style: TextStyle(color: theme.palette.secondaryText),
|
||||
size: 16,
|
||||
color: theme.paletteOf(context).secondaryText),
|
||||
style: TextStyle(
|
||||
color: theme.paletteOf(context).secondaryText),
|
||||
),
|
||||
]
|
||||
],
|
||||
@ -108,7 +110,7 @@ class RepositoryItem extends StatelessWidget {
|
||||
Text(
|
||||
description,
|
||||
style: TextStyle(
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
@ -119,13 +121,14 @@ class RepositoryItem extends StatelessWidget {
|
||||
note,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
DefaultTextStyle(
|
||||
style: TextStyle(color: theme.palette.text, fontSize: 14),
|
||||
style: TextStyle(
|
||||
color: theme.paletteOf(context).text, fontSize: 14),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
if (primaryLanguageName != null) ...[
|
||||
@ -146,14 +149,14 @@ class RepositoryItem extends StatelessWidget {
|
||||
],
|
||||
if (starCount > 0) ...[
|
||||
Icon(Octicons.star,
|
||||
size: 16, color: theme.palette.text),
|
||||
size: 16, color: theme.paletteOf(context).text),
|
||||
SizedBox(width: 2),
|
||||
Text(numberFormat.format(starCount)),
|
||||
SizedBox(width: 24),
|
||||
],
|
||||
if (forkCount > 0) ...[
|
||||
Icon(Octicons.repo_forked,
|
||||
size: 16, color: theme.palette.text),
|
||||
size: 16, color: theme.paletteOf(context).text),
|
||||
SizedBox(width: 2),
|
||||
Text(numberFormat.format(forkCount)),
|
||||
],
|
||||
|
@ -18,7 +18,8 @@ class TableViewHeader extends StatelessWidget {
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||
child: Text(
|
||||
title.toUpperCase(),
|
||||
style: TextStyle(color: theme.palette.secondaryText, fontSize: 13),
|
||||
style: TextStyle(
|
||||
color: theme.paletteOf(context).secondaryText, fontSize: 13),
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -71,7 +72,7 @@ class TableView extends StatelessWidget {
|
||||
if (leftWidget == null && hasIcon) {
|
||||
leftWidget = Icon(
|
||||
item.leftIconData,
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
size: 20,
|
||||
);
|
||||
}
|
||||
@ -80,7 +81,8 @@ class TableView extends StatelessWidget {
|
||||
onTap: item.onTap,
|
||||
url: item.url,
|
||||
child: DefaultTextStyle(
|
||||
style: TextStyle(fontSize: 17, color: theme.palette.text),
|
||||
style: TextStyle(
|
||||
fontSize: 17, color: theme.paletteOf(context).text),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
child: Container(
|
||||
height: 44,
|
||||
@ -95,7 +97,7 @@ class TableView extends StatelessWidget {
|
||||
DefaultTextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: theme.paletteOf(context).tertiaryText,
|
||||
),
|
||||
child: item.rightWidget,
|
||||
),
|
||||
@ -104,7 +106,8 @@ class TableView extends StatelessWidget {
|
||||
if ((item.onTap != null || item.url != null) &&
|
||||
!item.hideRightChevron)
|
||||
Icon(CupertinoIcons.right_chevron,
|
||||
size: 20, color: theme.palette.tertiaryText)
|
||||
size: 20,
|
||||
color: theme.paletteOf(context).tertiaryText)
|
||||
else
|
||||
SizedBox(width: 2),
|
||||
SizedBox(width: 8),
|
||||
|
@ -34,7 +34,8 @@ class TimelineEventItem extends StatelessWidget {
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: theme.palette.text, fontSize: 16),
|
||||
style:
|
||||
TextStyle(color: theme.paletteOf(context).text, fontSize: 16),
|
||||
children: [
|
||||
// TODO: actor is null
|
||||
createUserSpan(context, actor),
|
||||
@ -287,12 +288,12 @@ class TimelineItem extends StatelessWidget {
|
||||
TextSpan(text: ' branch from '),
|
||||
TextSpan(
|
||||
text: (p['beforeCommit']['oid'] as String).substring(0, 7),
|
||||
style: TextStyle(color: theme.palette.primary),
|
||||
style: TextStyle(color: theme.paletteOf(context).primary),
|
||||
),
|
||||
TextSpan(text: ' to '),
|
||||
TextSpan(
|
||||
text: (p['afterCommit']['oid'] as String).substring(0, 7),
|
||||
style: TextStyle(color: theme.palette.primary),
|
||||
style: TextStyle(color: theme.paletteOf(context).primary),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -46,7 +46,7 @@ class UserItem extends StatelessWidget {
|
||||
// Text(
|
||||
// name ?? login,
|
||||
// style: TextStyle(
|
||||
// color: theme.palette.text,
|
||||
// color: theme.paletteOf(context).text,
|
||||
// fontSize: 18,
|
||||
// ),
|
||||
// ),
|
||||
@ -54,7 +54,7 @@ class UserItem extends StatelessWidget {
|
||||
Text(
|
||||
login,
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary,
|
||||
color: theme.paletteOf(context).primary,
|
||||
fontSize: 18,
|
||||
// fontWeight: FontWeight.w600,
|
||||
),
|
||||
@ -65,7 +65,7 @@ class UserItem extends StatelessWidget {
|
||||
if (bio != null)
|
||||
DefaultTextStyle(
|
||||
style: TextStyle(
|
||||
color: theme.palette.secondaryText,
|
||||
color: theme.paletteOf(context).secondaryText,
|
||||
fontSize: 15,
|
||||
),
|
||||
child: bio,
|
||||
|
Loading…
x
Reference in New Issue
Block a user