使用pipenv shell配置git-aware-prompt更改激活pipenv的PS1

问题描述

在直接激活pipenv shell之后我更改了PS1

import 'package:Flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',theme: ThemeData(
        primarySwatch: Colors.purple,buttonTheme: ButtonThemeData(
          buttonColor: Colors.purple.shade400,),visualDensity: VisualDensity.adaptivePlatformDensity,home: BillSpitApp(),);
  }
}

class BillSpitApp extends StatefulWidget {
  BillSpitApp({Key key}) : super(key: key);

  @override
  _BillSpitAppState createState() => _BillSpitAppState();
}

class _BillSpitAppState extends State<BillSpitApp> {
  int amount;
  int numOfPersons;
  double splitAmount;

  GlobalKey<FormState> _formKey = GlobalKey<FormState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Bill split app"),body: Padding(
        padding: const EdgeInsets.all(15.0),child: Form(
          key: _formKey,child: Column(
            mainAxisAlignment: MainAxisAlignment.center,children: <Widget>[
              Text(
                splitAmount == null
                    ? "Fill the details and click on calculate to get your bill split"
                    : "Bill split is ${splitAmount.toStringAsFixed(2)}",style: TextStyle(
                  fontSize: 25,textAlign: TextAlign.center,Padding(
                padding: const EdgeInsets.symmetric(vertical: 15.0),child: TextFormField(
                  keyboardType: TextInputType.number,validator: (value) {
                    print("validator amount value $value");
                    if (value.isEmpty) {
                      return "Enter some amount";
                    } else if (double.parse(value).toInt() <= 0) {
                      return "Amount should be greater than 0";
                    }
                    return null;
                  },onSaved: (value) {
                    print("onSaved amount value $value");
                    amount = int.parse(value);
                    //int.parse(value);
                  },decoration: Inputdecoration(
                    labelText: "Amount",hintText: "1000",border: OutlineInputBorder(),TextFormField(
                validator: (value) {
                  print("person value $value");
                  if (value.isEmpty) {
                    return "Enter number of persons";
                  } else if (double.parse(value).toInt() <= 0) {
                    return "Number should be greater than 0";
                  }
                  return null;
                },onSaved: (value) {
                  print("onsave numOfPersons $value");
                  numOfPersons = int.parse(value);
                },keyboardType: TextInputType.number,decoration: Inputdecoration(
                  labelText: "Number of persons",hintText: "5",Padding(
                padding: const EdgeInsets.only(top: 15.0),child: RaisedButton(
                  child: Text(
                    "Calculate",style: TextStyle(color: Colors.white),onpressed: () {
                    if (_formKey.currentState.validate()) {
                      _formKey.currentState.save();
                      print("calculate $amount");
                      print("calculate $numOfPersons");
                      setState(() {
                        splitAmount = amount / numOfPersons;
                      });
                    }
                  },],);
  }
}

覆盖

~/.local/share/virtualenvs/MyVirtualenv-w4mUkkMk/bin/activate

if [ -z "${VIRTUAL_ENV_disABLE_PROMPT-}" ] ; then _OLD_VIRTUAL_PS1="$PS1" if [ "x" != x ] ; then PS1="$PS1" else PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1 \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ " fi export PS1 fi https://github.com/jimeh/git-aware-prompt

使用pipenv shell激活virtualenv后如何返回git_branch?

我尝试编辑git_branch,但不起作用。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...